Ich habe bei dem Bootstrap-code leider zwei Probleme.
Das eine betrifft Bochs/Grub.
Der Loader gibt den Fehler 7 aus. Er verbietet es, dass Daten unterhalb der 1 MB Grenze abgelegt werden. Das verstehe ich aber nicht, da der ELF-Header erst alles ab der 1-MB Grenze haben möchte. Der Bootstrap-Code liegt auch innerhalb der Grenze.
Der andere Fehler ist, dass QEMU für die APs eine Bounded Range Exception.
Hier mein Assembler-Code:
.code16
/*
 * layout of the structure:
 *    1. GDT
 *    2. IDT
 *    3. stack-pointer (virtual, if CONFIG_MMU is set, else physical)
 *    4. Page-Table (if CONFIG_MMU exists, else the entry does not exist)
 *    5. the smp_ap_init-code (C-code) (it is the fourth entry, if !CONFIG_MMU)
 */
.section .text
start_up:
    cli
    lea (smp_init_end) , %ax
    lgdtl (%eax)
	xor %ax , %ax
	inc %ax
	lmsw %ax
    ljmp $0x0000 , $code_32
.code32
code_32:
    mov $0x10 , %eax
    mov %eax , %ds
	mov %eax , %es
	mov %eax , %fs
	mov %eax , %gs
	mov %eax , %ss
    lea (smp_init_end) , %eax
    add $0x4 , %eax
    //set the IDT
    lidtl (%eax)
    add $0x4 , %eax
    lea (%eax) , %esp
    add $0x4 , %eax
#if defined(CONFIG_MMU)
    //activate paging
    lea (%eax) , %ebx
    mov %ebx , %cr3
    mov %cr0 , %ebx
    or $0x80010000 , %eax
    mov %ebx , %cr0
    add $0x4 , %eax
#endif
    lea (%eax) , %eax
    //call the C-code
    jmp *%eax
smp_init_end:
Übersehe ich etwas?