So im working again on rustboot and now have the "problem" that the bootsector of it dosn't contain an BiosParameterBlock, which should be only needed for DOS but welp aparently there are BIOS'es out there that just write inside it, causing it to screw up the code inside it. -.-
It needs ~51 bytes or so, but my current implementation has only ~20 bytes of wiggleroom, mainly bc rust/llvm use 32bit-in-16bit code, which has the "problem" that an mov
of an u16 immediate to a register occupies 6 instead of 3 bytes (2 zero bytes to pad u16 to u32 + the sizeprefix 0x66
to "temporarily" switch to 32bit).
Sooooooo yeah yk what I did. You tought of the sensible way of writing it simply entirely in assembly? Naaaaah; I'm gonna patch LLVM ofc!!
Which works quite okayish currently; I got it to correctly emit 16bit call
and ret
instructions (another thing that was eating space even before and I had to do some very creative workarounds...); now I only need to somehow compile an own rust toolchain that uses the patched LLVM, but it dosn't get's it right and the extra cpu target (i8086
instead of i386
) dosn't get recognized as a valid target when rust tries to ask LLVM for it.... sigh
Maybe I should rather work on the implementation of an realmode interrupt routine that's callable from 32bit so I can implement a basic disk interface.