Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion asm.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
1 change: 0 additions & 1 deletion bootasm.S
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
8 changes: 0 additions & 8 deletions elf.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 0 additions & 2 deletions main.c
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
#include "types.h"
#include "x86.h"

extern char end[]; // first address after kernel loaded from ELF file

int
halt(void)
{
Expand Down
5 changes: 1 addition & 4 deletions mmu.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
#define SEG_KDATA 2 // kernel data+stack
2 changes: 0 additions & 2 deletions param.h
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
#define KSTACKSIZE 4096 // size of per-process kernel stack
#define NCPU 8 // maximum number of CPUs

18 changes: 0 additions & 18 deletions x86.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand All @@ -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");
}