OS Coding philosophy

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.
Curufir

Re:OS Coding philosophy

Post by Curufir »

Hmm, are you sure it's a problem only reading 1 sector at a time and not crossing a cylinder boundary?
jrfritz

Re:OS Coding philosophy

Post by jrfritz »

I use to have a problem...my BIOS supported loading over 17 sectors ( about 24 or something )...then I ran my OS in BOCHS and it wouldn't load so...I found that 17 sectors is a best standard...right?
pini

Re:OS Coding philosophy

Post by pini »

Maybe.
But there's 18 sectors per tracks and 80 tracks per disk. So if you load by 17 sectors blocks, you will fail loading the last sector of each track (if you load more than 1 track, of course...)

Or maybe I'm wrong. Could you remind me what is the correct structure of a 1.44M floppy disk ?
jrfritz

Re:OS Coding philosophy

Post by jrfritz »

Sorry...my mind is acting like a computer...I included 0 as a whole number in my post...so 18 sectors is correct.

I sometimes think in 0x's too :-\ :-[
Perica
Member
Member
Posts: 454
Joined: Sat Nov 25, 2006 12:50 am

Re:OS Coding philosophy

Post by Perica »

..
Last edited by Perica on Sun Dec 03, 2006 8:25 pm, edited 1 time in total.
jrfritz

Re:OS Coding philosophy

Post by jrfritz »

1 cylinder per 0x10 heads. ( Including 0x0 as a whole number )
Perica
Member
Member
Posts: 454
Joined: Sat Nov 25, 2006 12:50 am

Re:OS Coding philosophy

Post by Perica »

..
Last edited by Perica on Sun Dec 03, 2006 8:25 pm, edited 1 time in total.
Schol-R-LEA

Re:OS Coding philosophy

Post by Schol-R-LEA »

Perica Senjak wrote: How many Sectors are there per head?
How many heads are there per Cylinder?
How many Cylinders are there on the Whole Floppy?
What the heck are Tracks?
OK, before I go on, I want you to try and get an image in your head of what the tracks and sectors 'really are', using this borrowed illustration:
Image
This shows the logical layout of a single disk platter, equal to one floppy disk. The disk's magnetic material is conceptually divided into a series of equally spaced concentric rings, called tracks. It is also split radially by thin gaps of equal spacing and angle (this is modified in hard disks, however). The part of a track bounded by two gaps is one sector.

In an actual floppy disk, there are two magnetic read heads which hover close to the surface of the disk, one on each side of the disk (in a conventional setup, that places one head above disk and one below it). As the disk moves under the read head, it can read successively read the sectors in the track which it is currently over. Each head has a stepper motor which can move in a straight line, back and forth; the head n tracks at a time, according to the controller's instructions. To read from a given sector, the appropriate read head first must move to the track the sector is in, then wait for the sector to pass under the read head.

On the standard 1.44M floppy disk with 512 byte sectors, there are 80 tracks divided into 18 sectors, meaning that each of the two read heads can read 18 sectors in a given track, for a total 2880 sectors per disk (1440 per disk side).

To understand cylinders, you have to know that in most hard disks, there are several disk platters, and that each platter has a read head on each side (except for the reference disk, in which one of the heads is removed for the sectoring reference reader). Conceptually, all of the matching tracks on the platters can be visualized as forming a hollow cylinder going through each of the platters at a given track, hence the terms cylinder. Thus, a cylinder is the logical combination of all the sides for all the platters at a given track, and the number of cylinders is equal to the number of tracks, or at least was in the original CHS geometry system.

Sources:
http://www.pcguide.com/ref/fdd/mediaGeometry-c.html
http://www.rundegren.com/software/floppyimage/faq/
http://www.howstuffworks.com/floppy-disk-drive2.htm
http://www.cknow.com/tutorcom/term08_floppy.htm
http://www.upscale.utoronto.ca/GeneralI ... n_disk.pdf
Perica
Member
Member
Posts: 454
Joined: Sat Nov 25, 2006 12:50 am

Re:OS Coding philosophy

Post by Perica »

..
Last edited by Perica on Sun Dec 03, 2006 8:26 pm, edited 1 time in total.
jrfritz

Re:OS Coding philosophy

Post by jrfritz »

He helps alot...he helped me too...

some people think his info is alot and bother some...

I don't since he helps people learn.
Perica
Member
Member
Posts: 454
Joined: Sat Nov 25, 2006 12:50 am

Re:OS Coding philosophy

Post by Perica »

..
Last edited by Perica on Sun Dec 03, 2006 8:26 pm, edited 1 time in total.
DarylD

Re:OS Coding philosophy

Post by DarylD »

PS stands for Postscript.
User avatar
Pype.Clicker
Member
Member
Posts: 5964
Joined: Wed Oct 18, 2006 2:31 am
Location: In a galaxy, far, far away
Contact:

Re:OS Coding philosophy

Post by Pype.Clicker »

DarylD wrote: PS stands for Postscript.
hmm ... i guess you meant "post scriptum" ... (latin for "after the signature")
Perica
Member
Member
Posts: 454
Joined: Sat Nov 25, 2006 12:50 am

Re:OS Coding philosophy

Post by Perica »

..
Last edited by Perica on Sun Dec 03, 2006 8:26 pm, edited 1 time in total.
User avatar
Pype.Clicker
Member
Member
Posts: 5964
Joined: Wed Oct 18, 2006 2:31 am
Location: In a galaxy, far, far away
Contact:

Re:OS Coding philosophy

Post by Pype.Clicker »

sectors are counted 1..N, tracks and heads are 0..N-1 (iirc)
This should be described in any valuable BIOS interrupts list.
Post Reply