1. I want to know how to code a specific general bootloader:
-I don't want any fancy stuff, yet!
-I want to code a bootloader that just boots my kernel, nothing more at this point.
-Yes I've seen all the wiki topics related to that, that is not what I want.
-I do not want to use GRUB or any premade one, my OS = my bootloader.
-I am not asking for like full source code stuff (all doe wouldn't be bad, ).
-I need like a layout of code, line after line, like a description of what to put in each line
I will give you an example for that above:
First of all how I code my ASM script:
1st part -> I call all the functions I want
2nd part -> I code all my functions
3rd part -> I put all the "dynamic" stuff in there, like strings bools ints etc, in asm they are called like db, int 0xH, sub, etc...
Sample idea I want:
Code: Select all
bits, org, etc.......
call myFunction1 ;print text
call myFunction2 ;color stuff etc not important
myFunction1:
mov etc etc
;now I here I want to know what to put:
[BITS 32]
LoadKernel:
; like what to do in here just to make my bootloader call my Kernel_Main
;idk here set disk offset?? floppy sectors etc
;idk here set or load gdt
;idk here load paging
;idk here flush idt idk
;what is the bare minimum to load my Kernel_Main and also I need to ghost placeholders for me future code initialization
for e.g ghost placeholder: ;here you need to load this, here you need to load that, but for now it will work without it
extern Kernel_Main
call Kernel_Main
myFunction2:
eax, esp, etc etc etc
StringToPrint db 'test 123', 0
StringTwoEtc db 'test 234332', 0
Now my simple question. I need a make file for Windows, yeah Windows.
I use Windows for OSDev. |NASM| + |Notepad++| + |VirtualBox| + |Cygwin| + |Required Binutils| + |Magic ISO|
It is really hard to compile script by script and make a new iso and boot it with virtualbox every time I change my code.
Can windows even run MakeFiles using Cygwin?
Something like:
Code: Select all
ValuesForC: -std=gnu99 -ffreestanding -O2 -Wall -Wextra
///to compile .c files I use: gcc -c kernel.c -o kernel.o -std=gnu99 -ffreestanding -O2 -Wall -Wextra
ValuesForASM: -elf32
//to compile .S files I use: nasm -elf32 bootloader.S -o bootloader.o
ValuesForLinker.LD: I have no Idea on how to do this
//I need something to link my .o files together with some specific values maybe?
Now In here I want to do like:
Files To Compile Every Time:
kernel.c
bootloader.S
linker.ld
somethingelse.c
Stuff to link:
kernel.o
bootloader.S
somethingelse.o
Now I want:
make IMG file from all those linkes stuff
convert IMG to ISO
virtualbox.boot.load that ISO
Thanks!