Bootfähig

Post Reply
Message
Author
dymat
Posts: 2
Joined: 08. Jul 2003 22:22

Bootfähig

#1 Post by dymat »

Hi,
Wißt ihr, wie man bootfähige Programme schreibt (am besten in C). Ich meine, wie muss ich sie compilieren? Was ist zu beachten? Gibt es bibliotheken? usw...
Ich will nur ein wenig damit rumspielen, aber alle meine Versuche gingen daneben.
Es soll praktisch genauso gestartet werden können, wie ein normaler Kernel...

c ya D

rattengift

Re: Bootfähig

#2 Post by rattengift »

du musst nichts speziell kompilieren sondern du brauchst einen bootloader, der dein programm aufruft.
wenn ich mich recht erinnere (ich habs mir jetzt nicht noch mal im detail angeschaut -- sorry) wird sowas hier recht gut beschrieben:
http://axiom.anu.edu.au/~okeefe/p2b/pow ... 2bash.html

Denny

Re: Bootfähig

#3 Post by Denny »

Danke <img src="http://www.pl-forum.de/UltraBoard/Images/Happy.gif" border="0" align="middle">

aber, wie wurde es bei der Programmierung des Bootloaders realisiert, das er gestartet wird? -weißt du darüber etwas?

c ya D

Allo

Re: Bootfähig

#4 Post by Allo »

Mit Assembler für die entsprechende Platform.

Und das ganze in 512 Byte <img src="http://www.pl-forum.de/UltraBoard/Images/Happy.gif" border="0" align="middle">.
Na gut, nur Stage 1 ...


Allo

rattengift

Re: Bootfähig

#5 Post by rattengift »

Hi,

> aber, wie wurde es bei der Programmierung des Bootloaders realisiert, das er gestartet wird? -weißt du darüber etwas?

in der url die ich angegeben habe steht das drin. vielleicht etwas knapp, aber notfalls kannst du dir ja auch den sourcecodes so eines loaders anschauen.
in kapitel 2 steht, was für eine struktur das boot-image haben soll, und das wird am bsp von "unios" demonstriert.

"Then a program called the bootstrap loader, located in the ROM BIOS, looks for a boot sector. A boot sector is the first sector of a disk and has a small program that can load an operating system. Boot sectors are marked with a magic number 0xAA55 = 43603 at byte 0x1FE = 510. That's the last two bytes of the sector. This is how the hardware can tell whether the sector is a boot sector or not."

"Check out, download compile and make a boot disk for Unios. This is just a bootable ``Hello World!'' program, consisting of just over 100 lines of assembler code."

ausserdem würde ich mir mal SYSLINUX/ISOLINUX anschauen: http://syslinux.zytor.com/iso.php

Post Reply