> of course you are right. but maybe you are missing the point

...

> why the
> original author (m2) wrote it exactly as it is: to save precious 2 bytes  
> in
> the boot sector code

This is a problem for the FAT12 "OEM" boot sector only, all other boot  
sectors can be assembled with this patch without problems.

To allow the FAT12 "OEM" boot sector to use this patch, I'd suggest to  
move the LBA disk access packet into the sector (where the first jump  
currently jumps to) but only declare and initialize the first word  
(LBA_SIZE) there. The initial jump would be adjusted to pass control to  
the code following after this (2 bytes higher than now). This would save  
us the 6-byte instruction "mov LBA_SIZE, 10h" (really "mov word  
[bp+0200h], 0010h") below read_next i.e. it would save 4 bytes overall.  
The packet would, once used, overwrite 14 bytes of following code but this  
initial part is safe to overwrite then. (NASM preprocessor conditionals  
could be used to check that only the initial part is overwritten.)

Regards,
Christian

------------------------------------------------------------------------------
Join us December 9, 2009 for the Red Hat Virtual Experience,
a free event focused on virtualization and cloud computing. 
Attend in-depth sessions from your desk. Your couch. Anywhere.
http://p.sf.net/sfu/redhat-sfdev2dev
_______________________________________________
Freedos-kernel mailing list
Freedos-kernel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freedos-kernel

Reply via email to