kernel: Initialize dirty and time flags of bb
authorRoberto E. Vargas Caballero <k0ga@shike2.com>
Mon, 26 Feb 2018 18:54:35 +0000 (18:54 +0000)
committerRoberto E. Vargas Caballero <k0ga@shike2.com>
Mon, 26 Feb 2018 23:02:38 +0000 (23:02 +0000)
The buffer cache is not located in bss in some configurations,
and it means that the memory is not initialized when the system
boots. When emulators allocate the memory, it is initialized
to 0 by the operating system, but it doesn't happen in actual
hardware.

Kernel/start.c

index c1ee259..4d69898 100644 (file)
@@ -45,6 +45,8 @@ void bufinit(void)
        for (bp = bufpool; bp < bufpool_end; ++bp) {
                bp->bf_dev = NO_DEVICE;
                bp->bf_busy = BF_FREE;
+               bp->bf_dirty = 0;
+               bp->bf_time = 0;
        }
 }