Skip to content

Commit 878fe51

Browse files
committed
Enable process PID reuse in wrap order
1 parent 0d557b8 commit 878fe51

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

src/kernel/core.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ void kernel_core_entry() {
4444

4545
print_log("Kernel enabling interrupts");
4646

47-
kernel_enable_interrupts();
4847
keyboard_init();
4948

5049
process_scheduler_init();
@@ -53,8 +52,9 @@ void kernel_core_entry() {
5352

5453
VERIFY_STACKGUARD();
5554
int init_pid = spawnl(INIT_APPNAME, INIT_APPNAME, NULL);
56-
print_log("init process got created: %d", init_pid);
55+
print_info("init process got created: %d", init_pid);
5756

57+
kernel_enable_interrupts();
5858
interrupt_pit_enable();
5959
while (1);
6060
}

src/kernel/process/allocation.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,6 @@ static int create_infant_process_argv_stack(int user_ds, int user_sp,
127127

128128
static int get_cold_pid_to_allocate() {
129129
static int pid = 0;
130-
pid = 0; // BUG: What PID wrap around doesn't work?
131130
for (int i = 0; i < MAX_PROCESS; ++i) {
132131
pid = (pid+1)%MAX_PROCESS;
133132
if (pid!=PID_KERNEL && processes[pid].state == STATE_COLD) {

0 commit comments

Comments
 (0)