diff --git a/Makefile b/Makefile index 0f687a6..1d12793 100644 --- a/Makefile +++ b/Makefile @@ -82,7 +82,7 @@ clean: find . -type f -name '*.[od(elf)]' -exec rm -f {} + format: - find . -type f -name '*.[ch]' -exec clang-format -i {} + + find kern -type f -name '*.[ch]' -exec clang-format -i {} \; TOOLCHAIN_DIR := toolchain diff --git a/README.md b/README.md index c2a1e05..cc20fbe 100644 --- a/README.md +++ b/README.md @@ -75,6 +75,9 @@ make distclean # Wipes the above, but also removes toolchain | `mip` | Machine Interrupt Pending | Machine | Indicates pending interrupts. | | `mie` | Machine Interrupt Enable | Machine | Controls which interrupts are enabled. | +### TODO +- Kassert, some macro in the form of `ASSERT(condition, "This went wrong")` + ### Libc Implementations [uClibc](https://uclibc.org/) diff --git a/kern/kalloc.c b/kern/kalloc.c index 88238ee..dead607 100644 --- a/kern/kalloc.c +++ b/kern/kalloc.c @@ -46,6 +46,7 @@ void kfree(void *pa) { if (((u64)pa % PGSIZE) != 0 || (char *)pa < kernel_end || (u64)pa >= PHYSTOP) PANIC("kfree"); + // TODO: Kconfig this // Fill with junk to catch dangling refs. memset(pa, 1, PGSIZE); diff --git a/kern/libkern/stddef.h b/kern/libkern/stddef.h index ab8a2b5..0d70dea 100644 --- a/kern/libkern/stddef.h +++ b/kern/libkern/stddef.h @@ -2,8 +2,7 @@ #define STDDEF_H #ifndef NULL -#define NULL ((void*)0) +#define NULL ((void *)0) #endif #endif // STDDEF_H - diff --git a/kern/libkern/stdio.c b/kern/libkern/stdio.c index 61b740a..c50a0d6 100644 --- a/kern/libkern/stdio.c +++ b/kern/libkern/stdio.c @@ -22,7 +22,7 @@ static int stdout_puts(char *s, int len, void *unused) { int kprintf(const char *restrict fmt, ...) { va_list ap; va_start(ap, fmt); - int ret = kvprintf(fmt, &ap); + int ret = kvprintf(fmt, ap); va_end(ap); return ret; }