# 禁用控制流保护: Control-Flow Enforcement Technology (CET)
CFLAGS += -fcf-protection=none
CFLAGS += -DNR_TTYS=3
-CFLAGS += -DFIX_SYSENTER_ESP_MODE=1
+CFLAGS += -DFIXED_SYSENTER_ESP_MODE=1
CFLAGS += -DENABLE_BOOT_WAIT=0
SYSTEMMAP = System.map
--- /dev/null
+/*
+ * ------------------------------------------------------------------------
+ * File Name: buffer.h
+ * Author: Zhao Yanbai
+ * 2023-10-11 23:47:15 Wednesday CST
+ * Description: none
+ * ------------------------------------------------------------------------
+ */
+
+#pragma once
* Description: none
* ------------------------------------------------------------------------
*/
+
+typedef struct buffer {
+ //
+} buffer_t;
+
+void init_buffer() {}
root_task.cr3 = va2pa((unsigned long)(init_pgd));
tss.esp0 = root_task.esp0;
-#if FIX_SYSENTER_ESP_MODE
+#if FIXED_SYSENTER_ESP_MODE
// do nothing
#else
wrmsr(MSR_SYSENTER_ESP, root_task.esp0, 0);
void switch_to() {
LoadCR3(current->cr3);
tss.esp0 = current->esp0;
-#if FIX_SYSENTER_ESP_MODE
+#if FIXED_SYSENTER_ESP_MODE
// do nothing
#else
wrmsr(MSR_SYSENTER_ESP, current->esp0, 0);
void setup_kernel() {
printk("sysenter esp mode: %s\n",
-#if FIX_SYSENTER_ESP_MODE
+#if FIXED_SYSENTER_ESP_MODE
"fixed to &tss.esp0"
#else
"use task union stack"
void setup_sysc() {
wrmsr(MSR_SYSENTER_CS, SELECTOR_KRNL_CS, 0);
wrmsr(MSR_SYSENTER_EIP, syscall_entry, 0);
-#if FIX_SYSENTER_ESP_MODE
+#if FIXED_SYSENTER_ESP_MODE
wrmsr(MSR_SYSENTER_ESP, &(tss.esp0), 0);
#endif
init_sysc_handler_table();