Read Floppy sector
Read Floppy sector
How would you read floppy sectors at the 1MB mark or above?
I've enable UnReal mode (So I have 32-bit data segment). But how to tell BIOS?
I've tried looking through some example kernels, etc, but to no avail.
I've enable UnReal mode (So I have 32-bit data segment). But how to tell BIOS?
I've tried looking through some example kernels, etc, but to no avail.
- Pype.Clicker
- Member
- Posts: 5964
- Joined: Wed Oct 18, 2006 2:31 am
- Location: In a galaxy, far, far away
- Contact:
Re:Read Floppy sector
As explained in the FAQ, you cannot tell the BIOS to load directly above 1MB. You need to load sectors in a temp. location and _then_ move the data above 1MB manually.
Re:Read Floppy sector
Woah, no wonder I couldn't pick anything up from those example kernels .
Thanks for the Quick reply, it comes in handy.
Thanks for the Quick reply, it comes in handy.
Re:Read Floppy sector
Are you sure that also applies with int13 extensions (ah=0x42)? I thought they specifically could do that...Pype.Clicker wrote: As explained in the FAQ, you cannot tell the BIOS to load directly above 1MB. You need to load sectors in a temp. location and _then_ move the data above 1MB manually.
Re:Read Floppy sector
Hi,
http://www.ctyme.com/intr/rb-0708.htm
They can load to any 32 bit physical address (or 64 bit physical address for EDD 3.0)....
But
According to:
http://www.ctyme.com/intr/rb-0706.htm
The Int 13h extensions only apply to drive numbers from 0x80 to 0xFF, which doesn't include floppies.
For hard drives the ATA controller can use bus mastering to read the data where you want it without any problems, but for floppies this isn't the case - the BIOS would need to use protected mode (in some form) and a buffer below 1 MB, just like us. I guess some BIOS's might actually implement this, but I wouldn't rely on it.
I could be wrong though - I've never used Int 13h extensions because I'd need to support the normal BIOS and unreal mode method in case int13 extensions aren't supported (old computers), and I haven't done a hard disk boot sector for many years.
Cheers,
Brendan
According to:Candy wrote:Are you sure that also applies with int13 extensions (ah=0x42)? I thought they specifically could do that...
http://www.ctyme.com/intr/rb-0708.htm
They can load to any 32 bit physical address (or 64 bit physical address for EDD 3.0)....
But
According to:
http://www.ctyme.com/intr/rb-0706.htm
The Int 13h extensions only apply to drive numbers from 0x80 to 0xFF, which doesn't include floppies.
For hard drives the ATA controller can use bus mastering to read the data where you want it without any problems, but for floppies this isn't the case - the BIOS would need to use protected mode (in some form) and a buffer below 1 MB, just like us. I guess some BIOS's might actually implement this, but I wouldn't rely on it.
I could be wrong though - I've never used Int 13h extensions because I'd need to support the normal BIOS and unreal mode method in case int13 extensions aren't supported (old computers), and I haven't done a hard disk boot sector for many years.
Cheers,
Brendan
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
Re:Read Floppy sector
Hmm, I'm having a bit of trouble with my code. (I don't have exact code with me, but I remember what I did).
It works to copy 512bytes from 1 <1mb location to another <1mb location, but not >1mb locations.
It sets up real mode just like in BabySteps 7, (with the exception of a GDT from another UnReal mode tutorial). That is, load GDT, enter PMODE, set DS, exit pmode.
I load it like this:
Any ideas? When I try to load >1mb, it doesn't crash, but instead freezes BOCH's.
It works to copy 512bytes from 1 <1mb location to another <1mb location, but not >1mb locations.
It sets up real mode just like in BabySteps 7, (with the exception of a GDT from another UnReal mode tutorial). That is, load GDT, enter PMODE, set DS, exit pmode.
I load it like this:
Code: Select all
mov cx, [DS:EAX]
mov [DS:EBX], cx
Re:Read Floppy sector
Have you enabled the A20 line? Even with unreal mode you can't access addresses >1Mb without that enabled.
Re:Read Floppy sector
I thought the BIOS of Bochs defaulted to the Super IO chip, that is, it enabled it for you?
I know I have the A20 auto-enable, well, enabled, on my computer. It's in the BIOS I've got for it.
I know I have the A20 auto-enable, well, enabled, on my computer. It's in the BIOS I've got for it.
Re:Read Floppy sector
I read some where that Bochs does not support unreal-mode properly .
Re:Read Floppy sector
Hi,
Cheers,
Brendan
Where? I've never had any problems...Dex4u wrote: I read some where that Bochs does not support unreal-mode properly .
Cheers,
Brendan
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
Re:Read Floppy sector
http://board.flatassembler.net/topic.ph ... c&start=50
go to the post by Tomasz Grysztar (the creator of fasm).
This may of changed now, but that where i read it.
go to the post by Tomasz Grysztar (the creator of fasm).
This may of changed now, but that where i read it.
Re:Read Floppy sector
I would be useful if he gave any reasons or sources or anything at all to back up what he said rather than just "it doesn't work"...
Re:Read Floppy sector
Hmm...Out of curiosity, is it possible that BOCHS only auto-enables A20 while the PM bit is set in CR0? Meaning I would have to enable A20 myself anyways?
Re:Read Floppy sector
From what I have seen personally, amongst many forums and especially with recent releases, almost anyone who can't get their primitive OS structure to work on bochs are simply misguided in how the computer is suppose to work and/or how they are suppose to implement their ideas through programming. Keep reading CPU/programming documentation and keep trying and you will surely get things to work
[rant]
Thomasz isn't the end-all ultimate resource for OS development information, especially when he doesn't supply any proof of concept code to back his claims up. Personally I don't think he would be willing to supply the code to prove this (if any actually exists) since someone will most likely find a simple logic error and it might make him seem less of a genius to his FASM followers.
I am sorry if I seem very opinionated about this and about Tomasz Grysztar, but nothing annoys me more than people who (ab)use their position to spew out personal opinions over implicit facts. I have to deal with such nonsense from Steve Hutchesson, the MASM32 package maintainer and frequenter of the Win32ASM Community Forums that I help maintain, from time to time and the BS can get rather thick.
I am humbled at the work that Tomasz has done with FASM and the work that Steve has done with MASM32, but their work and their position simply do not justify their "I said so, so it must be true" attitude in my book. Bring the facts, or keep your mouth shut
[/rant]
Please continue with the topic at hand, I just thought I needed to say that so rumors and opinions do not win any attention over fact and truth
[rant]
Thomasz isn't the end-all ultimate resource for OS development information, especially when he doesn't supply any proof of concept code to back his claims up. Personally I don't think he would be willing to supply the code to prove this (if any actually exists) since someone will most likely find a simple logic error and it might make him seem less of a genius to his FASM followers.
I am sorry if I seem very opinionated about this and about Tomasz Grysztar, but nothing annoys me more than people who (ab)use their position to spew out personal opinions over implicit facts. I have to deal with such nonsense from Steve Hutchesson, the MASM32 package maintainer and frequenter of the Win32ASM Community Forums that I help maintain, from time to time and the BS can get rather thick.
I am humbled at the work that Tomasz has done with FASM and the work that Steve has done with MASM32, but their work and their position simply do not justify their "I said so, so it must be true" attitude in my book. Bring the facts, or keep your mouth shut
[/rant]
Please continue with the topic at hand, I just thought I needed to say that so rumors and opinions do not win any attention over fact and truth
Re:Read Floppy sector
(ab)use their position? comment like that (without any evidence) is made everywhere, all the time.
followers? sounds like you are describing some sect..
followers? sounds like you are describing some sect..