D Bare Bones II: Difference between revisions

Jump to navigation Jump to search
m
Bot: Replace deprecated source tag with syntaxhighlight
[unchecked revision][unchecked revision]
(Fix D Bare bones: now you should import core.volatile module for volatile)
m (Bot: Replace deprecated source tag with syntaxhighlight)
Line 78:
Assemble that with:
 
<sourcesyntaxhighlight lang="bash">nasm -f elf -o start.o start.asm</sourcesyntaxhighlight>
 
==kernel.main.d==
Line 142:
You then compile that with:
 
<sourcesyntaxhighlight lang="bash">gdc -fno-druntime -m32 -c kernel.main.d -o kernel.main.o -g</sourcesyntaxhighlight>
==linker.ld==
<sourcesyntaxhighlight lang="c">
OUTPUT_FORMAT(elf32-i386)
ENTRY (start)
Line 177:
end = .; _end = .; __end = .;
}
</syntaxhighlight>
</source>
 
Now finally you can link all of that with:
 
<sourcesyntaxhighlight lang="bash">ld -melf_i386 -T linker.ld -o kernel.bin start.o kernel.main.o</sourcesyntaxhighlight>
Your kernel is now kernel.bin, and can now be booted by grub, or run in qemu:
 
<sourcesyntaxhighlight lang="bash">qemu-system-i386 -kernel kernel.bin</sourcesyntaxhighlight>
 
[[Category:Bare bones tutorials|D bare bones]]
Cookies help us deliver our services. By using our services, you agree to our use of cookies.

Navigation menu