keep this padding 0000h (some utilise other values)
several other regions also have identifiers, WP lists several, OSDEV too,
but we miss them all as it’s either NULs or code in ours
test for bit7 as “active” flag rather than exact comparison with 80h
as is the apparent new fad… also subtract the day wraparound amount,
patched mbrmgr could have more than one day timeouts
I learnt more about ticks… 1573040 is two less than 1573042 which,
as either 1573042.436 (NTSC’s colour burst frequency of ³¹⁵⁄₈₈ MHz
divided by 3, then (via the PIT) by 65536 to get tick frequency,
multiply by 86400 gets the result) or 1573042.236 from a 14.318180
MHz crystal, in case they built that and not 14.31̅8̅ MHz (NTSC) ones…
use movsw ipv movsb when we know we’re aligned (to relocate)
bootxx’s movsb to dynamically decode the blocks-to-load table must stay,
of course; another movsb to store the partition entry is 16 bytes and not
worth bothering here
• switch all arithmetic to unsigned
• redo and harmonise geometry and MBR partition table handling
• force C locale
• enable -o pipefail if possible but ignore if not
• check $OPTARG better
• make output slighly more consistent
• self-check MBR to have indeed only 512 bytes; prior, could
fail if using outlandish geometries like, say, 640 sectors…
• sparc: warn if >0xFFFF cylinders (Sun disklabel limit) and
truncate (MBR C/H/S truncation is still silent as proper)
and enforce geometry to be given if used (-0)
• Debian has paxtar; GNU stat(1) differs
squeeze a few more bytes by using smaller instructions, so we can…
• use whatever current output page the BIOS is using (via SYSLINUX)
• improve the loading text for mbrmgr like we did for mbrldr
two more bytes left! ;)
also, add RCS ID to a .rcsid section in the ELF binary, and extract
it for version provenance
• we now have enough space to set DH to zero before handing over
(but where did THAT recommendation even come from?)
• as DS:SI is set by us and needed much later it’s good that we
don’t relocate to a higher scratch space, which the PBR will
most likely use; SYSLINUX agrees, FDISK too according to
https://wiki.osdev.org/MBR_%28x86%29 anyway…
• bump patchlevel in the portable build instructions
• somewhat nicer comments
• don’t recommend -DBOOT_QUIET in the portable build instructions
we could load more than one sector, as extension, but that might
wreak havoc with CHS mode and, possibly, one-sector PIO drives…
so keep to a portable stable standard
link to USD/PSD/SMM/PAPERS/GNU documents in a way that creates hyperlinks
in our HTML-formatted online manpages; point to them from intro(1), point
there from some more places
s/a(mbs|wcs)n?to(wcs|mbs)/x&/ because they err(3) on calloc(3) failure
we’ll reintroduce the unpræfixed versions later but have them return
NULL on memory allocation failure; we’ll need that in libc internally
for a few functions now anyway