Skip to content
This repository was archived by the owner on Jan 14, 2026. It is now read-only.

Commit 6b47699

Browse files
committed
bbbbb
1 parent 945ff78 commit 6b47699

15 files changed

Lines changed: 44 additions & 2291 deletions

File tree

Makefile

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,9 @@ CFLAGS = -O2 -Wimplicit-function-declaration -Wunused-but-set-variable -ffre
2525
LDFLAGS = -m elf_x86_64 -z max-page-size=0x1000
2626

2727
NFLAGS = -f bin
28-
QEMU_FLAGS = -serial stdio -display none -monitor none -device qemu-xhci,id=xhci \
29-
-device usb-kbd,bus=xhci.0 \
28+
QEMU_FLAGS = -serial stdio -display none -monitor none \
3029
-bios /usr/share/ovmf/OVMF.fd -d int,guest_errors -D qemu.log --no-reboot
31-
QEMU_VGA = -device qemu-xhci,id=xhci -device usb-kbd,bus=xhci.0
30+
QEMU_VGA =
3231
CONSOLE = -display curses
3332

3433
SOURCES = $(shell find $(SRC_KERNEL) -name "*.c")
@@ -109,15 +108,18 @@ $(EXT2_IMG): $(KERNEL)
109108
@echo "ext2 image created: $(EXT2_IMG)"
110109

111110
run: $(ESP_IMG) $(EXT2_IMG)
112-
$(QEMU) $(QEMU_FLAGS) --drive file=$(ESP_IMG),format=raw -drive file=$(EXT2_IMG),format=raw,if=ide $(QEMU_USB)
111+
$(QEMU) $(QEMU_FLAGS) --drive file=$(ESP_IMG),format=raw -drive file=$(EXT2_IMG),format=raw,if=ide
113112

114113
run-console: $(ESP_IMG) $(EXT2_IMG)
115-
$(QEMU) -bios /usr/share/ovmf/OVMF.fd $(CONSOLE) $(QEMU_USB) -drive file=$(ESP_IMG),format=raw -drive file=$(EXT2_IMG),format=raw,if=ide
114+
$(QEMU) -bios /usr/share/ovmf/OVMF.fd $(CONSOLE)-drive file=$(ESP_IMG),format=raw -drive file=$(EXT2_IMG),format=raw,if=ide
116115

117116
run-vga: $(ESP_IMG) $(EXT2_IMG)
118117
$(QEMU) -bios /usr/share/ovmf/OVMF.fd $(QEMU_VGA) -drive file=$(ESP_IMG),format=raw -drive file=$(EXT2_IMG),format=raw,if=ide -d int -D qemu.log --no-reboot -monitor stdio
119118

120-
clean:
119+
clean-all:
121120
rm -rf $(OUT_DIR) $(ESP_DIR)
122121
cd $(EDK2_DIR) && rm -rf bin/boot
123122
rm -f $(EXT2_IMG)
123+
124+
clean:
125+
rm -rf $(OUT_DIR)

src/kernel/device/keyboard.c

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@
55
#include <stdbool.h>
66
#include <interrupt/irq.h>
77

8-
#ifdef UEFI_MODE
9-
#include <driver/usb/usb_keyboard.h>
10-
#endif
118

129
#define KEY_BUFFER_SIZE 256
1310
static char key_buffer[KEY_BUFFER_SIZE];
@@ -160,16 +157,9 @@ static void kbd_process(uint32_t sc_payload, void *ctx) {
160157
* @brief キーボードドライバを初期化
161158
*/
162159
void keyboard_init(void) {
163-
#ifdef UEFI_MODE
164-
// UEFI環境ではUSBキーボードを優先
165-
if (usb_keyboard_init() == 0) {
166-
// USB初期化成功(メッセージはusb_keyboard.cで出力済み)
167-
printk("PS/2 Keyboard available as fallback\n");
168-
} else {
169-
printk("USB Keyboard not available, using PS/2\n");
170-
}
160+
#ifdef INIT_MSG
161+
printk("PS/2 Keyboard initialized\n");
171162
#endif
172-
173163
// 同期側の処理ハンドラを登録 (FIFOイベントの処理)
174164
// IRQ 1 = ベクタ 33
175165
interrupt_register(33, kbd_process, NULL);
@@ -179,15 +169,7 @@ void keyboard_init(void) {
179169
}
180170

181171
void keyboard_poll(void) {
182-
#ifdef UEFI_MODE
183-
// USBキーボードを優先してポーリング
184-
if (usb_keyboard_available()) {
185-
char c;
186-
while ((c = usb_keyboard_getc()) != 0) {
187-
buffer_put(c);
188-
}
189-
}
190-
#endif
172+
// USBは無効化されているためPS/2のみを扱う
191173

192174
// PS/2キーボードをポーリング
193175
kbd_isr(0, NULL);

src/kernel/driver/usb/hid.h

Lines changed: 0 additions & 40 deletions
This file was deleted.

src/kernel/driver/usb/usb.h

Lines changed: 0 additions & 126 deletions
This file was deleted.

0 commit comments

Comments
 (0)