simple os

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
gmoney
Member
Member
Posts: 106
Joined: Mon Jan 03, 2005 12:00 am
Location: Texas, Usa

simple os

Post by gmoney »

Im trying to make a simple os that can do the following and only the following
+read and write to a floppy (simple floppy drive, without dma support)
+display a .gif file

there u have it thats it, any suggestions?[/i]
User avatar
bubach
Member
Member
Posts: 1223
Joined: Sat Oct 23, 2004 11:00 pm
Location: Sweden
Contact:

Re: simple os

Post by bubach »

"Simplicity is the ultimate sophistication."
http://bos.asmhackers.net/ - GitHub
earlz
Member
Member
Posts: 1546
Joined: Thu Jul 07, 2005 11:00 pm
Contact:

Re: simple os

Post by earlz »

the first part is pretty easy,if you mean raw and not filesystems, if you are using real mode then int 13h awaits you and for protected mode- you got to learn about gdts,idts,making interrupt functions,(i think) dma and reading/writing to ports

the second part im not familar with the gif format so i cant offer any advice but if its in real mode then int 10h else then,well research vga and stuff

oh and visit those places above me
User avatar
JAAman
Member
Member
Posts: 879
Joined: Wed Oct 27, 2004 11:00 pm
Location: WA

Re: simple os

Post by JAAman »

setting up FAT12 is actually quite easy (and more usefull since you can then copy files onto the disk from any operating system and read the files in yours (which RAW disk access cannot do)

displaying a gif is going to be harder and will require graphics mode manipulation and pixel setting (still not hard)

if this is the extent of a _very_ basic bootable program then stick with RMode but if you will be adding more functionality then the move to PMode will be well worth the additional (significant) effort
earlz
Member
Member
Posts: 1546
Joined: Thu Jul 07, 2005 11:00 pm
Contact:

Re: simple os

Post by earlz »

can u reccommend any beginner fat12 tutorials(not documents that say what is in a fat and stuff) cause i looked at some things and i just dont know where to start really
User avatar
JAAman
Member
Member
Posts: 879
Joined: Wed Oct 27, 2004 11:00 pm
Location: WA

Re: simple os

Post by JAAman »

well i doubt you will find any FAT12 "tutorials" but its really simple to use (or perhaps because it is)

your boot sector must start with the bpb which defines a lot of values and identifies the disk as being FAT12

hidden sectors actually refers to other partitions (and the MBR) and gives you the offset of the boot sector (on floppy disks it should always be 0)

the first sector after the reserved sectors(almost always 1 and many programs will break if you make it more than 1) will be your FAT table -- one entry per FAT cluster(entries are 12bits for FAT12, 16bits for FAT16 and 32 bits for FAT32) starting with cluster#1

find the number of sectors in the fat from the bpb and multiply by number of fats(also in bpb -- and almost always 2) and add the number of reserved and hidden sectors(hidden will usually be 0 on FDD) to find the start of the root dir

then parse the root dir to find the file you need: the dir entry will tell you which FAT cluster the file starts in

cluster 1 begins with the first sector after the root dir(the bpb should tell you the #of 32byte entries in the root dir) and look up the cluster entry in the FAT table -if the entry is FFF it is the last cluster in the file if not it will point to the next cluster (if the entry is 0 then the FAT is corrupt because 0 means the cluster is unused)

the number of sectors in each cluster is also listed in the bpb

it sounds alot harder than it really is -- just get the FAT12 docs and look them over
User avatar
JAAman
Member
Member
Posts: 879
Joined: Wed Oct 27, 2004 11:00 pm
Location: WA

Re: simple os

Post by JAAman »

if you have any more specific questions just ask
earlz
Member
Member
Posts: 1546
Joined: Thu Jul 07, 2005 11:00 pm
Contact:

Re: simple os

Post by earlz »

Wow thanks a lot
gmoney
Member
Member
Posts: 106
Joined: Mon Jan 03, 2005 12:00 am
Location: Texas, Usa

Re: simple os

Post by gmoney »

ok i think im going to start off with the floppy driver first, i have the manual from intel but some of it is haze so if u know any good floppy manuals that will help me. also i am developing a c++, c hybrid kernel because i dont know that much asm.
Just because your phone is "smart" doesn't mean the user is... ijs
Post Reply