X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Kernel%2Farch%2Fx86%2Fstart.asm;h=0988a7733f36958ee24834f64f0487a6d9973a39;hb=2d83a99f3202f0e4688b58405f67604a24420861;hp=f79c647efcd950df117efa687cb730ad05991543;hpb=f021d00202ca65ad5771542b14a42e0a9db14120;p=tpg%2Facess2.git diff --git a/Kernel/arch/x86/start.asm b/Kernel/arch/x86/start.asm index f79c647e..0988a773 100644 --- a/Kernel/arch/x86/start.asm +++ b/Kernel/arch/x86/start.asm @@ -145,26 +145,30 @@ APStartup: lidt [gIDTPtr] mov ebp, [gpMP_LocalAPIC] - mov esi, [eax+0x20] ; Read ID - shr esi, 24 + mov ebx, [ebp+0x20] ; Read ID + shr ebx, 24 ;xchg bx, bx ; MAGIC BREAK ; CL is now local APIC ID - mov cl, BYTE [gaAPIC_to_CPU+esi] - ; CL is now the CPU ID - mov BYTE [gaCPUs+esi*8+1], 1 + mov cl, BYTE [gaAPIC_to_CPU+ebx] + xor ebx, ebx + mov bl, cl + ; BL is now the CPU ID + mov BYTE [gaCPUs+ebx*8+1], 1 ; Decrement the remaining CPU count dec DWORD [giNumInitingCPUs] ; Create a stack - lea edx, [esi+1] + lea edx, [ebx+1] shl edx, 5+2 ; *32 *4 lea esp, [gInitAPStacks+edx] call MM_NewKStack mov esp, eax ; Set TSS - lea ecx, [esi*8+0x30] + lea ecx, [ebx*8+0x30] ltr cx + ; Save the CPU number to a debug register + mov dr1, ebx ;xchg bx, bx ; MAGIC_BREAK ; Enable Local APIC