You guys ROCK !!!!
Isn't this a pretty site !!!
File size of the kernel file is 469 Bytes.
My batch file I used :
compile.bat
Code: Select all
yasm -f elf -o start.o start.asm
i586-elf-gcc -ffreestanding -c -o kernel.o kernel.c
i586-elf-ld -T linker.ld --oformat binary -o kernel32.sys start.o kernel.o
pause
start.asm
Code: Select all
global start
extern main
[BITS 32]
start:
call main
cli
hlt
EXTERN code, bss, end
ALIGN 4
mboot:
dd mboot
dd code
dd bss
dd end
dd start
linker.ld
Code: Select all
OUTPUT_FORMAT("binary")
SECTIONS
{
.text 0x100000 : ALIGN (0x1000)
{
code = .;
_code = .;
__code = .;
*(.text)
*(.rodata*)
}
.data : ALIGN (0x1000)
{
data = .;
_data = .;
__data = .;
*(.data)
}
.bss : ALIGN (0x1000)
{
bss = .;
_bss = .;
__bss = .;
*(COMMON)
*(.bss)
}
end = .;
_end = .;
__end = .;
/DISCARD/ : { *(.comment .note .eh_frame) }
}
start.sh for cygwin :
Code: Select all
#!/bin/sh
export BUILDROOT=$(PWD)/..
export PREFIX=$BUILDROOT/cross-tools/
export TARGET=i586-elf
tar -jxf binutils-2.23.1.tar.bz2
mkdir binutils-build-2.23.1
cd binutils-build-2.23.1
../binutils-2.23.1/configure --prefix=$PREFIX --target=$TARGET --program-prefix=$TARGET- --disable-werror --enable-gold --enable-plugins --disable-nls --disable-shared --disable-multilib
make -j 1 all
make install
cd ..
tar -jxf gcc-4.8.1.tar.bz2
tar -jxf gmp-5.0.2.tar.bz2
mv gmp-5.0.2 gmp
mv gmp gcc-4.8.1
tar -xf mpc-0.9.tar.gz
mv mpc-0.9 mpc
mv mpc gcc-4.8.1
tar -jxf mpfr-2.4.2.tar.bz2
mv mpfr-2.4.2 mpfr
mv mpfr gcc-4.8.1
mkdir gcc-build-$TARGET
cd gcc-build-$TARGET
../gcc-4.8.1/configure --target=$TARGET --prefix=$PREFIX --disable-nls --enable-languages=c,c++ --without-headers
make -j 1 all-gcc
make install-gcc
make -j 1 all-target-libgcc
make install-target-libgcc
Cygwin needed these libraries :
diff, bison, flex, m4, g++, make
I also used the following versions for this compile :
binutils-2.23.1.tar.bz2
gcc-4.8.1.tar.bz2
gmp-5.0.2.tar.bz2
mpc-0.9.tar.gz
mpfr-2.4.2.tar.bz2
This batch file I tested it with YASM. It works just like NASM.
I owe the following people a HUGE thank you for the knowledge they have shown and their patience in helping me understand what to do.
gerryg400
dozniak
sortie
piranha
halofreak1990
AJ
Combuster
Owen
beyondsociety
I am most humbled by this experience. THANK YOU !!!!!