1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 21:08:12 +00:00
serenity/Kernel
Nico Weber 19a8aa72d2 Kernel: Fix reading RTC
The CMOS sets bit 2 (0x4) if times are binary, if it's not
set they're in BCD.

The CMOS sets bit 1 (0x1) if hours are on a 12 hour clock.
In that case, the highest bit in the hour byte is set for
PM times (both in binary and BCD times).

Three bugs:

1. The lower 7 bits were masked off incorrectly when calling
   bcd_to_binary(). Use 0x7F as mask, not 0x70.

2. The highest bit to check if a time was PM was checked after
   BCD conversion of the low 7 bits, which clobbered that bit.
   Do the check before BCD conversion.

3. In the 12 hour clock, midnight and noon are "12", so those
   need to be converted to 0 even if for non-PM times (else
   midnight is "12", not "0").

With this, SerenityOS consistently shows UTC as the current time,
as it should.

If folks want it to display local time instead, they can get this
by adding `-rtc base=localtime` to Meta/run.sh -- but a better fix
would be to add timezone management and convert from UTC system
clock to the user timezone at display time.
2020-08-21 20:57:52 +02:00
..
ACPI Kernel: Add SMP IPI support 2020-07-06 17:07:44 +02:00
API Kernel: Use Userspace<T> for the recvfrom syscall, and Socket implementation 2020-08-19 21:05:28 +02:00
Arch Kernel: Remove unneeded #include in ProcessorInfo.cpp (#3211) 2020-08-19 11:25:12 +02:00
Devices Kernel: Switch singletons to use new Singleton class 2020-08-21 11:47:35 +02:00
FileSystem Kernel: Switch singletons to use new Singleton class 2020-08-21 11:47:35 +02:00
Heap AK: Rename KB, MB, GB to KiB, MiB, GiB 2020-08-16 16:33:28 +02:00
Interrupts Kernel: Switch singletons to use new Singleton class 2020-08-21 11:47:35 +02:00
Modules Kernel: Module symbol declarations for type-checking 2020-08-12 20:40:59 +02:00
Net Kernel: Switch singletons to use new Singleton class 2020-08-21 11:47:35 +02:00
PCI Kernel: Add SMP IPI support 2020-07-06 17:07:44 +02:00
Syscalls Kernel: Distinguish between new and old process groups with equal pgids 2020-08-19 21:21:34 +02:00
Tasks Kernel: Require a reason to be passed to Thread::wait_on 2020-07-06 10:00:24 +02:00
Time Kernel: Switch singletons to use new Singleton class 2020-08-21 11:47:35 +02:00
TTY Kernel: Switch singletons to use new Singleton class 2020-08-21 11:47:35 +02:00
VM Kernel: Fix assertion when releasing contiguous memory region 2020-08-21 12:03:20 +02:00
.gitignore Meta: Removed all gitignore in the source tree only keeping the root one 2019-06-30 10:41:26 +02:00
Assertions.h Kernel: List all CPUs in /proc/cpuinfo 2020-07-01 12:07:01 +02:00
CMakeLists.txt Kernel: Distinguish between new and old process groups with equal pgids 2020-08-19 21:21:34 +02:00
CMOS.cpp Kernel: Absorb LibBareMetal back into the kernel 2020-05-16 12:00:04 +02:00
CMOS.h Meta: Add license header to source files 2020-01-18 09:45:54 +01:00
CommandLine.cpp Kernel: Remove CommandLine::get() in favor of lookup() 2020-04-18 14:22:42 +02:00
CommandLine.h Kernel: Remove CommandLine::get() in favor of lookup() 2020-04-18 14:22:42 +02:00
Console.cpp Kernel: Switch singletons to use new Singleton class 2020-08-21 11:47:35 +02:00
Console.h Kernel: Switch singletons to use new Singleton class 2020-08-21 11:47:35 +02:00
DoubleBuffer.cpp Kernel: Make File::write() and File::read() return KResultOr<size_t> 2020-08-04 18:17:16 +02:00
DoubleBuffer.h Kernel: Make File::write() and File::read() return KResultOr<size_t> 2020-08-04 18:17:16 +02:00
Forward.h Kernel: Prevent recursive calls into the scheduler 2020-08-02 17:15:11 +02:00
init.cpp Kernel: Switch singletons to use new Singleton class 2020-08-21 11:47:35 +02:00
IO.h Kernel: Absorb LibBareMetal back into the kernel 2020-05-16 12:00:04 +02:00
KBuffer.h Kernel: Make Inode::read_entire() return a KBuffer (not ByteBuffer) 2020-08-11 20:29:14 +02:00
KBufferBuilder.cpp AK: Rename KB, MB, GB to KiB, MiB, GiB 2020-08-16 16:33:28 +02:00
KBufferBuilder.h Kernel: Move all code into the Kernel namespace 2020-02-16 01:27:42 +01:00
kprintf.cpp Kernel: Mark compilation-unit-only functions as static 2020-08-12 20:40:59 +02:00
KResult.h Kernel: Decorate KResult and KResultOr<T> methods with [[nodiscard]] 2020-08-09 00:13:39 +02:00
kstdio.h LibELF+Lagom: Work towards getting LibELF in Lagom 2020-08-09 21:12:54 +02:00
KSyms.cpp Kernel: Mark compilation-unit-only functions as static 2020-08-12 20:40:59 +02:00
KSyms.h Kernel: Update cryptically-named functions related to symbolication 2020-04-08 17:19:46 +02:00
linker.ld Kernel: Invoke heap constructors separately early on 2020-08-10 20:05:18 +02:00
Lock.cpp Kernel: Add SMP IPI support 2020-07-06 17:07:44 +02:00
Lock.h AK: Add ALWAYS_INLINE, NEVER_INLINE and FLATTEN macros 2020-04-30 11:43:25 +02:00
mkmap.sh Build: Switch to CMake :^) 2020-05-14 20:15:18 +02:00
Module.h Kernel: Move all code into the Kernel namespace 2020-02-16 01:27:42 +01:00
Multiboot.h Meta: Add license header to source files 2020-01-18 09:45:54 +01:00
PerformanceEventBuffer.cpp Kernel: Don't use copy_from_user() for kernelspace read in perf events 2020-08-17 09:57:18 +02:00
PerformanceEventBuffer.h Kernel: PID/TID typing 2020-08-10 11:51:45 +02:00
PhysicalAddress.h Kernel: Absorb LibBareMetal back into the kernel 2020-05-16 12:00:04 +02:00
Process.cpp Kernel: Distinguish between new and old process groups with equal pgids 2020-08-19 21:21:34 +02:00
Process.h Kernel: Distinguish between new and old process groups with equal pgids 2020-08-19 21:21:34 +02:00
ProcessGroup.cpp Kernel: Distinguish between new and old process groups with equal pgids 2020-08-19 21:21:34 +02:00
ProcessGroup.h Kernel: Distinguish between new and old process groups with equal pgids 2020-08-19 21:21:34 +02:00
Profiling.cpp AK: Rename KB, MB, GB to KiB, MiB, GiB 2020-08-16 16:33:28 +02:00
Profiling.h Kernel: More PID/TID typing 2020-08-10 11:51:45 +02:00
Ptrace.cpp Kernel: More PID/TID typing 2020-08-10 11:51:45 +02:00
Ptrace.h Kernel: Move headers intended for userspace use into Kernel/API/ 2020-07-04 17:22:23 +02:00
Random.cpp Kernel: Switch singletons to use new Singleton class 2020-08-21 11:47:35 +02:00
Random.h Kernel: Switch singletons to use new Singleton class 2020-08-21 11:47:35 +02:00
RTC.cpp Kernel: Fix reading RTC 2020-08-21 20:57:52 +02:00
RTC.h Meta: Add license header to source files 2020-01-18 09:45:54 +01:00
Scheduler.cpp Kernel: Always return from Thread::wait_on 2020-08-11 14:54:36 +02:00
Scheduler.h Kernel: Fix a few Thread::block related races 2020-08-03 15:59:11 +02:00
SharedBuffer.cpp Kernel: Switch singletons to use new Singleton class 2020-08-21 11:47:35 +02:00
SharedBuffer.h Kernel: PID/TID typing 2020-08-10 11:51:45 +02:00
Singleton.h Kernel: Add an atomic Singleton class 2020-08-21 11:47:35 +02:00
SpinLock.h Kernel: Do not wait before first attempt at locking SpinLock (#3212) 2020-08-19 11:10:53 +02:00
StdLib.cpp AK+LibC+Kernel: Move the implementation of memmem to AK 2020-08-21 16:00:42 +02:00
StdLib.h Kernel: Remove strncpy() and strrchr() 2020-08-17 00:00:46 +02:00
Syscall.cpp Kernel: Request random numbers for syscall stack noise in larger chunks (#3125) 2020-08-13 21:05:08 +02:00
Thread.cpp Kernel: Pack arguments, environment and auxiliary values better 2020-08-20 16:34:44 +02:00
Thread.h Kernel: Remove an unimplemented function (#3210) 2020-08-19 11:24:40 +02:00
ThreadTracer.cpp Kernel: PID/TID typing 2020-08-10 11:51:45 +02:00
ThreadTracer.h Kernel: PID/TID typing 2020-08-10 11:51:45 +02:00
TimerQueue.cpp Kernel: Switch singletons to use new Singleton class 2020-08-21 11:47:35 +02:00
TimerQueue.h Kernel: Switch singletons to use new Singleton class 2020-08-21 11:47:35 +02:00
UnixTypes.h Kernel: PID/TID typing 2020-08-10 11:51:45 +02:00
VirtualAddress.h Kernel: Absorb LibBareMetal back into the kernel 2020-05-16 12:00:04 +02:00
WaitQueue.cpp Kernel: Dequeue dying threads from WaitQueue 2020-08-06 10:02:55 +02:00
WaitQueue.h Kernel: Dequeue dying threads from WaitQueue 2020-08-06 10:02:55 +02:00