fat12 filesystem problem

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
huh
Posts: 13
Joined: Wed Jan 25, 2012 10:05 am

fat12 filesystem problem

Post by huh »

I chose the fat12 filesystem for my os to run on becaouse it was easy. So I wrote a bootloader which would boot to a file called init.bin, I found out that in fat12 it would be INIT BIN so in the filename string I wrote

Code: Select all

db "INIT  BIN"
I had made many error messages so I would know what type of error it is (if there at all was an error). I booted it up in qemu with

Code: Select all

qemu ./boot.bin
and it gave me a root dir error, so I dd'd it into a 512MB partition on my hdd and run qemu:

Code: Select all

qemu /dev/sda6
now there was no root dir error, only the file not found error, so I mounted /dev/sda6 and copied the init.bin file and run qemu again and it still said file not found, I said huh and changed the filename to what the bootloader is searching for: INIT BIN. I run qemu again and it still could not find the file. How do I make the bootloader load to init.bin???
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Re: fat12 filesystem problem

Post by Solar »

huh wrote:I chose the fat12 filesystem for my os to run on becaouse it was easy.
Apparently not. 8)
So I wrote a bootloader which would boot to a file called init.bin, I found out that in fat12 it would be INIT BIN...
How did you come to this conclusion?
...so...
...some ad-hoc trial-and-error following which I couldn't quite follow...
How do I make the bootloader load to init.bin???
FAT would be a good starting point. There are several links to further information included. GRUB would be another option, and Bare Bones could give you a jump start. However, I'd also check if you really, really meet the Required Knowledge.
Every good solution is obvious once you've found it.
User avatar
bubach
Member
Member
Posts: 1223
Joined: Sat Oct 23, 2004 11:00 pm
Location: Sweden
Contact:

Re: fat12 filesystem problem

Post by bubach »

Code: Select all

db "INIT  BIN"
should be

Code: Select all

db "INIT    BIN"
you know FAT12 names are 8bytes +3bytes extension right? Not 6+3.
Last edited by bubach on Wed Feb 22, 2012 3:44 pm, edited 1 time in total.
"Simplicity is the ultimate sophistication."
http://bos.asmhackers.net/ - GitHub
User avatar
VolTeK
Member
Member
Posts: 815
Joined: Sat Nov 15, 2008 2:37 pm
Location: The Fire Nation

Re: fat12 filesystem problem

Post by VolTeK »

huh wrote: I run qemu again and it still could not find the file. How do I make the bootloader load to init.bin???
hm.
huh wrote:I chose the fat12 filesystem for my os to run on becaouse it was easy
hmm...
Why are you here then?

At the beginning of every root directory entry is 11 bytes of file name for that entry.

Your Init should look like

INIT----BIN. Note, the - are actually spaces. If you read, you would know this.

Hell its probably not even the actual file system code, its probably your calculations since your using a hard disk.
User avatar
brain
Member
Member
Posts: 234
Joined: Thu Nov 05, 2009 5:04 pm
Location: UK
Contact:

Re: fat12 filesystem problem

Post by brain »

any chance of actually seeing more source than just one db instruction?
That would help a lot in diagnosing the issue. I've got working FAT32 in C so i could probably help you out with FAT12.
Post Reply