[solved] [linux] modify MBR FAT12

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
f222
Posts: 4
Joined: Mon Nov 16, 2015 4:29 am

[solved] [linux] modify MBR FAT12

Post 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
Last edited by f222 on Mon Nov 16, 2015 7:06 am, edited 1 time in total.
The error is always between the chair and the keyboard
Octocontrabass
Member
Member
Posts: 5588
Joined: Mon Mar 25, 2013 7:01 pm

Re: [linux] modify MBR FAT12

Post 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.
f222
Posts: 4
Joined: Mon Nov 16, 2015 4:29 am

Re: [solved] [linux] modify MBR FAT12

Post 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, :(
The error is always between the chair and the keyboard
f222
Posts: 4
Joined: Mon Nov 16, 2015 4:29 am

Re: [solved] [linux] modify MBR FAT12

Post 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?
The error is always between the chair and the keyboard
Octocontrabass
Member
Member
Posts: 5588
Joined: Mon Mar 25, 2013 7:01 pm

Re: [solved] [linux] modify MBR FAT12

Post by Octocontrabass »

If you do it that way, it won't be FAT12.
f222
Posts: 4
Joined: Mon Nov 16, 2015 4:29 am

Re: [solved] [linux] modify MBR FAT12

Post by f222 »

I understood that, but is it really useful to be in FAT12?
The error is always between the chair and the keyboard
User avatar
BASICFreak
Member
Member
Posts: 284
Joined: Fri Jan 16, 2009 8:34 pm
Location: Louisiana, USA

Re: [solved] [linux] modify MBR FAT12

Post 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...)
BOS Source Thanks to GitHub
BOS Expanded Commentary
Both under active development!
Sortie wrote:
  • Don't play the role of an operating systems developer, be one.
  • Be truly afraid of undefined [behavior].
  • Your operating system should be itself, not fight what it is.
madanra
Member
Member
Posts: 149
Joined: Mon Sep 07, 2009 12:01 pm

Re: [solved] [linux] modify MBR FAT12

Post 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.
Post Reply