Although Toro seems good, I am now, officially, lost. What I seek to do is just get a bootsector to launch a program/procedure. Although Toro does contain it (I think) it uses all manner of complex techniques (multitasking, boot options...) which has me completely confused. Any help would much appreciated. Here is the file I have in the boot sector at the moment:

Code:
[bits 32]

[global kstart]

[extern kmain]
 

MULTIBOOT_MODULE_ALIGN     equ   1<<0
MULTIBOOT_MEMORY_MAP      equ   1<<1
MULTIBOOT_GRAPHICS_FIELDS    equ   1<<2
MULTIBOOT_ADDRESS_FIELDS    equ   1<<16
 

MULTIBOOT_HEADER_MAGIC     equ   0x1BADB002
MULTIBOOT_HEADER_FLAGS     equ   MULTIBOOT_MODULE_ALIGN | MULTIBOOT_MEMORY_MAP
MULTIBOOT_HEADER_CHECKSUM    equ   -(MULTIBOOT_HEADER_MAGIC + MULTIBOOT_HEADER_FLAGS)

KERNEL_STACKSIZE        equ   0x4000
 
section .text

align 4
dd MULTIBOOT_HEADER_MAGIC
dd MULTIBOOT_HEADER_FLAGS
dd MULTIBOOT_HEADER_CHECKSUM
 

kstart:
    mov esp, KERNEL_STACK+KERNEL_STACKSIZE 
    push eax                
    push ebx               
    call kmain            
    cli                 
    hlt                 
 
section .bss

align 32
KERNEL_STACK:
    resb KERNEL_STACKSIZE
My question at the moment is, why does it not execute the kmain procedure? Does it all have to be in one file or will seperate files do? Here is the result of DIR in the folder:

Code:
autocompile.sh	 crt.o		  kernel.obj	  multiboot.o	 stub.o
autocompile.sh~ crt.ppu	  kernel.pas	  multiboot.pas system.o
console.o	 howtocompile.txt kernel.ppu	  multiboot.ppu system.pas
console.pas	 kernel.bak	  linker.script  stub.asm	 system.ppu
console.ppu	 kernel.o	  linker.script~ stub.asm~
where stub.o is boot record...