project(xv6)
-#set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fno-pic -static -fno-builtin -fno-strict-aliasing -Wall -MD -ggdb -Werror -fno-omit-frame-pointer -fno-stack-protector")
-set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fno-strict-aliasing -Wall -ggdb -Werror -fno-omit-frame-pointer -fno-stack-protector")
+#set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fno-pic -static -fno-builtin -fno-strict-aliasing -Wall -MD -gstabs+ -Werror -fno-omit-frame-pointer -fno-stack-protector")
+set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fno-strict-aliasing -Wall -gstabs -Werror -fno-omit-frame-pointer -fno-stack-protector")
set(CMAKE_C_FLAGS_RELEASE "-O2 -DNDEBUG")
-set(CMAKE_C_FLAGS_DEBUG "-O0 -ggdb3")
+set(CMAKE_C_FLAGS_DEBUG "-O0 -gstabs")
-set(CMAKE_ASM_FLAGS "${CMAKE_C_FLAGS}")
+set(CMAKE_ASM_FLAGS "${CMAKE_C_FLAGS} -gdwarf-2 -Wa,-divide")
function(add_prefix_suffix var prefix suffix)
set(listVar "")
#ifndef INCLUDE_MMU_h_
#define INCLUDE_MMU_h_
+// Include types.h if this is a c processor, and not an assembly file...
+#ifndef __ASSEMBLER__
+# include "types.h"
+#endif
+
// Eflags register
#define FL_IF 0x00000200 // Interrupt Enable
+#ifndef KERNEL_INCLUDE_MP_h_
+#define KERNEL_INCLUDE_MP_h_
+
// See MultiProcessor Specification Version 1.[14]
struct mp { // floating pointer
//PAGEBREAK!
// Blank page.
+
+#endif // KERNEL_INCLUDE_MP_h_
+#ifndef KERNEL_INCLUDE_PROC_h_
+#define KERNEL_INCLUDE_PROC_h_
+
#include <stdatomic.h>
+#include "param.h"
+
// Per-CPU state
struct cpu {
uchar apicid; // Local APIC ID
// original data and bss
// fixed-size stack
// expandable heap
+
+#endif // KERNEL_INCLUDE_PROC_h_
printint(*argp++, 10, 1);
break;
case 'x':
+ case 'X':
case 'p':
printint(*argp++, 16, 0);
break;