Skip to content

Commit 8a1443c

Browse files
cambio de dir para stacks de aps
1 parent 9e564c3 commit 8a1443c

File tree

10 files changed

+27
-97
lines changed

10 files changed

+27
-97
lines changed

asm/___sysvar.asm

Lines changed: 0 additions & 43 deletions
This file was deleted.

asm/___sysvar_16.asm

Lines changed: 0 additions & 25 deletions
This file was deleted.

asm/tsl.asm

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,9 @@ pag_1gb:
245245
;; 0x00030000 | 32 | pd high |sin | sin | 2MiB |
246246
;; 0x0004FFFF | | |inicializar| uso | |
247247
;; -----------+------+-----------+-----------+-----+------+---------------------
248+
;; 0x00050000 | 32 |
249+
;; 0x0005FFFF | |
250+
;; -----------+------+-----------+-----------+-----+------+---------------------
248251
;; 0x00060000 | 64 |dis-----ponible |pd fb si | | |
249252
;; 0x0009FFFF | |con-----dicion |*fb<16*2^30| | |
250253
;; -----------+------+-----------+-----------+-----+------+---------------------

asm/tsl_ap.asm

Lines changed: 24 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -152,14 +152,14 @@ align 16
152152
BITS 64
153153

154154
startap64:
155-
xor eax, eax ; aka r0
156-
xor ebx, ebx ; aka r3
157-
xor ecx, ecx ; aka r1
158-
xor edx, edx ; aka r2
159-
xor esi, esi ; aka r6
160-
xor edi, edi ; aka r7
161-
xor ebp, ebp ; aka r5
162-
xor esp, esp ; aka r4
155+
xor eax, eax
156+
xor ebx, ebx
157+
xor ecx, ecx
158+
xor edx, edx
159+
xor esi, esi
160+
xor edi, edi
161+
xor ebp, ebp
162+
xor esp, esp
163163
xor r8, r8
164164
xor r9, r9
165165
xor r10, r10
@@ -169,28 +169,31 @@ startap64:
169169
xor r14, r14
170170
xor r15, r15
171171

172-
mov ax, 0x10 ; TODO Is this needed?
172+
mov ax, 0x10 ; TODO Is this needed?
173173
mov ds, ax ; Clear the legacy segment registers
174174
mov es, ax
175175
mov ss, ax
176176
mov fs, ax
177177
mov gs, ax
178178

179-
; Reset the stack. Each CPU gets a 1024-byte unique stack location
180-
mov rsi, [p_LocalAPICAddress] ; We would call p_smp_get_id here but the stack is not ...
181-
add rsi, 0x20 ; ... yet defined. It is safer to find the value directly.
182-
lodsd ; Load a 32-bit value. We only want the high 8 bits
183-
shr rax, 24 ; Shift to the right and AL now holds the CPU's APIC ID
184-
shl rax, 10 ; shift left 10 bits for a 1024byte stack
185-
add rax, 0x0000000000090000 ; stacks decrement when you "push", start at 1024 bytes in
186-
mov rsp, rax ; Leave 0x50000-0x9FFFF free so we use that
179+
;; Reset the stack. Each CPU gets a 1024-byte unique stack location.
180+
mov rsi, [p_LocalAPICAddress] ;; We would call p_smp_get_id here but stack
181+
;; is not yet defined. It is safer to find t
182+
;; he value directly.
183+
add rsi, 0x20
184+
lodsd ;; Load a 32-bit value. We only want the high 8 bits.
185+
shr rax, 24 ;; al = CPU APIC ID.
186+
shl rax, 10 ;; Shift left 10 bits for a 1024 byte stack.
187+
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;add rax, 0x00090000
188+
add rax, 0x00050000
189+
mov rsp, rax ;; 0x50000 - 0x9FFFF free so we use that
187190

188-
lgdt [GDTR64] ; Load the GDT
189-
lidt [IDTR64] ; Load the IDT
191+
lgdt [GDTR64] ;; Load the GDT
192+
lidt [IDTR64] ;; Load the IDT
190193

191-
call init_cpu ; Setup CPU
194+
call init_cpu ;; Setup CPU
192195

193-
sti ; Activate interrupts for SMP
196+
sti ;; Activate interrupts for SMP
194197
jmp ap_sleep
195198

196199
align 16
@@ -200,14 +203,6 @@ ap_sleep:
200203
jmp ap_sleep ; just-in-case of an NMI
201204

202205

203-
204-
205-
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
206-
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
207-
208-
209-
210-
211206
;;==============================================================================
212207
;; 32-bit code. Instructions must also be 64 bit compatible. If a 'U' is stored
213208
;; at 0x5FFF then we know it was a UEFI boot and immediately proceed to start64.

build/tsl.sys

0 Bytes
Binary file not shown.

obj/tsl.elf

0 Bytes
Binary file not shown.

obj/tsl.o

0 Bytes
Binary file not shown.

obj/tsl_ap.o

0 Bytes
Binary file not shown.

out/BOOTX64.EFI

0 Bytes
Binary file not shown.

out/payload.sys

0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)