Page 1 of 1

Bootloader + kernel + floppy

Posted: Wed Mar 30, 2011 3:03 am
by David003
Hi guys,

I have a very simpel Bootloader + kernel.
But how can i create a floppy (Virtual), With the bootloader + kernel.

I'm Using Ubuntu.

Thanx, David.

Re: Bootloader + kernel + floppy

Posted: Wed Mar 30, 2011 3:25 am
by garob
Use dd.

Also I think there is a page on the wiki about this.

Re: Bootloader + kernel + floppy

Posted: Wed Mar 30, 2011 3:27 am
by David003
garob wrote:Use dd.

Also I think there is a page on the wiki about this.
I'm new to ubuntu. I do not know much about it yet.

I've been hanging out on the wiki, only I know no good "search terms"

Re: Bootloader + kernel + floppy

Posted: Wed Mar 30, 2011 3:47 am
by Solar
Check the chapter "Working with Disk Images" on the entry page.

Hint: Being new to your environment is not a good precondition. Perhaps you should familiarize yourself with your new environment and toolchain first before trying your hand at OS development.

Re: Bootloader + kernel + floppy

Posted: Wed Mar 30, 2011 4:01 am
by David003
Solar wrote:Check the chapter "Working with Disk Images" on the entry page.

Hint: Being new to your environment is not a good precondition. Perhaps you should familiarize yourself with your new environment and toolchain first before trying your hand at OS development.
Thanx :)

I'm making a simple bootloader that says: 'Hello world'.
then more complicated.. etc..

Re: Bootloader + kernel + floppy

Posted: Wed Mar 30, 2011 7:24 am
by M-Saunders
1) Use 'mkdosfs -C mydisk.img 1440' to make the floppy image

2) Use 'dd' to write the bootloader to the disk, eg 'dd status=noxfer conv=notrunc if=myfirst.bin of=mydisk.img'

Guide here: http://mikeos.berlios.de/write-your-own-os.html

As others have said, you should be very familiar with the OS you're using first. You've chosen arguably the most advanced and complicated topic in programming, so you should be at least very proficient in the host OS first.

M

Re: Bootloader + kernel + floppy

Posted: Wed Mar 30, 2011 8:25 am
by egos
mkfloppy.zip

One example:

Code: Select all

include "mkimage/mkfloppy.inc"

format binary as "ima"

file "mkimage/bootcode.bin",512

; fat1
db 0F0h,0FFh,0FFh,9*512-3 dup 0

; fat2
db 0F0h,0FFh,0FFh,9*512-3 dup 0

; root
dent io______sys,"IO      SYS",FA_ARC+FA_SYS+FA_HID+FA_RO
dent autoexecbat,"AUTOEXECBAT",FA_ARC
dent config__sys,"CONFIG  SYS",FA_ARC
dent setramd_bat,"SETRAMD BAT",FA_ARC
; ...
dent ebd_____sys,"EBD     SYS",FA_ARC+FA_SYS+FA_HID+FA_RO
dent gcdrom__sys,"GCDROM  SYS",FA_ARC
dent bcdw_cl_com,"BCDW_CL COM",FA_ARC
dent fdemuoffcom,"FDEMUOFFCOM",FA_ARC
dent keyb____com,"KEYB    COM",FA_ARC
dent keybrd3_sys,"KEYBRD3 SYS",FA_ARC
rb 33*512-$

; data
stof io______sys,"content/io.sys"
stof autoexecbat,"4bcdw/autoexec.bat"
stof config__sys,"4bcdw/config.sys"
stof setramd_bat,"content/setramd.bat"
; ...
stof ebd_____sys,"content/ebd.sys"
stof gcdrom__sys,"4bcdw/gcdrom.sys"
stof bcdw_cl_com,"4bcdw/bcdw_cl.com"
stof fdemuoffcom,"4bcdw/fdemuoff.com"
stof keyb____com,"4bcdw/keyb.com"
stof keybrd3_sys,"4bcdw/keybrd3.sys"
times 2*80*18*512-$ db 0
Last links:
[Solved] kernel.bin->floppy img with GRUB
[SOLVED]: Building floppy.img

Re: Bootloader + kernel + floppy

Posted: Wed Mar 30, 2011 9:40 am
by David003
Thanks :)

Re: Bootloader + kernel + floppy

Posted: Wed Mar 30, 2011 11:21 am
by summersong
I use BFI and MKBT from nu2.nu:
http://www.nu2.nu/bfi/
http://www.nu2.nu/mkbt/

And RAM drive (F:).

Build script:
@echo off
set MAKEPATH=F:\

del /Q %MAKEPATH%\*.*
rd /Q /S %MAKEPATH%\A

md %MAKEPATH%\A
md %MAKEPATH%\A\app
md %MAKEPATH%\A\sys

echo Public Domain>>%MAKEPATH%\A\sys\lic.txt

cls

echo.
echo boot.asm
TOOLS\fasm.exe boot.asm %MAKEPATH%\boot.bin
echo.
echo ldr.asm
TOOLS\fasm.exe ldr.asm %MAKEPATH%\A\sys\osldr.sys

TOOLS\bfi.exe -t=144 -f=%MAKEPATH%\floppy.img %MAKEPATH%\A
TOOLS\mkbt.exe %MAKEPATH%\boot.bin %MAKEPATH%\floppy.img

rem if exist %MAKEPATH%\floppy.img "TOOLS\Bochs\bochs-win64-cygwin.exe" -q -f bochs.bxrc

Re: Bootloader + kernel + floppy

Posted: Thu Mar 31, 2011 4:29 am
by Combuster
This question is in the FAQ, therefore I hereby copy-paste all the other parts of the wiki that have not been mentioned yet into this thread. :-({|=