Remove segments from push_all
This commit is contained in:
@@ -4,7 +4,6 @@
|
|||||||
|
|
||||||
struct cpu_state
|
struct cpu_state
|
||||||
{
|
{
|
||||||
uint64_t ds;
|
|
||||||
uint64_t r15, r14, r13, r12, r11, r10, r9, r8;
|
uint64_t r15, r14, r13, r12, r11, r10, r9, r8;
|
||||||
uint64_t rdi, rsi, rbp, rbx, rdx, rcx, rax;
|
uint64_t rdi, rsi, rbp, rbx, rdx, rcx, rax;
|
||||||
uint64_t interrupt, errorcode;
|
uint64_t interrupt, errorcode;
|
||||||
|
|||||||
@@ -34,7 +34,6 @@ print_regs(const cpu_state ®s)
|
|||||||
print_reg("sp0", tss_get_stack(0));
|
print_reg("sp0", tss_get_stack(0));
|
||||||
|
|
||||||
cons->puts("\n");
|
cons->puts("\n");
|
||||||
print_reg(" ds", regs.ds);
|
|
||||||
print_reg(" cs", regs.cs);
|
print_reg(" cs", regs.cs);
|
||||||
print_reg(" ss", regs.ss);
|
print_reg(" ss", regs.ss);
|
||||||
|
|
||||||
|
|||||||
@@ -1,32 +1,31 @@
|
|||||||
%macro push_all_and_segments 0
|
%macro push_all_and_segments 0
|
||||||
push rax
|
; ss ; rsp + a8
|
||||||
push rcx
|
; rsp ; rsp + a0
|
||||||
push rdx
|
; rflags ; rsp + 98
|
||||||
push rbx
|
; cs ; rsp + 90
|
||||||
push rbp
|
; rip ; rsp + 88
|
||||||
push rsi
|
; error ; rsp + 80
|
||||||
push rdi
|
; vector ; rsp + 78
|
||||||
|
|
||||||
push r8
|
push rax ; rsp + 70
|
||||||
push r9
|
push rcx ; rsp + 68
|
||||||
push r10
|
push rdx ; rsp + 60
|
||||||
push r11
|
push rbx ; rsp + 58
|
||||||
push r12
|
push rbp ; rsp + 50
|
||||||
push r13
|
push rsi ; rsp + 48
|
||||||
push r14
|
push rdi ; rsp + 40
|
||||||
push r15
|
|
||||||
|
|
||||||
mov ax, ds
|
push r8 ; rsp + 38
|
||||||
push rax
|
push r9 ; rsp + 30
|
||||||
|
push r10 ; rsp + 28
|
||||||
|
push r11 ; rsp + 20
|
||||||
|
push r12 ; rsp + 18
|
||||||
|
push r13 ; rsp + 10
|
||||||
|
push r14 ; rsp + 08
|
||||||
|
push r15 ; rsp + 00
|
||||||
%endmacro
|
%endmacro
|
||||||
|
|
||||||
%macro pop_all_and_segments 0
|
%macro pop_all_and_segments 0
|
||||||
pop rax
|
|
||||||
mov ds, ax
|
|
||||||
mov es, ax
|
|
||||||
mov fs, ax
|
|
||||||
mov gs, ax
|
|
||||||
|
|
||||||
pop r15
|
pop r15
|
||||||
pop r14
|
pop r14
|
||||||
pop r13
|
pop r13
|
||||||
|
|||||||
@@ -141,7 +141,7 @@ scheduler::load_process(const char *name, const void *data, size_t size)
|
|||||||
|
|
||||||
// Highest state in the stack is the process' kernel stack for the loader
|
// Highest state in the stack is the process' kernel stack for the loader
|
||||||
// to iret to:
|
// to iret to:
|
||||||
state->ds = state->ss = ss;
|
state->ss = ss;
|
||||||
state->cs = cs;
|
state->cs = cs;
|
||||||
state->rflags = rflags_int;
|
state->rflags = rflags_int;
|
||||||
state->rip = 0; // to be filled by the loader
|
state->rip = 0; // to be filled by the loader
|
||||||
@@ -151,7 +151,7 @@ scheduler::load_process(const char *name, const void *data, size_t size)
|
|||||||
// iret to this which will kick off the loading:
|
// iret to this which will kick off the loading:
|
||||||
cpu_state *loader_state = reinterpret_cast<cpu_state *>(sp0) - 2;
|
cpu_state *loader_state = reinterpret_cast<cpu_state *>(sp0) - 2;
|
||||||
|
|
||||||
loader_state->ds = loader_state->ss = kss;
|
loader_state->ss = kss;
|
||||||
loader_state->cs = kcs;
|
loader_state->cs = kcs;
|
||||||
loader_state->rflags = rflags_noint;
|
loader_state->rflags = rflags_noint;
|
||||||
loader_state->rip = reinterpret_cast<uint64_t>(ramdisk_process_loader);
|
loader_state->rip = reinterpret_cast<uint64_t>(ramdisk_process_loader);
|
||||||
|
|||||||
Reference in New Issue
Block a user