diff --git a/config.h b/config.h index e0fa918..8ddcbf4 100644 --- a/config.h +++ b/config.h @@ -1,5 +1,3 @@ -#ifndef KERNEL_CONFIG_H -#define KERNEL_CONFIG_H /* * Number of CPU's For now, this is hard-coded here. It will likely be * dynamically discovered in the future. @@ -8,4 +6,3 @@ /* Maximum number of files open */ #define NOFILE 10 -#endif // KERNEL_CONFIG_H diff --git a/kern/banner.h b/kern/banner.h index 1d869da..b6f5d56 100644 --- a/kern/banner.h +++ b/kern/banner.h @@ -1,36 +1,48 @@ -#ifndef BANNER_H -#define BANNER_H - unsigned char banner[] = { - 0x1b, 0x5b, 0x33, 0x38, 0x3b, 0x35, 0x3b, 0x31, 0x38, 0x34, 0x6d, 0x20, 0x5f, 0x20, 0x20, 0x20, 0x5f, 0x20, 0x20, - 0x20, 0x1b, 0x5b, 0x33, 0x38, 0x3b, 0x35, 0x3b, 0x31, 0x37, 0x38, 0x6d, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, - 0x20, 0x20, 0x5f, 0x1b, 0x5b, 0x33, 0x38, 0x3b, 0x35, 0x3b, 0x32, 0x31, 0x34, 0x6d, 0x20, 0x20, 0x20, 0x20, 0x20, - 0x20, 0x20, 0x20, 0x20, 0x20, 0x1b, 0x5b, 0x33, 0x38, 0x3b, 0x35, 0x3b, 0x32, 0x30, 0x38, 0x6d, 0x20, 0x20, 0x20, - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x1b, 0x5b, 0x30, 0x6d, 0x0a, 0x1b, 0x5b, 0x33, 0x38, 0x3b, 0x35, 0x3b, - 0x32, 0x31, 0x34, 0x6d, 0x7c, 0x20, 0x5c, 0x20, 0x7c, 0x20, 0x7c, 0x20, 0x5f, 0x1b, 0x5b, 0x33, 0x38, 0x3b, 0x35, - 0x3b, 0x32, 0x30, 0x38, 0x6d, 0x5f, 0x5f, 0x20, 0x5f, 0x20, 0x5f, 0x5f, 0x20, 0x7c, 0x20, 0x1b, 0x5b, 0x33, 0x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 0x20, 0x20, 0x1b, 0x5b, 0x33, 0x38, 0x3b, 0x35, 0x3b, 0x39, 0x33, 0x6d, 0x20, - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x1b, 0x5b, 0x30, 0x6d, 0x0a, 0x1b, 0x5b, 0x30, 0x6d}; - + 0x1b, 0x5b, 0x33, 0x38, 0x3b, 0x35, 0x3b, 0x31, 0x38, 0x34, 0x6d, 0x20, + 0x5f, 0x20, 0x20, 0x20, 0x5f, 0x20, 0x20, 0x20, 0x1b, 0x5b, 0x33, 0x38, + 0x3b, 0x35, 0x3b, 0x31, 0x37, 0x38, 0x6d, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x5f, 0x1b, 0x5b, 0x33, 0x38, 0x3b, 0x35, 0x3b, + 0x32, 0x31, 0x34, 0x6d, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x1b, 0x5b, 0x33, 0x38, 0x3b, 0x35, 0x3b, 0x32, 0x30, 0x38, + 0x6d, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x1b, + 0x5b, 0x30, 0x6d, 0x0a, 0x1b, 0x5b, 0x33, 0x38, 0x3b, 0x35, 0x3b, 0x32, + 0x31, 0x34, 0x6d, 0x7c, 0x20, 0x5c, 0x20, 0x7c, 0x20, 0x7c, 0x20, 0x5f, + 0x1b, 0x5b, 0x33, 0x38, 0x3b, 0x35, 0x3b, 0x32, 0x30, 0x38, 0x6d, 0x5f, + 0x5f, 0x20, 0x5f, 0x20, 0x5f, 0x5f, 0x20, 0x7c, 0x20, 0x1b, 0x5b, 0x33, + 0x38, 0x3b, 0x35, 0x3b, 0x32, 0x30, 0x39, 0x6d, 0x7c, 0x5f, 0x20, 0x5f, + 0x20, 0x20, 0x20, 0x5f, 0x20, 0x5f, 0x1b, 0x5b, 0x33, 0x38, 0x3b, 0x35, + 0x3b, 0x32, 0x30, 0x33, 0x6d, 0x20, 0x5f, 0x5f, 0x20, 0x20, 0x20, 0x5f, + 0x5f, 0x5f, 0x20, 0x1b, 0x5b, 0x30, 0x6d, 0x0a, 0x1b, 0x5b, 0x33, 0x38, + 0x3b, 0x35, 0x3b, 0x32, 0x30, 0x39, 0x6d, 0x7c, 0x20, 0x20, 0x5c, 0x7c, + 0x20, 0x7c, 0x2f, 0x20, 0x1b, 0x5b, 0x33, 0x38, 0x3b, 0x35, 0x3b, 0x32, + 0x30, 0x33, 0x6d, 0x5f, 0x20, 0x5c, 0x20, 0x27, 0x5f, 0x20, 0x5c, 0x7c, + 0x20, 0x1b, 0x5b, 0x33, 0x38, 0x3b, 0x35, 0x3b, 0x32, 0x30, 0x34, 0x6d, + 0x5f, 0x5f, 0x7c, 0x20, 0x7c, 0x20, 0x7c, 0x20, 0x7c, 0x20, 0x1b, 0x5b, + 0x33, 0x38, 0x3b, 0x35, 0x3b, 0x31, 0x39, 0x38, 0x6d, 0x27, 0x5f, 0x20, + 0x5c, 0x20, 0x2f, 0x20, 0x5f, 0x20, 0x5c, 0x1b, 0x5b, 0x30, 0x6d, 0x0a, + 0x1b, 0x5b, 0x33, 0x38, 0x3b, 0x35, 0x3b, 0x32, 0x30, 0x34, 0x6d, 0x7c, + 0x20, 0x7c, 0x5c, 0x20, 0x20, 0x7c, 0x20, 0x20, 0x1b, 0x5b, 0x33, 0x38, + 0x3b, 0x35, 0x3b, 0x31, 0x39, 0x38, 0x6d, 0x5f, 0x5f, 0x2f, 0x20, 0x7c, + 0x5f, 0x29, 0x20, 0x7c, 0x20, 0x1b, 0x5b, 0x33, 0x38, 0x3b, 0x35, 0x3b, + 0x31, 0x39, 0x39, 0x6d, 0x7c, 0x5f, 0x7c, 0x20, 0x7c, 0x5f, 0x7c, 0x20, + 0x7c, 0x20, 0x1b, 0x5b, 0x33, 0x38, 0x3b, 0x35, 0x3b, 0x31, 0x36, 0x33, + 0x6d, 0x7c, 0x20, 0x7c, 0x20, 0x7c, 0x20, 0x20, 0x5f, 0x5f, 0x2f, 0x1b, + 0x5b, 0x30, 0x6d, 0x0a, 0x1b, 0x5b, 0x33, 0x38, 0x3b, 0x35, 0x3b, 0x31, + 0x39, 0x39, 0x6d, 0x7c, 0x5f, 0x7c, 0x20, 0x5c, 0x5f, 0x7c, 0x5c, 0x5f, + 0x1b, 0x5b, 0x33, 0x38, 0x3b, 0x35, 0x3b, 0x31, 0x36, 0x33, 0x6d, 0x5f, + 0x5f, 0x7c, 0x20, 0x2e, 0x5f, 0x5f, 0x2f, 0x20, 0x5c, 0x1b, 0x5b, 0x33, + 0x38, 0x3b, 0x35, 0x3b, 0x31, 0x36, 0x34, 0x6d, 0x5f, 0x5f, 0x7c, 0x5c, + 0x5f, 0x5f, 0x2c, 0x5f, 0x7c, 0x5f, 0x1b, 0x5b, 0x33, 0x38, 0x3b, 0x35, + 0x3b, 0x31, 0x32, 0x38, 0x6d, 0x7c, 0x20, 0x7c, 0x5f, 0x7c, 0x5c, 0x5f, + 0x5f, 0x5f, 0x7c, 0x1b, 0x5b, 0x30, 0x6d, 0x0a, 0x1b, 0x5b, 0x33, 0x38, + 0x3b, 0x35, 0x3b, 0x31, 0x36, 0x34, 0x6d, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x1b, 0x5b, 0x33, 0x38, 0x3b, 0x35, 0x3b, 0x31, + 0x32, 0x38, 0x6d, 0x20, 0x20, 0x7c, 0x5f, 0x7c, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x1b, 0x5b, 0x33, 0x38, 0x3b, 0x35, 0x3b, 0x31, 0x32, 0x39, 0x6d, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x1b, 0x5b, + 0x33, 0x38, 0x3b, 0x35, 0x3b, 0x39, 0x33, 0x6d, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x1b, 0x5b, 0x30, 0x6d, 0x0a, 0x1b, + 0x5b, 0x30, 0x6d +}; unsigned int banner_len = 531; - -#endif // BANNER_H diff --git a/kern/kalloc.h b/kern/kalloc.h index 592d814..0f13e53 100644 --- a/kern/kalloc.h +++ b/kern/kalloc.h @@ -30,4 +30,4 @@ void kfree(void *); */ void kalloc_init(void); -#endif // KALLOC_KERNEL_H +#endif diff --git a/kern/libkern/memory.h b/kern/libkern/memory.h index c8d7d36..01b275a 100644 --- a/kern/libkern/memory.h +++ b/kern/libkern/memory.h @@ -13,4 +13,4 @@ */ size_t probe_memory(void); -#endif // MEMORY_KARNEL_H +#endif diff --git a/kern/libkern/panic.h b/kern/libkern/panic.h index 4d486e1..53dc283 100644 --- a/kern/libkern/panic.h +++ b/kern/libkern/panic.h @@ -5,4 +5,4 @@ void __panic(const char *restrict fmt, ...); -#endif // KERNEL_PANIC_H +#endif diff --git a/kern/libkern/riscv.h b/kern/libkern/riscv.h index 3e20511..c8abf82 100644 --- a/kern/libkern/riscv.h +++ b/kern/libkern/riscv.h @@ -77,4 +77,4 @@ static inline int intr_get() { return (x & SSTATUS_SIE) != 0; } -#endif // RISCV_KERNEL_H +#endif diff --git a/kern/libkern/spinlock.h b/kern/libkern/spinlock.h index 8f9e506..de6091e 100644 --- a/kern/libkern/spinlock.h +++ b/kern/libkern/spinlock.h @@ -1,5 +1,5 @@ -#ifndef KERNEL_SPINLOCK_H -#define KERNEL_SPINLOCK_H +#ifndef KERNEL_Spinlock_H +#define KERNEL_Spinlock_H #include #include @@ -19,4 +19,4 @@ void spin_unlock(spinlock_t *l); bool spin_is_holding(spinlock_t *l); void spin_lock(spinlock_t *l); -#endif // KERNEL_SPINLOCK_H +#endif diff --git a/kern/libkern/stdarg.h b/kern/libkern/stdarg.h index 5fd001f..1113127 100644 --- a/kern/libkern/stdarg.h +++ b/kern/libkern/stdarg.h @@ -8,4 +8,4 @@ typedef __builtin_va_list va_list; #define va_end(ap) __builtin_va_end(ap) #define va_copy(dest, src) __builtin_va_copy(dest, src) -#endif // _STDARG_H +#endif diff --git a/kern/libkern/stdbool.h b/kern/libkern/stdbool.h index 9d50331..1bab927 100644 --- a/kern/libkern/stdbool.h +++ b/kern/libkern/stdbool.h @@ -5,4 +5,4 @@ typedef char bool; enum { false = 0, true = 1 }; -#endif // _STDBOOL_H +#endif diff --git a/kern/libkern/stdint.h b/kern/libkern/stdint.h index b7cbc0f..095e598 100644 --- a/kern/libkern/stdint.h +++ b/kern/libkern/stdint.h @@ -1,5 +1,4 @@ -#ifndef STDINT_H -#define STDINT_H +#pragma once typedef unsigned char u8; typedef unsigned short u16; @@ -28,5 +27,3 @@ typedef uint64_t uintptr_t; #define UINT16_MAX (65535) #define UINT32_MAX (4294967295U) #define UINT64_MAX (__UINT64_C(18446744073709551615)) - -#endif // STDINT_H diff --git a/kern/libkern/string.h b/kern/libkern/string.h index 62b05fd..d2ff7b5 100644 --- a/kern/libkern/string.h +++ b/kern/libkern/string.h @@ -42,4 +42,4 @@ char *strchr(const char *s, int c); char *strrchr(const char *s, int c); */ -#endif // KERNEL_STRING_H +#endif diff --git a/kern/libkern/uart.h b/kern/libkern/uart.h index 22aeed4..8f08f1a 100644 --- a/kern/libkern/uart.h +++ b/kern/libkern/uart.h @@ -4,4 +4,4 @@ /** Send a single character to the UART device */ void uart_putc(char c); -#endif // UART_KERNEL_H +#endif diff --git a/kern/proc.h b/kern/proc.h index 489876e..ac5a46d 100644 --- a/kern/proc.h +++ b/kern/proc.h @@ -89,4 +89,4 @@ extern Cpu cpus[NCPU]; /** Per-process state */ struct Proc {}; -#endif // PROC_H +#endif