flat assembler
Message board for the users of flat assembler.
Index
> OS Construction > Question about INT 13 (read sectors to RAM) |
Author |
|
nkeck72 31 Dec 2015, 15:47
I have a simple question regarding INT 0x13. It came up when I was programming the preprocessor for a segmented program in NOS (e.g. different segments for CS,DS,ES,SS.)
Say we are reading the file into 9000:0000. When running the read sectors function (ah=0x02), does the BIOS only read 64K (up to the end of segment 9000) or does it overflow into the next segment? Or does it depend on the BIOS manufacturer? The only reason I worry about this is one of the reasons a programmer would write a segmented program instead of a flat one would be because they have more than 64K of combined code/data, making my (uncompressed) file with the formatting larger than 64K. Would this make me have to read the sectors in 64K at a time? _________________ It may look hard, but it won't take long if you take it one byte at a time. NOS: www.github.com/nkeck720/nos |
|||
31 Dec 2015, 15:47 |
|
nkeck72 31 Dec 2015, 18:39
So if I loaded and processed the file in 64K blocks, it would circumvent this issue? And is there a way to tell if the BIOS can or not short of testing it on the system itself?
|
|||
31 Dec 2015, 18:39 |
|
revolution 31 Dec 2015, 18:45
It is more than simply 64k blocks. You also have to align them to 0xZZZZ0000.
You can test for it by checking the error code returned. If you get an error then you can fall back to doing reads/writes that don't cross a boundary. Although I can't see any advantage to having two code paths in boot code. |
|||
31 Dec 2015, 18:45 |
|
nkeck72 31 Dec 2015, 20:09
Figured that might work, there is no way I can find to query the BIOS of this information.
As for your second comment, this is for preprocessing a program, not boot code. I wouldnt make any boot files larger than 64K, that just seems a bit ridiculous. |
|||
31 Dec 2015, 20:09 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.