From: acevest Date: Fri, 10 May 2024 14:01:50 +0000 (+0800) Subject: 修复未正确初始化8253的问题 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/Bv9ARM.ch08.html?a=commitdiff_plain;h=52eb50383a52f76f0d70d5df5bea27a528aceeb2;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;