From a66d70e09a7936194f7edb50d7f11432274101d6 Mon Sep 17 00:00:00 2001 From: Douglas Thain Date: Fri, 15 Dec 2023 15:12:30 -0500 Subject: [PATCH] Fix Makefile --- Makefile | 4 ++-- user/sysstat.c | 13 ++++++++++++- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 6a1cca9f..6a667997 100644 --- a/Makefile +++ b/Makefile @@ -7,9 +7,9 @@ USER_PROGRAMS=$(USER_SOURCES:c=exe) KERNEL_SOURCES=$(wildcard kernel/*.[chS]) WORDS=/usr/share/dict/words -.PHONY: build-kernel build-library build-userspace build-iso +.PHONY: build-kernel build-library build-userspace build-cdrom-image -all: build-iso +all: build-cdrom-image build-kernel: kernel/basekernel.img diff --git a/user/sysstat.c b/user/sysstat.c index cf6abfe7..385da0d9 100644 --- a/user/sysstat.c +++ b/user/sysstat.c @@ -6,13 +6,24 @@ See the file LICENSE for details. #include "library/syscalls.h" #include "library/string.h" +#include "library/stdio.h" + +struct system_stats s = {0}; int main(int argc, char *argv[]) { - struct system_stats s = {0}; + printf("a"); + flush(); + + printf("b"); + flush(); + if (syscall_system_stats(&s)) { return 1; } + printf("c"); + flush(); + printf("System uptime: %u:%u:%u\n", s.time / (3600), (s.time % 3600) / 60, s.time % 60); printf("Disk 0: %d blocks read, %d blocks written\n", s.blocks_read[0], s.blocks_written[0]);