diff --git a/asm.h b/asm.h index b8a7353..49eab70 100644 --- a/asm.h +++ b/asm.h @@ -14,5 +14,5 @@ (0xC0 | (((lim) >> 28) & 0xf)), (((base) >> 24) & 0xff) #define STA_X 0x8 // Executable segment -#define STA_W 0x2 // Writeable (non-executable segments) +#define STA_W 0x2 // Writable (non-executable segments) #define STA_R 0x2 // Readable (executable segments) diff --git a/bootasm.S b/bootasm.S index 8d394aa..7feb21b 100644 --- a/bootasm.S +++ b/bootasm.S @@ -43,7 +43,6 @@ seta20.2: orl $CR0_PE, %eax movl %eax, %cr0 -//PAGEBREAK! # Complete the transition to 32-bit protected mode by using a long jmp # to reload %cs and %eip. The segment descriptors are set up with no # translation, so that the mapping is still the identity mapping. diff --git a/elf.h b/elf.h index d16c967..f65f744 100644 --- a/elf.h +++ b/elf.h @@ -32,11 +32,3 @@ struct proghdr { uint flags; uint align; }; - -// Values for Proghdr type -#define ELF_PROG_LOAD 1 - -// Flag bits for Proghdr flags -#define ELF_PROG_FLAG_EXEC 1 -#define ELF_PROG_FLAG_WRITE 2 -#define ELF_PROG_FLAG_READ 4 diff --git a/main.c b/main.c index 808545d..fc54b83 100644 --- a/main.c +++ b/main.c @@ -1,8 +1,6 @@ #include "types.h" #include "x86.h" -extern char end[]; // first address after kernel loaded from ELF file - int halt(void) { diff --git a/mmu.h b/mmu.h index bcf3fe0..d5113b3 100644 --- a/mmu.h +++ b/mmu.h @@ -6,7 +6,4 @@ // various segment selectors. #define SEG_KCODE 1 // kernel code -#define SEG_KDATA 2 // kernel data+stack -#define SEG_UCODE 3 // user code -#define SEG_UDATA 4 // user data+stack -#define SEG_TSS 5 // this process's task state \ No newline at end of file +#define SEG_KDATA 2 // kernel data+stack \ No newline at end of file diff --git a/param.h b/param.h index 3b66684..f756028 100644 --- a/param.h +++ b/param.h @@ -1,3 +1 @@ #define KSTACKSIZE 4096 // size of per-process kernel stack -#define NCPU 8 // maximum number of CPUs - diff --git a/x86.h b/x86.h index 9b2984f..765ee17 100644 --- a/x86.h +++ b/x86.h @@ -30,15 +30,6 @@ outw(ushort port, ushort data) asm volatile("out %0,%1" : : "a" (data), "d" (port)); } -static inline void -outsl(int port, const void *addr, int cnt) -{ - asm volatile("cld; rep outsl" : - "=S" (addr), "=c" (cnt) : - "d" (port), "0" (addr), "1" (cnt) : - "cc"); -} - static inline void stosb(void *addr, int data, int cnt) { @@ -47,12 +38,3 @@ stosb(void *addr, int data, int cnt) "0" (addr), "1" (cnt), "a" (data) : "memory", "cc"); } - -static inline void -stosl(void *addr, int data, int cnt) -{ - asm volatile("cld; rep stosl" : - "=D" (addr), "=c" (cnt) : - "0" (addr), "1" (cnt), "a" (data) : - "memory", "cc"); -} \ No newline at end of file