1+ %include "fuzzy/memmgr/layout.asm"
2+
13[BITS 32]
24
35global irq0_pit_handler_low
@@ -25,7 +27,7 @@ global create_infant_process_irq0_stack
2527 mov esi , esp
2628
2729 ; new stack and segment area
28- mov esp , 0xFFF0 ; keep offset in sync with process_create(...) and create_infant_process_irq0_stack
30+ mov esp , STACKINIT_KERNEL_EVENT
2931 mov eax , 0x10
3032 mov ss , eax
3133 mov ds , eax
@@ -82,6 +84,8 @@ global create_infant_process_irq0_stack
8284 iret
8385
8486 create_infant_process_irq0_stack:
87+ ; keep in sync with _int_irq0_start
88+ ; return the esp for user stack
8589 push ebp
8690 mov ebp , esp
8791
@@ -95,9 +99,8 @@ global create_infant_process_irq0_stack
9599
96100 mov ds , ecx
97101
98- ; user stack creation start
99102 ; user initial stack
100- mov eax , 0xFFF0 ; keep in sync with _int_irq0_start
103+ mov eax , STACKINIT_APP
101104 ; kernel offset
102105 xor ecx , ecx
103106 mov [ eax - 0 ], ecx ; user: eflag
@@ -116,9 +119,7 @@ global create_infant_process_irq0_stack
116119 mov [ eax - 52 ], ecx ; user: fs
117120 mov [ eax - 56 ], ecx ; user: gs
118121
119- ; user: esp = eax-56 = 0xFFF0-56
120- ; should be compatible with process_create
121- ; user stack creation end
122+ sub eax , 56 ; user stack pointer
122123
123124 pop ds
124125
0 commit comments