projects
/
voyage-au-centre-des-fichiers.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
900b22c
)
Changed the instruction that jumps to ring 3 from sysretq to iretq
author
Amelia Coutard
<eliottulio.coutard@gmail.com>
Mon, 13 Mar 2023 22:43:45 +0000
(23:43 +0100)
committer
Amelia Coutard
<eliottulio.coutard@gmail.com>
Mon, 13 Mar 2023 22:43:45 +0000
(23:43 +0100)
kernel/src/ring3.S
patch
|
blob
|
history
diff --git
a/kernel/src/ring3.S
b/kernel/src/ring3.S
index 2b6a7831feb55319dbdf2bc27c754113d7cf0fce..6d9b55fa59bde24bd5776dde7148d6576f2b3ed3 100644
(file)
--- a/
kernel/src/ring3.S
+++ b/
kernel/src/ring3.S
@@
-15,10
+15,19
@@
.globl ftl_to_userspace
ftl_to_userspace:
- mov %rdi, %rcx
- mov %rsi, %rsp
- mov $0x202, %r11 # EFLAGS
- sysretq
+ mov $(8 * 3) | 3, %ax
+ mov %ax, %ds
+ mov %ax, %es
+ mov %ax, %fs
+ mov %ax, %gs
+ # iretq handles cs and ss
+
+ pushq $(8 * 3) | 3
+ pushq %rsi
+ pushfq
+ pushq $(8 * 4) | 3
+ pushq %rdi
+ iretq
.globl load_tss
load_tss: