added 5 changesets to branch 'refs/remotes/xyzzy-github/x86_64' old head: 12bd7812dd6b6eadb65789ca9fc2e270d7d66fd4 new head: a9fdaec18aa39c5af3dd94a998325c520eb4423c ---------------------------------------------------------------------------- 1b41387: Added missing packed attributes on disk_identifier. d7ec2fa: A couple of format string fixes for tracing printfs. 0063d2b: Various 64-bit fixes to SCSI and ATA bus managers/drivers. Mostly compilation fixes, as well as a few 64-bit safety fixes. I've briefly looked through everything for any obvious issues and fixed the ones I've found, and it seems like they're working properly, though there could be some more well hidden ones that I've missed. 7f7e76e: 64-bit compilation fixes for write_overlay and intel partitioning system modules. a9fdaec: Added disk drivers and CD file system modules to the boot image for x86_64. This adds disk drivers, intel/session partitioning systems, and ISO9660 (+ write/attribute_overlay) modules to the CD/floppy boot image targets for x86_64. The kernel now detects and mounts the boot CD, and runs up to attempting to start the boot script. [ Alex Smith <alex@xxxxxxxxxxxxxxxx> ] ---------------------------------------------------------------------------- 21 files changed, 128 insertions(+), 92 deletions(-) build/jam/FloppyBootImage | 29 ++++++++-- headers/private/kernel/boot/disk_identifier.h | 22 ++++---- src/add-ons/kernel/bus_managers/ata/ATAChannel.cpp | 4 +- src/add-ons/kernel/bus_managers/ata/ATADevice.cpp | 2 +- .../kernel/bus_managers/scsi/dma_buffer.cpp | 2 +- src/add-ons/kernel/bus_managers/scsi/queuing.cpp | 7 ++- .../kernel/bus_managers/scsi/scatter_gather.cpp | 7 ++- .../kernel/bus_managers/scsi/scsi_internal.h | 10 ++-- src/add-ons/kernel/bus_managers/scsi/scsi_io.cpp | 4 +- .../kernel/bus_managers/scsi/virtual_memory.cpp | 4 +- .../kernel/drivers/disk/scsi/scsi_cd/scsi_cd.cpp | 7 ++- .../drivers/disk/scsi/scsi_disk/scsi_disk.cpp | 3 +- .../layers/write_overlay/write_overlay.cpp | 4 +- .../kernel/generic/ata_adapter/ata_adapter.cpp | 8 +-- src/add-ons/kernel/generic/scsi_periph/block.cpp | 3 +- src/add-ons/kernel/generic/scsi_periph/device.cpp | 2 +- .../intel/PartitionMapWriter.cpp | 21 +++---- .../kernel/partitioning_systems/intel/intel.cpp | 28 ++++----- .../partitioning_systems/intel/write_support.cpp | 47 +++++++++------- .../kernel/device_manager/device_manager.cpp | 2 +- src/system/kernel/fs/vfs_boot.cpp | 4 +- ############################################################################ Commit: 1b41387b5f54acc9ad4e71fc377d98eb63fbac74 Author: Alex Smith <alex@xxxxxxxxxxxxxxxx> Date: Fri Jul 20 16:14:17 2012 UTC Added missing packed attributes on disk_identifier. ---------------------------------------------------------------------------- diff --git a/headers/private/kernel/boot/disk_identifier.h b/headers/private/kernel/boot/disk_identifier.h index 52f2ceb..b1c64e9 100644 --- a/headers/private/kernel/boot/disk_identifier.h +++ b/headers/private/kernel/boot/disk_identifier.h @@ -34,41 +34,41 @@ typedef struct disk_identifier { union { struct { uint16 base_address; - } legacy; + } _PACKED legacy; struct { uint8 bus; uint8 slot; uint8 function; - } pci; + } _PACKED pci; } bus; union { struct { bool master; - } ata; + } _PACKED ata; struct { bool master; uint8 logical_unit; - } atapi; + } _PACKED atapi; struct { uint8 logical_unit; - } scsi; + } _PACKED scsi; struct { uint8 tbd; - } usb; + } _PACKED usb; struct { uint64 guid; - } firewire; + } _PACKED firewire; struct { uint64 wwd; - } fibre; + } _PACKED fibre; struct { off_t size; struct { off_t offset; uint32 sum; - } check_sums[NUM_DISK_CHECK_SUMS]; - } unknown; + } _PACKED check_sums[NUM_DISK_CHECK_SUMS]; + } _PACKED unknown; } device; -} disk_identifier; +} _PACKED disk_identifier; #endif /* KERNEL_BOOT_DISK_IDENTIFIER_H */ ############################################################################ Commit: d7ec2fa3bfda5ba1674e97528fba2f4cfec00144 Author: Alex Smith <alex@xxxxxxxxxxxxxxxx> Date: Fri Jul 20 16:37:37 2012 UTC A couple of format string fixes for tracing printfs. ---------------------------------------------------------------------------- diff --git a/src/system/kernel/device_manager/device_manager.cpp b/src/system/kernel/device_manager/device_manager.cpp index 239ac4b..ec71aa1 100644 --- a/src/system/kernel/device_manager/device_manager.cpp +++ b/src/system/kernel/device_manager/device_manager.cpp @@ -1513,7 +1513,7 @@ device_node::_AddPath(Stack<KPath*>& stack, const char* basePath, if (status == B_OK) status = stack.Push(path); - TRACE((" add path: \"%s\", %ld\n", path->Path(), status)); + TRACE((" add path: \"%s\", %" B_PRId32 "\n", path->Path(), status)); if (status != B_OK) delete path; diff --git a/src/system/kernel/fs/vfs_boot.cpp b/src/system/kernel/fs/vfs_boot.cpp index 21b1b9e..3361217 100644 --- a/src/system/kernel/fs/vfs_boot.cpp +++ b/src/system/kernel/fs/vfs_boot.cpp @@ -194,8 +194,8 @@ DiskBootMethod::IsBootDevice(KDiskDevice* device, bool strict) return false; } - TRACE(("boot device: bus %ld, device %ld\n", disk->bus_type, - disk->device_type)); + TRACE(("boot device: bus %" B_PRId32 ", device %" B_PRId32 "\n", + disk->bus_type, disk->device_type)); // Assume that CD boots only happen off removable media. if (fMethod == BOOT_METHOD_CD && !device->IsRemovable()) ############################################################################ Commit: 0063d2ba513ddb6bd54c329aa0d16c7e184862da Author: Alex Smith <alex@xxxxxxxxxxxxxxxx> Date: Fri Jul 20 16:47:12 2012 UTC Various 64-bit fixes to SCSI and ATA bus managers/drivers. Mostly compilation fixes, as well as a few 64-bit safety fixes. I've briefly looked through everything for any obvious issues and fixed the ones I've found, and it seems like they're working properly, though there could be some more well hidden ones that I've missed. ---------------------------------------------------------------------------- diff --git a/src/add-ons/kernel/bus_managers/ata/ATAChannel.cpp b/src/add-ons/kernel/bus_managers/ata/ATAChannel.cpp index 969ed2b..1aefcbc 100644 --- a/src/add-ons/kernel/bus_managers/ata/ATAChannel.cpp +++ b/src/add-ons/kernel/bus_managers/ata/ATAChannel.cpp @@ -29,7 +29,7 @@ ATAChannel::ATAChannel(device_node *node) gDeviceManager->get_attr_uint32(node, ATA_CHANNEL_ID_ITEM, &fChannelID, true); - snprintf(fDebugContext, sizeof(fDebugContext), " %lu", fChannelID); + snprintf(fDebugContext, sizeof(fDebugContext), " %" B_PRIu32, fChannelID); if (fUseDMA) { void *settings = load_driver_settings(B_SAFEMODE_DRIVER_SETTINGS); @@ -879,7 +879,7 @@ ATAChannel::_FlushAndWait(bigtime_t waitTime) status_t ATAChannel::_ReadPIOBlock(ATARequest *request, size_t length) { - uint32 transferred = 0; + size_t transferred = 0; status_t result = _TransferPIOBlock(request, length, &transferred); request->CCB()->data_resid -= transferred; diff --git a/src/add-ons/kernel/bus_managers/ata/ATADevice.cpp b/src/add-ons/kernel/bus_managers/ata/ATADevice.cpp index f055eb1..323b30f 100644 --- a/src/add-ons/kernel/bus_managers/ata/ATADevice.cpp +++ b/src/add-ons/kernel/bus_managers/ata/ATADevice.cpp @@ -574,7 +574,7 @@ ATADevice::Configure() status_t ATADevice::Identify() { - snprintf(fDebugContext, sizeof(fDebugContext), "%s %lu-%u", + snprintf(fDebugContext, sizeof(fDebugContext), "%s %" B_PRIu32 "-%u", IsATAPI() ? "pi" : "", fChannel->ChannelID(), fIndex); ATARequest request(false); diff --git a/src/add-ons/kernel/bus_managers/scsi/dma_buffer.cpp b/src/add-ons/kernel/bus_managers/scsi/dma_buffer.cpp index 9da56a5..338a45f 100644 --- a/src/add-ons/kernel/bus_managers/scsi/dma_buffer.cpp +++ b/src/add-ons/kernel/bus_managers/scsi/dma_buffer.cpp @@ -51,7 +51,7 @@ is_sg_list_dma_safe(scsi_ccb *request) } // if there are no further restrictions - be happy - if (dma_boundary == ~0UL && alignment == 0 && max_sg_block_size == 0) + if (dma_boundary == ~(uint32)0 && alignment == 0 && max_sg_block_size == 0) return true; // argh - controller is a bit picky, so make sure he likes us diff --git a/src/add-ons/kernel/bus_managers/scsi/queuing.cpp b/src/add-ons/kernel/bus_managers/scsi/queuing.cpp index 3282b74..58d1516 100644 --- a/src/add-ons/kernel/bus_managers/scsi/queuing.cpp +++ b/src/add-ons/kernel/bus_managers/scsi/queuing.cpp @@ -55,7 +55,8 @@ static void scsi_insert_new_request( scsi_device_info *device, { scsi_ccb *first, *last, *before, *next; - SHOW_FLOW( 3, "inserting new_request=%p, pos=%Ld", new_request, new_request->sort ); + SHOW_FLOW( 3, "inserting new_request=%p, pos=%" B_PRId64, new_request, + new_request->sort ); first = device->queued_reqs; @@ -65,7 +66,7 @@ static void scsi_insert_new_request( scsi_device_info *device, return; } - SHOW_FLOW( 3, "first=%p, pos=%Ld, last_pos=%Ld", + SHOW_FLOW( 3, "first=%p, pos=%" B_PRId64 ", last_pos=%" B_PRId64, first, first->sort, device->last_sort ); // don't let syncs bypass others @@ -153,7 +154,7 @@ static void scsi_insert_new_request( scsi_device_info *device, return; } - SHOW_FLOW( 1, "inserting after %p (pos=%Ld) and before %p (pos=%Ld)", + SHOW_FLOW( 1, "inserting after %p (pos=%" B_PRId64 ") and before %p (pos=%" B_PRId64 ")", before, before->sort, next, next->sort ); // if we haven't found a proper position, we automatically insert diff --git a/src/add-ons/kernel/bus_managers/scsi/scatter_gather.cpp b/src/add-ons/kernel/bus_managers/scsi/scatter_gather.cpp index f4b2da0..2d4977f 100644 --- a/src/add-ons/kernel/bus_managers/scsi/scatter_gather.cpp +++ b/src/add-ons/kernel/bus_managers/scsi/scatter_gather.cpp @@ -51,7 +51,7 @@ fill_temp_sg(scsi_ccb *ccb) if (mapped_len != ccb->data_length) goto too_complex; - if (dma_boundary != ~0UL || ccb->data_length > max_sg_block_size) { + if (dma_boundary != ~(uint32)0 || ccb->data_length > max_sg_block_size) { // S/G list may not be controller-compatible: // we have to split offending entries SHOW_FLOW(3, "Checking violation of dma boundary 0x%x and entry size 0x%x", @@ -64,7 +64,7 @@ fill_temp_sg(scsi_ccb *ccb) max_len = (dma_boundary + 1) - (temp_sg[cur_idx].address & dma_boundary); // restrict size per sg item - max_len = std::min(max_len, max_sg_block_size); + max_len = std::min(max_len, (addr_t)max_sg_block_size); SHOW_FLOW(4, "addr=%#" B_PRIxPHYSADDR ", size=%x, max_len=%x, " "idx=%d, num=%d", temp_sg[cur_idx].address, @@ -107,7 +107,8 @@ create_temp_sg(scsi_ccb *ccb) physical_entry *temp_sg; status_t res; - SHOW_FLOW(3, "ccb=%p, data=%p, data_length=%lu", ccb, ccb->data, ccb->data_length); + SHOW_FLOW(3, "ccb=%p, data=%p, data_length=%" B_PRIu32, ccb, ccb->data, + ccb->data_length); ccb->sg_list = temp_sg = (physical_entry*)locked_pool->alloc(temp_sg_pool); if (temp_sg == NULL) { diff --git a/src/add-ons/kernel/bus_managers/scsi/scsi_internal.h b/src/add-ons/kernel/bus_managers/scsi/scsi_internal.h index 5a1105a..1c4fd70 100644 --- a/src/add-ons/kernel/bus_managers/scsi/scsi_internal.h +++ b/src/add-ons/kernel/bus_managers/scsi/scsi_internal.h @@ -121,21 +121,21 @@ typedef struct scsi_bus_info { typedef struct dma_buffer { area_id area; // area of DMA buffer uchar *address; // address of DMA buffer - uint32 size; // size of DMA buffer + size_t size; // size of DMA buffer area_id sg_list_area; // area of S/G list physical_entry *sg_list; // address of S/G list - uint32 sg_count; // number of entries in S/G list + size_t sg_count; // number of entries in S/G list bool inuse; // true, if in use bigtime_t last_use; // timestamp of last usage area_id sg_orig; // area of S/G list to original data physical_entry *sg_list_orig; // S/G list to original data - uint32 sg_count_max_orig; // maximum size (in entries) - uint32 sg_count_orig; // current size (in entries) + size_t sg_count_max_orig; // maximum size (in entries) + size_t sg_count_orig; // current size (in entries) uchar *orig_data; // pointer to original data const physical_entry *orig_sg_list; // original S/G list - uint32 orig_sg_count; // size of original S/G list + size_t orig_sg_count; // size of original S/G list } dma_buffer; diff --git a/src/add-ons/kernel/bus_managers/scsi/scsi_io.cpp b/src/add-ons/kernel/bus_managers/scsi/scsi_io.cpp index d07405a..23663d9 100644 --- a/src/add-ons/kernel/bus_managers/scsi/scsi_io.cpp +++ b/src/add-ons/kernel/bus_managers/scsi/scsi_io.cpp @@ -367,7 +367,7 @@ scsi_check_enqueue_request(scsi_ccb *request) if (request->sort >= 0) { device->last_sort = request->sort; - SHOW_FLOW(1, "%Ld", device->last_sort); + SHOW_FLOW(1, "%" B_PRId64, device->last_sort); } execute = true; @@ -618,7 +618,7 @@ scsi_check_exec_service(scsi_bus_info *bus) if (request->sort >= 0) { device->last_sort = request->sort; - SHOW_FLOW(1, "%Ld", device->last_sort); + SHOW_FLOW(1, "%" B_PRId64, device->last_sort); } RELEASE_BEN(&bus->mutex); diff --git a/src/add-ons/kernel/bus_managers/scsi/virtual_memory.cpp b/src/add-ons/kernel/bus_managers/scsi/virtual_memory.cpp index 94baaa8..3dd7b8d 100644 --- a/src/add-ons/kernel/bus_managers/scsi/virtual_memory.cpp +++ b/src/add-ons/kernel/bus_managers/scsi/virtual_memory.cpp @@ -56,8 +56,8 @@ get_iovec_memory_map(iovec *vec, size_t vec_count, size_t vec_offset, size_t len range_start = (char *)vec->iov_base + vec_offset; range_len = std::min(vec->iov_len - vec_offset, left_len); - SHOW_FLOW( 3, "range_start=%x, range_len=%x", - (int)range_start, (int)range_len ); + SHOW_FLOW( 3, "range_start=%" B_PRIxADDR ", range_len=%" B_PRIxSIZE, + (addr_t)range_start, range_len ); vec_offset = 0; diff --git a/src/add-ons/kernel/drivers/disk/scsi/scsi_cd/scsi_cd.cpp b/src/add-ons/kernel/drivers/disk/scsi/scsi_cd/scsi_cd.cpp index e01fd5e..69e7c67 100644 --- a/src/add-ons/kernel/drivers/disk/scsi/scsi_cd/scsi_cd.cpp +++ b/src/add-ons/kernel/drivers/disk/scsi/scsi_cd/scsi_cd.cpp @@ -184,8 +184,8 @@ test_capacity(cd_driver_info *info) } if (info->capacity != info->original_capacity) { - dprintf("scsi_cd: adjusted capacity from %llu to %llu blocks.\n", - info->original_capacity, info->capacity); + dprintf("scsi_cd: adjusted capacity from %" B_PRIu64 " to %" B_PRIu64 + " blocks.\n", info->original_capacity, info->capacity); } return B_OK; @@ -981,7 +981,8 @@ cd_set_capacity(cd_driver_info* info, uint64 capacity, uint32 blockSize) } if (info->block_size != 0) { - dprintf("old %ld, new %ld\n", info->block_size, blockSize); + dprintf("old %" B_PRId32 ", new %" B_PRId32 "\n", info->block_size, + blockSize); panic("updating DMAResource not yet implemented..."); } diff --git a/src/add-ons/kernel/drivers/disk/scsi/scsi_disk/scsi_disk.cpp b/src/add-ons/kernel/drivers/disk/scsi/scsi_disk/scsi_disk.cpp index 0f2fe7f..3075bd7 100644 --- a/src/add-ons/kernel/drivers/disk/scsi/scsi_disk/scsi_disk.cpp +++ b/src/add-ons/kernel/drivers/disk/scsi/scsi_disk/scsi_disk.cpp @@ -417,7 +417,8 @@ das_set_capacity(das_driver_info* info, uint64 capacity, uint32 blockSize) if (info->block_size != blockSize) { if (info->block_size != 0) { - dprintf("old %ld, new %ld\n", info->block_size, blockSize); + dprintf("old %" B_PRId32 ", new %" B_PRId32 "\n", info->block_size, + blockSize); panic("updating DMAResource not yet implemented..."); } diff --git a/src/add-ons/kernel/generic/ata_adapter/ata_adapter.cpp b/src/add-ons/kernel/generic/ata_adapter/ata_adapter.cpp index 4289ed7..e0a258a 100644 --- a/src/add-ons/kernel/generic/ata_adapter/ata_adapter.cpp +++ b/src/add-ons/kernel/generic/ata_adapter/ata_adapter.cpp @@ -250,8 +250,8 @@ ata_adapter_prepare_dma(ata_adapter_channel_info *channel, writeToDevice ? "write" : "read", sgListCount); for (i = sgListCount - 1, prd = channel->prdt; i >= 0; --i, ++prd, ++sgList) { - prd->address = B_HOST_TO_LENDIAN_INT32((uint32)pci->ram_address(device, - (void*)(addr_t)sgList->address)); + prd->address = B_HOST_TO_LENDIAN_INT32((uint32)(addr_t)pci->ram_address( + device, (void*)(addr_t)sgList->address)); // 0 means 64K - this is done automatically be discarding upper 16 bits prd->count = B_HOST_TO_LENDIAN_INT16((uint16)sgList->size); prd->EOT = i == 0; @@ -266,8 +266,8 @@ ata_adapter_prepare_dma(ata_adapter_channel_info *channel, pci->write_io_32(device, channel->bus_master_base + ATA_BM_PRDT_ADDRESS, (pci->read_io_32(device, channel->bus_master_base + ATA_BM_PRDT_ADDRESS) & 3) - | (B_HOST_TO_LENDIAN_INT32((uint32)pci->ram_address(device, - (void *)channel->prdt_phys)) & ~3)); + | (B_HOST_TO_LENDIAN_INT32((uint32)(addr_t)pci->ram_address(device, + (void*)(addr_t)channel->prdt_phys)) & ~3)); // reset interrupt and error signal status = pci->read_io_8(device, channel->bus_master_base diff --git a/src/add-ons/kernel/generic/scsi_periph/block.cpp b/src/add-ons/kernel/generic/scsi_periph/block.cpp index 7ef69fb..3b3ac63 100644 --- a/src/add-ons/kernel/generic/scsi_periph/block.cpp +++ b/src/add-ons/kernel/generic/scsi_periph/block.cpp @@ -92,7 +92,8 @@ periph_check_capacity(scsi_periph_device_info *device, scsi_ccb *request) blockSize = 0; } - SHOW_FLOW(3, "capacity = %lld, block_size = %ld", capacity, blockSize); + SHOW_FLOW(3, "capacity = %" B_PRId64 ", block_size = %" B_PRId32, capacity, + blockSize); device->block_size = blockSize; diff --git a/src/add-ons/kernel/generic/scsi_periph/device.cpp b/src/add-ons/kernel/generic/scsi_periph/device.cpp index d83a2ab..5d8ab33 100644 --- a/src/add-ons/kernel/generic/scsi_periph/device.cpp +++ b/src/add-ons/kernel/generic/scsi_periph/device.cpp @@ -38,7 +38,7 @@ periph_compose_device_name(device_node *node, const char *prefix) // this is actually an IDE device, so we ignore the prefix // a bus device for those - snprintf(name, sizeof(name), "disk/ata%s/%ld/%s/raw", + snprintf(name, sizeof(name), "disk/ata%s/%" B_PRId32 "/%s/raw", type == scsi_dev_CDROM ? "pi" : "", channel, targetID == 0 ? "master" : "slave"); } else { ############################################################################ Commit: 7f7e76e4615a652686e68102907732d114968b58 Author: Alex Smith <alex@xxxxxxxxxxxxxxxx> Date: Fri Jul 20 16:53:59 2012 UTC 64-bit compilation fixes for write_overlay and intel partitioning system modules. ---------------------------------------------------------------------------- diff --git a/src/add-ons/kernel/file_systems/layers/write_overlay/write_overlay.cpp b/src/add-ons/kernel/file_systems/layers/write_overlay/write_overlay.cpp index 5fd8d6c..cdd0916 100644 --- a/src/add-ons/kernel/file_systems/layers/write_overlay/write_overlay.cpp +++ b/src/add-ons/kernel/file_systems/layers/write_overlay/write_overlay.cpp @@ -265,7 +265,7 @@ OverlayInode::OverlayInode(OverlayVolume *volume, fs_vnode *superVnode, fIsDataModified(false), fFileCache(NULL) { - TRACE("inode created %lld\n", fInodeNumber); + TRACE("inode created %" B_PRIdINO "\n", fInodeNumber); recursive_lock_init(&fLock, "write overlay inode lock"); if (superVnode != NULL) @@ -290,7 +290,7 @@ OverlayInode::OverlayInode(OverlayVolume *volume, fs_vnode *superVnode, OverlayInode::~OverlayInode() { - TRACE("inode destroyed %lld\n", fInodeNumber); + TRACE("inode destroyed %" B_PRIdINO "\n", fInodeNumber); if (fFileCache != NULL) file_cache_delete(fFileCache); diff --git a/src/add-ons/kernel/partitioning_systems/intel/PartitionMapWriter.cpp b/src/add-ons/kernel/partitioning_systems/intel/PartitionMapWriter.cpp index 66cd6b7..4f600e8 100644 --- a/src/add-ons/kernel/partitioning_systems/intel/PartitionMapWriter.cpp +++ b/src/add-ons/kernel/partitioning_systems/intel/PartitionMapWriter.cpp @@ -73,29 +73,30 @@ check_logical_location(const LogicalPartition* child, const PrimaryPartition* parent) { if (child->PartitionTableOffset() % child->BlockSize() != 0) { - TRACE(("check_logical_location() - PartitionTableOffset: %lld not a " - "multiple of media's block size: %ld\n", + TRACE(("check_logical_location() - PartitionTableOffset: %" B_PRId64 " " + "not a multiple of media's block size: %" B_PRId32 "\n", child->PartitionTableOffset(), child->BlockSize())); return false; } if (child->Offset() % child->BlockSize() != 0) { - TRACE(("check_logical_location() - Parition offset: %lld " - "is not a multiple of block size: %ld\n", child->Offset(), + TRACE(("check_logical_location() - Parition offset: %" B_PRId64 " " + "is not a multiple of block size: %" B_PRId32 "\n", child->Offset(), child->BlockSize())); return false; } if (child->Size() % child->BlockSize() != 0) { - TRACE(("check_logical_location() - Size: (%lld) is not a multiple of" - " block size: (%ld)\n", child->Size(), child->BlockSize())); + TRACE(("check_logical_location() - Size: (%" B_PRId64 ") is not a " + "multiple of block size: (%" B_PRId32 ")\n", child->Size(), + child->BlockSize())); return false; } if (child->PartitionTableOffset() < parent->Offset() || child->PartitionTableOffset() >= parent->Offset() + parent->Size()) { - TRACE(("check_logical_location() - Partition table: (%lld) not within " - "extended partition (start: %lld), (end: %lld)\n", - child->PartitionTableOffset(), parent->Offset(), parent->Offset() - + parent->Size())); + TRACE(("check_logical_location() - Partition table: (%" B_PRId64 ") not" + " within extended partition (start: %" B_PRId64 "), (end: " + "%" B_PRId64 ")\n", child->PartitionTableOffset(), parent->Offset(), + parent->Offset() + parent->Size())); return false; } if (child->Offset() + child->Size() > parent->Offset() + parent->Size()) { diff --git a/src/add-ons/kernel/partitioning_systems/intel/intel.cpp b/src/add-ons/kernel/partitioning_systems/intel/intel.cpp index a1387d6..bd8370b 100644 --- a/src/add-ons/kernel/partitioning_systems/intel/intel.cpp +++ b/src/add-ons/kernel/partitioning_systems/intel/intel.cpp @@ -99,7 +99,7 @@ get_type_for_content_type(const char* contentType, char* type) static status_t pm_std_ops(int32 op, ...) { - TRACE(("intel: pm_std_ops(0x%lx)\n", op)); + TRACE(("intel: pm_std_ops(0x%" B_PRIx32 ")\n", op)); switch(op) { case B_MODULE_INIT: case B_MODULE_UNINIT: @@ -117,9 +117,9 @@ pm_identify_partition(int fd, partition_data* partition, void** cookie) if (fd < 0 || !partition || !cookie) return -1; - TRACE(("intel: pm_identify_partition(%d, %ld: %lld, %lld, %ld)\n", fd, - partition->id, partition->offset, partition->size, - partition->block_size)); + TRACE(("intel: pm_identify_partition(%d, %" B_PRId32 ": %" B_PRId64 ", " + "%" B_PRId64 ", %" B_PRId32 ")\n", fd, partition->id, partition->offset, + partition->size, partition->block_size)); // reject extended partitions if (partition->type && !strcmp(partition->type, kPartitionTypeIntelExtended)) { @@ -182,9 +182,9 @@ pm_scan_partition(int fd, partition_data* partition, void* cookie) if (fd < 0 || !partition || !cookie) return B_ERROR; - TRACE(("intel: pm_scan_partition(%d, %ld: %lld, %lld, %ld)\n", fd, - partition->id, partition->offset, partition->size, - partition->block_size)); + TRACE(("intel: pm_scan_partition(%d, %" B_PRId32 ": %" B_PRId64 ", " + "%" B_PRId64 ", %" B_PRId32 ")\n", fd, partition->id, partition->offset, + partition->size, partition->block_size)); PartitionMapCookie* map = (PartitionMapCookie*)cookie; // fill in the partition_data structure @@ -287,7 +287,7 @@ pm_free_partition_content_cookie(partition_data* partition) static status_t ep_std_ops(int32 op, ...) { - TRACE(("intel: ep_std_ops(0x%lx)\n", op)); + TRACE(("intel: ep_std_ops(0x%" B_PRIx32 ")\n", op)); switch(op) { case B_MODULE_INIT: case B_MODULE_UNINIT: @@ -305,8 +305,9 @@ ep_identify_partition(int fd, partition_data* partition, void** cookie) if (fd < 0 || !partition || !cookie || !partition->cookie) return -1; - TRACE(("intel: ep_identify_partition(%d, %lld, %lld, %ld)\n", fd, - partition->offset, partition->size, partition->block_size)); + TRACE(("intel: ep_identify_partition(%d, %" B_PRId64 ", %" B_PRId64 ", " + "%" B_PRId32 ")\n", fd, partition->offset, partition->size, + partition->block_size)); // our parent must be a intel partition map partition and we must have // extended partition type @@ -333,8 +334,9 @@ ep_scan_partition(int fd, partition_data* partition, void* cookie) if (fd < 0 || !partition || !partition->cookie) return B_ERROR; - TRACE(("intel: ep_scan_partition(%d, %lld, %lld, %ld)\n", fd, - partition->offset, partition->size, partition->block_size)); + TRACE(("intel: ep_scan_partition(%d, %" B_PRId64 ", %" B_PRId64 ", " + "%" B_PRId32 ")\n", fd, partition->offset, partition->size, + partition->block_size)); partition_data* parent = get_parent_partition(partition->id); if (!parent) @@ -373,7 +375,7 @@ ep_scan_partition(int fd, partition_data* partition, void* cookie) // parameters char buffer[128]; - sprintf(buffer, "active %s ;\npartition_table_offset %lld ;\n", + sprintf(buffer, "active %s ;\npartition_table_offset %" B_PRId64 " ;\n", logical->Active() ? "true" : "false", logical->PartitionTableOffset()); child->parameters = strdup(buffer); diff --git a/src/add-ons/kernel/partitioning_systems/intel/write_support.cpp b/src/add-ons/kernel/partitioning_systems/intel/write_support.cpp index a8ed002..b9d2bb0 100644 --- a/src/add-ons/kernel/partitioning_systems/intel/write_support.cpp +++ b/src/add-ons/kernel/partitioning_systems/intel/write_support.cpp @@ -679,7 +679,8 @@ get_partitionable_spaces(partition_data* partition, if (positions) delete[] positions; - TRACE(("intel: get_partitionable_spaces - found: %ld\n", actualCount)); + TRACE(("intel: get_partitionable_spaces - found: %" B_PRId32 "\n", + actualCount)); *_actualCount = actualCount; @@ -752,8 +753,8 @@ status_t pm_shadow_changed(partition_data* partition, partition_data* child, uint32 operation) { - TRACE(("intel: pm_shadow_changed(%p, %p, %lu)\n", partition, child, - operation)); + TRACE(("intel: pm_shadow_changed(%p, %p, %" B_PRIu32 ")\n", partition, + child, operation)); switch (operation) { case B_PARTITION_SHADOW: @@ -763,14 +764,16 @@ pm_shadow_changed(partition_data* partition, partition_data* child, partition->id); if (!physicalPartition) { dprintf("intel: pm_shadow_changed(B_PARTITION_SHADOW): no " - "physical partition with ID %ld\n", partition->id); + "physical partition with ID %" B_PRId32 "\n", + partition->id); return B_ERROR; } // clone the map if (!physicalPartition->content_cookie) { dprintf("intel: pm_shadow_changed(B_PARTITION_SHADOW): no " - "content cookie, physical partition: %ld\n", partition->id); + "content cookie, physical partition: %" B_PRId32 "\n", + partition->id); return B_ERROR; } @@ -796,13 +799,14 @@ pm_shadow_changed(partition_data* partition, partition_data* child, partition_data* physical = get_partition(child->id); if (!physical) { dprintf("intel: pm_shadow_changed(B_PARTITION_SHADOW_CHILD): " - "no physical partition with ID %ld\n", child->id); + "no physical partition with ID %" B_PRId32 "\n", child->id); return B_ERROR; } if (!physical->cookie) { dprintf("intel: pm_shadow_changed(B_PARTITION_SHADOW_CHILD): " - "no cookie, physical partition: %ld\n", child->id); + "no cookie, physical partition: %" B_PRId32 "\n", + child->id); return B_ERROR; } @@ -811,7 +815,7 @@ pm_shadow_changed(partition_data* partition, partition_data* child, if (!partition->content_cookie) { dprintf("intel: pm_shadow_changed(B_PARTITION_SHADOW_CHILD): " - "no content cookie, physical partition: %ld\n", + "no content cookie, physical partition: %" B_PRId32 "\n", partition->id); return B_ERROR; } @@ -823,8 +827,8 @@ pm_shadow_changed(partition_data* partition, partition_data* child, if (!primary || primary->IsEmpty()) { dprintf("intel: pm_shadow_changed(B_PARTITION_SHADOW_CHILD): " - "partition %ld is empty, primary index: %ld\n", child->id, - index); + "partition %" B_PRId32 " is empty, primary index: " + "%" B_PRId32 "\n", child->id, index); return B_BAD_VALUE; } @@ -849,7 +853,8 @@ pm_shadow_changed(partition_data* partition, partition_data* child, { if (!partition->content_cookie) { dprintf("intel: pm_shadow_changed(B_PARTITION_CREATE_CHILD): " - "no content cookie, partition: %ld\n", partition->id); + "no content cookie, partition: %" B_PRId32 "\n", + partition->id); return B_ERROR; } @@ -867,7 +872,8 @@ pm_shadow_changed(partition_data* partition, partition_data* child, if (!primary) { dprintf("intel: pm_shadow_changed(B_PARTITION_CREATE_CHILD): " - "no empty primary slot, partition: %ld\n", partition->id); + "no empty primary slot, partition: %" B_PRId32 "\n", + partition->id); return B_ERROR; } @@ -876,7 +882,8 @@ pm_shadow_changed(partition_data* partition, partition_data* child, type.SetType(child->type); if (!type.IsValid()) { dprintf("intel: pm_shadow_changed(B_PARTITION_CREATE_CHILD): " - "invalid partition type, partition: %ld\n", partition->id); + "invalid partition type, partition: %" B_PRId32 "\n", + partition->id); return B_ERROR; } @@ -1065,7 +1072,7 @@ move_block(int fd, off_t fromOffset, off_t toOffset, uint8* buffer, int32 size) error = errno; if (error == B_OK) error = B_IO_ERROR; - TRACE(("intel: move_block(): reading failed: %lx\n", error)); + TRACE(("intel: move_block(): reading failed: %" B_PRIx32 "\n", error)); return error; } @@ -1074,7 +1081,7 @@ move_block(int fd, off_t fromOffset, off_t toOffset, uint8* buffer, int32 size) error = errno; if (error == B_OK) error = B_IO_ERROR; - TRACE(("intel: move_block(): writing failed: %lx\n", error)); + TRACE(("intel: move_block(): writing failed: %" B_PRIx32 "\n", error)); } return error; @@ -1520,9 +1527,9 @@ ep_is_sub_system_for(partition_data* partition) if (partition == NULL) return false; - TRACE(("intel: ep_is_sub_system_for(%ld: %lld, %lld, %ld, %s)\n", - partition->id, partition->offset, partition->size, - partition->block_size, partition->content_type)); + TRACE(("intel: ep_is_sub_system_for(%" B_PRId32 ": %" B_PRId64 ", " + "%" B_PRId64 ", %" B_PRId32 ", %s)\n", partition->id, partition->offset, + partition->size, partition->block_size, partition->content_type)); // Intel Extended Partition can live in child partition of Intel Partition // Map @@ -2280,8 +2287,8 @@ ep_delete_child(int fd, partition_id partitionID, partition_id childID, if (get_partition_from_offset_ep(partition, next->Offset(), &nextSibling)) { char buffer[128]; - sprintf(buffer, "active %s ;\npartition_table_offset %lld ;\n", - next->Active() ? "true" : "false", + sprintf(buffer, "active %s ;\npartition_table_offset %" B_PRId64 + " ;\n", next->Active() ? "true" : "false", next->PartitionTableOffset()); nextSibling->parameters = strdup(buffer); } ############################################################################ Commit: a9fdaec18aa39c5af3dd94a998325c520eb4423c Author: Alex Smith <alex@xxxxxxxxxxxxxxxx> Date: Fri Jul 20 16:55:26 2012 UTC Added disk drivers and CD file system modules to the boot image for x86_64. This adds disk drivers, intel/session partitioning systems, and ISO9660 (+ write/attribute_overlay) modules to the CD/floppy boot image targets for x86_64. The kernel now detects and mounts the boot CD, and runs up to attempting to start the boot script. ---------------------------------------------------------------------------- diff --git a/build/jam/FloppyBootImage b/build/jam/FloppyBootImage index b34dfdc..39a957b 100644 --- a/build/jam/FloppyBootImage +++ b/build/jam/FloppyBootImage @@ -54,13 +54,32 @@ SYSTEM_ADD_ONS_FILE_SYSTEMS = bfs iso9660 attribute_overlay write_overlay ; if $(TARGET_ARCH) = x86_64 { AddFilesToFloppyBootArchive system add-ons kernel bus_managers - : config_manager dpc pci ; + : ata config_manager dpc pci scsi ; + AddFilesToFloppyBootArchive system add-ons kernel busses ata + : generic_ide_pci ; + AddFilesToFloppyBootArchive system add-ons kernel file_systems + : iso9660 attribute_overlay write_overlay ; + AddFilesToFloppyBootArchive system add-ons kernel generic + : ata_adapter locked_pool scsi_periph ; + AddFilesToFloppyBootArchive system add-ons kernel partitioning_systems + : intel session ; + + AddNewDriversToFloppyBootArchive disk scsi : scsi_cd scsi_disk ; } else { # modules AddFilesToFloppyBootArchive system add-ons kernel bus_managers : $(SYSTEM_ADD_ONS_BUS_MANAGERS) ; - AddFilesToFloppyBootArchive system add-ons kernel busses ide - : generic_ide_pci $(X86_ONLY)ide_isa silicon_image_3112 legacy_sata it8211 ; + + if $(HAIKU_ATA_STACK) = 1 { + AddFilesToFloppyBootArchive system add-ons kernel busses ata + : generic_ide_pci $(X86_ONLY)ide_isa silicon_image_3112 legacy_sata + it8211 ; + } else { + AddFilesToFloppyBootArchive system add-ons kernel busses ide + : generic_ide_pci $(X86_ONLY)ide_isa silicon_image_3112 legacy_sata + it8211 ; + } + AddFilesToFloppyBootArchive system add-ons kernel busses scsi : ahci ; AddFilesToFloppyBootArchive system add-ons kernel console : vga_text ; @@ -126,7 +145,9 @@ if $(NET_BOOT) = 1 { # boot module links if $(TARGET_ARCH) = x86_64 { AddBootModuleSymlinksToFloppyBootArchive - dpc config_manager pci + ata dpc config_manager pci scsi ata_adapter locked_pool scsi_periph + generic_ide_pci scsi_cd scsi_disk intel session iso9660 + attribute_overlay write_overlay ; } else { AddBootModuleSymlinksToFloppyBootArchive