Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void switch_to_user_mode() {
- __asm__ volatile(" mov %ax,0x23; \
- mov %ds,%ax; \
- mov %es,%ax; \
- mov %fs,%ax; \
- mov %gs,%ax; \
- mov %eax,%esp; \
- push 0x23; \
- push %eax; \
- pushf; \
- push 0x1B; \
- push user_mode; \
- iret; \
- ");
- }
Advertisement
Add Comment
Please, Sign In to add comment