Page 1 of 1

[solved] [linux] modify MBR FAT12

Posted: Mon Nov 16, 2015 4:51 am
by f222
Hi,
I'm trying to develop an OS, I'm on the brokenthorn tutorial, on the FAT12 part, I try to make a FAT12 floppy, I get here : [url]http://wiki.osdev.orgLoopback_Device#Floppy_Disk_Images_With_FAT12[/url] . And then I try to make /dev/loop0 a bootable floppy, I try using

Code: Select all

dd of=/dev/loop0 if=my_boot_binary bs=512 count=1
but when I try to use bochs with /dev/loop0 as a bootable floppy it just tells me no bootable device. If someone knows how to do it correctly I would really like him to help me.

Best regards,

PS : sorry for my bad english

Re: [linux] modify MBR FAT12

Posted: Mon Nov 16, 2015 5:41 am
by Octocontrabass
f222 wrote:but when I try to use bochs with /dev/loop0 as a bootable floppy it just tells me no bootable device.
You're trying to boot the image file behind /dev/loop0 and not /dev/loop0 itself, right?

The data written by mkdosfs is bootable; it displays a message and halts. What happens if you try to boot the disk before putting your boot sector on it?

If bochs is able to boot the blank disk created by mkdosfs but not your boot sector, there is a problem with your boot sector.

Re: [solved] [linux] modify MBR FAT12

Posted: Mon Nov 16, 2015 7:07 am
by f222
I found what I did wrong, i did

Code: Select all

bochs 'boot:a' 'floppya: 1_44=/dev/loop0, status=inserted'
and not

Code: Select all

bochs 'boot:a' 'floppya: 1_44=floppy.img, status=inserted'
Sorry for annoying you for a such stupid thing, :(

Re: [solved] [linux] modify MBR FAT12

Posted: Mon Nov 16, 2015 7:29 am
by f222
Just a little question : Before this tutorial i was on a french one where they said to do

Code: Select all

cat my_boot_sector my_kernel /dev/zero | dd of=floppyA bs=512 count=2880
wich is really easier, is it a good way to make floppies or not?

Re: [solved] [linux] modify MBR FAT12

Posted: Mon Nov 16, 2015 8:51 am
by Octocontrabass
If you do it that way, it won't be FAT12.

Re: [solved] [linux] modify MBR FAT12

Posted: Mon Nov 16, 2015 9:26 am
by f222
I understood that, but is it really useful to be in FAT12?

Re: [solved] [linux] modify MBR FAT12

Posted: Mon Nov 16, 2015 10:19 am
by BASICFreak
f222 wrote:I understood that, but is it really useful to be in FAT12?
If you want the disk to be read by an existing OS then maybe... EXT2 is also a choice for *NIX based OSes...

I prefer FAT as I can mount the image and copy files over without writing utilities... (and I've avoided EXTx due to lack of Windows drivers, though I am actually unsure why that's my case as I only use linux unless I want to play a game...)

Re: [solved] [linux] modify MBR FAT12

Posted: Mon Nov 16, 2015 11:42 am
by madanra
BASICFreak wrote:(and I've avoided EXTx due to lack of Windows drivers, though I am actually unsure why that's my case as I only use linux unless I want to play a game...)
I haven't used Windows (apart from at work) for a couple of years now, but when I did I found ext2fsd worked fine.