Currently I'm playing around with writing my own OS. What's available on mega-tokyo.com and invalidsoftware.net/os is amazing and made getting started easier than I expected. Though I encounter some problems ...
The one I'm currently lost with is the following:
Among other things I red BareBones (http://www.osdev.org/osfaq2/index.php/BareBones) and this (http://www.invalidsoftware.net/os/).
BareBones worked. Then I tried to combine what I had from BareBones with a C++ kernel like the one on invalidsoftware.net/os which resulted in the following:
The loader from BareBones is mostly untouched except ...
multiboot.s contains the multiboot header from loader.s (this works)
The files core.cpp , core_video.cpp and core.h/video.h are attached in devel.tar.gz (REMOVE THE .ZIP EXTENSION!! It is "devel.tar.gz")
the linker script is c&p'ed from barebones
then I used the following bash scripts to compile that all together:
Code: Select all
#!/bin/bash
...
export SRC="src"
export CC="gcc"
export LNK="ld"
export ASM="as"
...
Code: Select all
#!/bin/bash
CCOPT="-Wall -Werror -nostdlib -nostartfiles -nodefaultlibs"
set -x
$CC -c $SRC/os/core_video.cpp -o $SRC/os/core_video.o $CCOPT
$CC -c $SRC/os/core.cpp -o $SRC/os/core.o $CCOPT
$ASM $SRC/os/loader.s -o $SRC/os/loader.o
$ASM $SRC/os/multiboot.s -o $SRC/os/multiboot.o
$LNK -T $SRC/aux/link_core.ld -o $SRC/os/core.bin \
$SRC/os/multiboot.o \
$SRC/os/core_video.o \
$SRC/os/core.o $SRC/os/loader.o
set +x
Code: Select all
+ ld -T src/aux/link_core.ld -o src/os/core.bin src/os/multiboot.o src/os/core_video.o src/os/core.o src/os/loader.o
src/os/core.o(.text+0x61): In function `main':
core.cpp: undefined reference to `_Unwind_Resume'
src/os/core.o(.eh_frame+0x12): undefined reference to `__gxx_personality_v0'
+
Both my development and my test machine are VMWare.
Development:
Fedora Core 4
GCC 4.0.0 20050519 (Red Hat 4.0.0-8)