flat assembler
Message board for the users of flat assembler.
Index
> DOS > Interrupt 13h |
Author |
|
LocoDelAssembly 07 Dec 2006, 01:31
Setting DL to 80 you access the first HDD. Note that this DOES NOT work under WinNT/2000/XP but it's OK on Win9x/Me (and in DOS and boot codes of course).
|
|||
07 Dec 2006, 01:31 |
|
rhyno_dagreat 07 Dec 2006, 01:43
Dang, so that's why I'm getting that error. What I'm trying to do is access the MBR, read from it, and print out the results. I get 10 extra credit points in my computer science class if I can do it. Another way I'm thinking of doing it is setting the segment to 0000 and the offset of that to 7C00h and reading from there. But one thing that confuses me about that is I read on this site shown below that the MBR changes places to 0600h after it loads. Is that true for all of it or just part of it?
Here's the site: http://www.ata-atapi.com/hiwdos.htm And thanks for the help! |
|||
07 Dec 2006, 01:43 |
|
smiddy 07 Dec 2006, 02:18
It is true that some OS' do change the segment to 0060h or linear 600h. They do this by moving their loaded code from 7C00h to 0600h and thus jumping to that segment (realmode 60:0000h). But a blank 1st sector shouldn't be moving code from 7C00h to 0600h. An example can be found here in the file bootE820.ASM. It shows how it happens. The reason for this is to get your code as close to the bottom of useable real memory as possible. Potentially, you could start your code at 0:0h, but you would have to do a lot of things to ensure the system doesn't crash since there is the IVT down there, but it is do-able.
|
|||
07 Dec 2006, 02:18 |
|
LocoDelAssembly 07 Dec 2006, 02:19
MBR code relocates itself because it has to load to 7C00h the boot code of the active partition and jump to it. If I'm remember right 600h is the first address free to be used and lower addresses contain BIOS data and the interrupt vector table so that could be a good reason of why that address is typically choose.
Now I don't understand what are you doing, a boot code that when gets booted it reads the MBR from first HDD and prints it out? PS: Note that my warnings was that NT-like Windowses will stop your program showing you a message box telling that your program is attempting to access the hard disk and it's not allowed (and with buttons "Close" and "Ignore"). [edit]Sorry Smiddy, when I was writing your post didn't exist yet.[/edit] |
|||
07 Dec 2006, 02:19 |
|
rhyno_dagreat 07 Dec 2006, 02:53
Loco, yeah, I think I got it working though, I'm now directlyh dealing with segment 0000h and offset 7C00h and printing out the values from there. I also tried seg 0000h and offset 0600h and it showed the same, therefore I think I got it right. Thank you all!
|
|||
07 Dec 2006, 02:53 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.