Bootloader + kernel + floppy

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
David003
Posts: 11
Joined: Tue Mar 29, 2011 6:08 am

Bootloader + kernel + floppy

Post 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.
garob
Posts: 16
Joined: Wed Dec 30, 2009 3:26 am
Location: Melbourne, Australia

Re: Bootloader + kernel + floppy

Post by garob »

Use dd.

Also I think there is a page on the wiki about this.
David003
Posts: 11
Joined: Tue Mar 29, 2011 6:08 am

Re: Bootloader + kernel + floppy

Post 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"
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Re: Bootloader + kernel + floppy

Post 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.
Every good solution is obvious once you've found it.
David003
Posts: 11
Joined: Tue Mar 29, 2011 6:08 am

Re: Bootloader + kernel + floppy

Post 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..
M-Saunders
Member
Member
Posts: 155
Joined: Fri Oct 27, 2006 5:11 am
Location: Oberbayern
Contact:

Re: Bootloader + kernel + floppy

Post 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
MikeOS -- simple, well-documented x86 real-mode OS written in assembly language
http://mikeos.sourceforge.net
egos
Member
Member
Posts: 612
Joined: Fri Nov 16, 2007 1:59 pm

Re: Bootloader + kernel + floppy

Post 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
If you have seen bad English in my words, tell me what's wrong, please.
David003
Posts: 11
Joined: Tue Mar 29, 2011 6:08 am

Re: Bootloader + kernel + floppy

Post by David003 »

Thanks :)
User avatar
summersong
Member
Member
Posts: 32
Joined: Sat Mar 26, 2011 5:26 am
Location: Moscow

Re: Bootloader + kernel + floppy

Post 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
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: Bootloader + kernel + floppy

Post 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. :-({|=
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
Post Reply