[go: nahoru, domu]

Skip to content

Commit

Permalink
fix cmos bcd to bin convertion for field hour. Specify qemu rtc settings
Browse files Browse the repository at this point in the history
  • Loading branch information
PauloMigAlmeida committed Dec 17, 2021
1 parent 166d2d7 commit 872340b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ raw-disk:
qemu-debug:
@$(QEMU) -qmp tcp:localhost:4444,server,nowait \
-gdb tcp::8864 -drive format=raw,file=$(OUTPUT_RAW_DISK) \
-rtc base=localtime \
-S -d guest_errors -d int -no-reboot -no-shutdown
@# Help: Runs QEMU in debug mode so that we can debug the bootloader

Expand All @@ -49,6 +50,7 @@ gdb-debug:
.PHONY: test
test:
@$(QEMU) -drive format=raw,file=$(OUTPUT_RAW_DISK) \
-rtc base=localtime \
-d guest_errors \
-no-reboot \
-no-shutdown \
Expand Down
2 changes: 1 addition & 1 deletion src/kernel/arch/cmos.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ cmos_clock_t cmos_read_rtc(void) {
if (!bin_mod_set) {
ret.second = BCD_TO_BIN(ret.second);
ret.minute = BCD_TO_BIN(ret.minute);
ret.hour = BCD_TO_BIN(ret.hour);
ret.hour = (BCD_TO_BIN(ret.hour) | (ret.hour & CMOS_HOUR_PM_MASK));
ret.day = BCD_TO_BIN(ret.day);
ret.month = BCD_TO_BIN(ret.month);
ret.year = BCD_TO_BIN(ret.year);
Expand Down

0 comments on commit 872340b

Please sign in to comment.