将usb的初始化交由init进程进行处理

This commit is contained in:
fslongjin 2022-07-18 21:19:34 +08:00
parent aa3f433cd5
commit 16d6b94c46
3 changed files with 8 additions and 2 deletions

View File

@ -108,7 +108,8 @@
"ahci.h": "c", "ahci.h": "c",
"slab.h": "c", "slab.h": "c",
"boot_info.h": "c", "boot_info.h": "c",
"pci.h": "c" "pci.h": "c",
"time.h": "c"
}, },
"C_Cpp.errorSquiggles": "Enabled", "C_Cpp.errorSquiggles": "Enabled",
"esbonio.sphinx.confDir": "" "esbonio.sphinx.confDir": ""

View File

@ -153,9 +153,10 @@ void system_initialize()
// fat32_init(); // fat32_init();
HPET_enable(); HPET_enable();
usb_init();
// 系统初始化到此结束,剩下的初始化功能应当放在初始内核线程中执行 // 系统初始化到此结束,剩下的初始化功能应当放在初始内核线程中执行
apic_timer_init(); apic_timer_init();
} }
//操作系统内核从这里开始执行 //操作系统内核从这里开始执行

View File

@ -6,6 +6,7 @@
#include <common/compiler.h> #include <common/compiler.h>
#include <common/libELF/elf.h> #include <common/libELF/elf.h>
#include <driver/video/video.h> #include <driver/video/video.h>
#include <driver/usb/usb.h>
#include <exception/gate.h> #include <exception/gate.h>
#include <filesystem/fat32/fat32.h> #include <filesystem/fat32/fat32.h>
#include <mm/slab.h> #include <mm/slab.h>
@ -410,7 +411,10 @@ ul initial_kernel_thread(ul arg)
// kinfo("initial proc running...\targ:%#018lx", arg); // kinfo("initial proc running...\targ:%#018lx", arg);
fat32_init(); fat32_init();
usb_init();
// 准备切换到用户态
struct pt_regs *regs; struct pt_regs *regs;
current_pcb->thread->rip = (ul)ret_from_system_call; current_pcb->thread->rip = (ul)ret_from_system_call;