Loading data from disk
-
- Posts: 3
- Joined: Sun Jan 20, 2008 11:25 pm
Loading data from disk
Hi,
I'm wondering, is the BIOS interrupt 13 the only way to read data from disk?
Is there a way of by-passing the bios?
The reason I ask is two-fold:
1) Don't BIOS's differ from manufacturer to manufacturer? Is this a problem?
2) Don't BIOS interrupts only work in real mode, not protected? Does that mean I have to transition to real mode every time I want to read a file/sector from disk?
How do 'real' OSs do it?
Also, does that interrupt allow me to read form a harddisk as well as a floppy? Or is there a better alternative in general that works in Pmode?
I'm wondering, is the BIOS interrupt 13 the only way to read data from disk?
Is there a way of by-passing the bios?
The reason I ask is two-fold:
1) Don't BIOS's differ from manufacturer to manufacturer? Is this a problem?
2) Don't BIOS interrupts only work in real mode, not protected? Does that mean I have to transition to real mode every time I want to read a file/sector from disk?
How do 'real' OSs do it?
Also, does that interrupt allow me to read form a harddisk as well as a floppy? Or is there a better alternative in general that works in Pmode?
- piranha
- Member
- Posts: 1391
- Joined: Thu Dec 21, 2006 7:42 pm
- Location: Unknown. Momentum is pretty certain, however.
- Contact:
SeaOS: Adding VT-x, networking, and ARM support
dbittman on IRC, @danielbittman on twitter
https://dbittman.github.io
dbittman on IRC, @danielbittman on twitter
https://dbittman.github.io
Re: Loading data from disk
No.scorpion007 wrote:I'm wondering, is the BIOS interrupt 13 the only way to read data from disk?
Yes.Is there a way of by-passing the bios?
Yes, no.1) Don't BIOS's differ from manufacturer to manufacturer? Is this a problem?
Yes, yes if you want to use int 13h.2) Don't BIOS interrupts only work in real mode, not protected? Does that mean I have to transition to real mode every time I want to read a file/sector from disk?
They directly access hardware.How do 'real' OSs do it?
Yes, no. You have to write your own hardware drivers. BIOS is nothing more than real-mode hardware drivers with a certain API.Also, does that interrupt allow me to read form a harddisk as well as a floppy? Or is there a better alternative in general that works in Pmode?
That said, if you need these questions answered, I you really sure you need hanging around an osdev forum?
JAL
Re: Loading data from disk
There is an alternative to this - virtual 8086 mode, but you are strongly advised to write your own drivers in PMode. This is because you will have set up PMode interrupt handlers, tick counter and so on. You are not guaranteed that a BIOS disk method will not try to interfere with this, if it is using port-based IO.scorpion007 wrote: 2) Don't BIOS interrupts only work in real mode, not protected? Does that mean I have to transition to real mode every time I want to read a file/sector from disk?
I have never done this, but apparently a hard disk (PATA) driver is apparently not that hard to write. SATA drives often emulate thie PATA interface too, IIRC. Floppy drivers are often a bit more complex, as they generally involve a) interfaceing with an outdated controller and b) using DMA.
Cheers,
Adam
I've coded a rather complete open-source IDE library in NASM which you can find in my website provided that you are working under Protected Mode and not Real Mode.
On the field with sword and shield amidst the din of dying of men's wails. War is waged and the battle will rage until only the righteous prevails.
-
- Posts: 3
- Joined: Sun Jan 20, 2008 11:25 pm
Thanks guys for the help, I'll have a bit of a read, then ask questions later.
Errm... Were my questions too basic? I was under the impression this forum is for all audiences, including beginners?That said, if you need these questions answered, I you really sure you need hanging around an osdev forum?
Errm... Were my questions too basic? I was under the impression this forum is for all audiences, including beginners?[/quote]scorpion007 wrote:That said, if you need these questions answered, I you really sure you need hanging around an osdev forum?
Yeah, I'm a bit grumpy sometimes. Whether it is a thorough lack of sleep (why did I want kids again?) or a malicious character, nobody knows. What I meant was that your questions are so basic, you're a very long shot away from actual OS development.
JAL
- piranha
- Member
- Posts: 1391
- Joined: Thu Dec 21, 2006 7:42 pm
- Location: Unknown. Momentum is pretty certain, however.
- Contact:
SeaOS: Adding VT-x, networking, and ARM support
dbittman on IRC, @danielbittman on twitter
https://dbittman.github.io
dbittman on IRC, @danielbittman on twitter
https://dbittman.github.io
-
- Posts: 3
- Joined: Sun Jan 20, 2008 11:25 pm
Well, the impression I got from reading some other threads that they were a lot more basic than mine, such as being confused about what a compiler is, and which they should use.
I think interfacing with hardware is a somewhat more complex topic, which is why I asked how it is normally done.
But yeah, thanks for the help so far, I'll just have to digest the information first.
I think interfacing with hardware is a somewhat more complex topic, which is why I asked how it is normally done.
But yeah, thanks for the help so far, I'll just have to digest the information first.