This shows you the differences between two versions of the page.
— |
blog:pushbx:2023:0108_freedos_256_spc_bootimg_ldebug_updates_ldos_boot_optimisations [2023-01-08 16:39:58 +0100 Jan Sun] (current) ecm created |
||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== FreeDOS 256 spc, bootimg/ | ||
+ | |||
+ | |||
+ | **2023-01-05** | ||
+ | |||
+ | Yesterday saw some more activity after the prior blog entry. | ||
+ | |||
+ | ===== FreeDOS kernel and boot loaders: Support for 256 Sectors per Cluster ===== | ||
+ | |||
+ | This is a feature originated by the Enhanced DR-DOS project. Basically, when the byte field for " | ||
+ | |||
+ | The FreeDOS kernel needed very little changes to make it work with 256 sectors per cluster. In fact, only one small patch in the entire kernel was strictly necessary. | ||
+ | |||
+ | The most changes were actually in the boot sector loaders: oemboot for FAT12/ | ||
+ | |||
+ | Due to the change, the hardcoded LBA detection offsets of boot.asm changed, and were subsequently updated in SYS. | ||
+ | |||
+ | oemboot ran out of space in one of its variants. I found a simple patch that freed up 2 bytes. Namely, '' | ||
+ | |||
+ | |||
+ | ===== bootimg stress testing ===== | ||
+ | |||
+ | The bootimg script was used to build test images for the FreeDOS kernel change, building FAT12, FAT16, and FAT32 images with 128 or 256 sectors per cluster. | ||
+ | |||
+ | The good news is that the lDOS boot loaders and the debugger handled such file systems just fine. The support prepared absent testing did work. | ||
+ | |||
+ | Creating a file system image with a typical FAT32 file system and 128 KiB per cluster proved difficult. With nearly 100_000 clusters, the script was killed by the server' | ||
+ | |||
+ | One fix was to use bootimg' | ||
+ | |||
+ | The other solution is to specify fewer clusters than the 64 kilo binary expected for FAT32. This required a patch to bootimg, adding the option '' | ||
+ | |||
+ | The kernel already worked with small FAT32 out of the box. So did the lDOS loaders. Not so lDebug, the debugger checked that a small file system is not FAT32. This check was changed to accept rather than forbid small FAT32. (A similar dispatching in FreeDOS SYS is yet to be fixed.) | ||
+ | |||
+ | |||
+ | ===== lDOS boot optimisations ===== | ||
+ | |||
+ | Today the boot sector loaders were optimised. The boot32 function '' | ||
+ | |||
+ | A similar change in boot was to calculate the adjusted sectors per cluster only at the site it is used. This saves 4 bytes in each of the FAT12 and FAT16 loaders. The idea was gleaned from the 256 spc changes to the FreeDOS loaders, as it was apparent that only one access to the variable happened. (This access uses the result both to multiply the cluster number into a sector number, and to loop over all sectors of the current cluster.) | ||
+ | |||
+ | |||
+ | |||
+ | {{tag> | ||
+ | |||
+ | |||
+ | ~~DISCUSSION~~ | ||