Skip to content

Commit 26dd761

Browse files
committed
BugFix; New process should start with interrupts enabled
1 parent 67c2923 commit 26dd761

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

src/kernel/core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,6 @@ void kernel_core_entry() {
5555
int init_pid = spawnl(INIT_APPNAME, INIT_APPNAME, NULL);
5656
print_log("init process got created: %d", init_pid);
5757

58-
// interrupt_pit_enable();
58+
interrupt_pit_enable();
5959
while (1);
6060
}

src/kernel/interrupts/timer.asm

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,10 @@ global create_infant_process_irq0_stack
103103

104104
; kernel offset
105105
xor ecx, ecx
106+
107+
xor ecx, 1<<9 ; enable interrupt
106108
mov [eax-0], ecx ; user: eflag
109+
107110
; do_not_care: next two cs, ip
108111
; CS and IP doesn't matter, as they are controlled by _int_irq0_end
109112

src/usr/lib/process.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ int spawnv(char *file_path, char *argv[]) {
4040
int _spawnv_syscall(char *file_path, char *argv[]) {
4141
// kernel expects argv size must be PROCESS_MAX_ARGC
4242
int pid = SYSCALL_A3(SYSCALL_PROCESS, SYSCALL_PROCESS_SUB_SPAWN_FNAME, file_path, argv);
43-
if(pid>=0) yield();
4443
return pid;
4544
}
4645

0 commit comments

Comments
 (0)