[Solved](Protected Mode)How to read disk sectors?

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
User avatar
leyley
Member
Member
Posts: 35
Joined: Thu Jun 28, 2012 1:54 am

[Solved](Protected Mode)How to read disk sectors?

Post by leyley »

I created a 1.44MB floppy image to write a OS for practise(now in boot stages), I set a simple GDT and open A20 line then enter the protected mode(not paging, will set it later). I know that in protected mode I cannot int directly unless there are some IDTs have been set. However, the way to read disk sectors in protected mode is unclear. How can I do it? Is there any way to read a sector from the disk except inturrpets(in protected mode)?
Thanks!
Last edited by leyley on Thu Aug 23, 2012 9:21 pm, edited 1 time in total.

Code: Select all

#rm -rf /
User avatar
Brynet-Inc
Member
Member
Posts: 2426
Joined: Tue Oct 17, 2006 9:29 pm
Libera.chat IRC: brynet
Location: Canada
Contact:

Re: (Protected Mode)How to read disk sectors?

Post by Brynet-Inc »

Image
Twitter: @canadianbryan. Award by smcerm, I stole it. Original was larger.
User avatar
leyley
Member
Member
Posts: 35
Joined: Thu Jun 28, 2012 1:54 am

Re: (Protected Mode)How to read disk sectors?

Post by leyley »

The floppy controller is programmed through 9 registers, which can be accessed through IO ports 0x3F0 through 0x3F7 (excluding 0x3F6)
Thanks!

Code: Select all

#rm -rf /
Post Reply