I am a bit confused about the build environment for creating an own OS. At the moment I use NASM and cygwin (gcc-4 and ld).
System: Widnows 7 x64
Target Own 32 bit OS
Files:
Code: Select all
build.bat = Compiles the files and call link.txt
link.txt = Links kernel32.asm and kernel.c
kernel32.asm = Assembler file
kernel.c = Dummy C file with a main
Code: Select all
nasmw -f aout -o kernel32.obj kernel32.asm
gcc-4 -ffreestanding -c -o ckernel.obj kernel.c
ld -T link.txt -o c32kernel.bin
Code: Select all
OUTPUT_FORMAT("binary")
INPUT(kernel32.obj ckernel.obj)
ENTRY(start)
SECTIONS
{
.text 0x10200 : {
code = .; _code = .; __code = .;
*(.text)
. = ALIGN(1);
}
.data : {
data = .; _data = .; __data = .;
*(.data)
. = ALIGN(1);
}
.bss :
{
bss = .; _bss = .; __bss = .;
*(.bss)
. = ALIGN(1);
}
end = .; _end = .; __end = .;
}
Code: Select all
kernel32.obj: file not recognized: File format not recognized
Best regards