From: zhaoyanbai Date: Fri, 10 May 2024 14:01:50 +0000 (+0800) Subject: 修复未正确初始化8253的问题 X-Git-Url: http://repos.zhaoyanbai.com/?a=commitdiff_plain;h=30fd04a6cd61577f5dea43e37b0c6fe3b568155f;p=kernel.git 修复未正确初始化8253的问题 --- diff --git a/kernel/clock.c b/kernel/clock.c index 0bcd146..6c7ac63 100644 --- a/kernel/clock.c +++ b/kernel/clock.c @@ -81,7 +81,7 @@ void setup_i8253(uint16_t hz) { const uint8_t read_write_latch = 3; // 0 锁存数据供CPU读;1只读写低字节;2只读写高字节;3先读写低字节,后读写高字节 const uint8_t mode = 2; // - const uint8_t cmd = (counter_no << 6) | (read_write_latch << 4) || (mode << 1); // 第0位为0表示二进制,为1表示BCD + const uint8_t cmd = (counter_no << 6) | (read_write_latch << 4) | (mode << 1); // 第0位为0表示二进制,为1表示BCD const uint8_t i8253_cmd_port = 0x43; const uint8_t i8253_data_port = 0x40 + counter_no;