From 9fde748acea83d775e367a64858414b674f05b13 Mon Sep 17 00:00:00 2001 From: Miguel Date: Sat, 8 Sep 2018 17:08:55 +0200 Subject: struggling with pic and lapic and smp... --- asm/asm_mp.asm | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'asm/asm_mp.asm') diff --git a/asm/asm_mp.asm b/asm/asm_mp.asm index 5e5259e..165dc97 100644 --- a/asm/asm_mp.asm +++ b/asm/asm_mp.asm @@ -1,7 +1,8 @@ global smp_start -global LLOCK extern smp_main global gdt_descriptor +global asm_smp_unlock + ; master boot record for application processors smp_start: @@ -20,7 +21,12 @@ smp_start: [bits 32] -LLOCK: dd 0 +LLOCK: dd 1 + +asm_smp_unlock: + mov eax, 0x0 + mov [LLOCK], eax + ret init_pm: @@ -31,7 +37,7 @@ init_pm: mov fs, ax mov gs, ax - mov ebp, 0x7000 + mov ebp, 0x7000 ;temporary stack mov esp, ebp call boot_32_pm ;continue booting in 32-bit protected mode @@ -46,11 +52,11 @@ boot_32_pm: mov ebp, 0x7000 mov esp, ebp - call smp_main + and esp,-16 ; padding to align stack on 16byte boundary before CALL + call smp_main jmp $ ; should never be reached - gdt_start: gdt_null: ;null descriptor (2 x 4 bytes) -- cgit v1.2.3