Syscalls in user mode

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
User avatar
alethiophile
Member
Member
Posts: 90
Joined: Sat May 30, 2009 10:28 am

Syscalls in user mode

Post by alethiophile »

I am following JamesM's tutorial, now working on user mode and syscalls. I wrote out the code and tested it, as such:

Code: Select all

  init_syscalls();

  goto_user_mode();

  syscall_mputs("Hello, world!");
This does nothing. I have verified that control reaches the syscall_mputs, but it does not print anything, and diagnostic print statements in the ISR and syscall handlers do not get printed. When the goto_user_mode() is commented out, on the other hand, it executes the syscall correctly. I would put more code here, but I'm not really sure what bit of the code is relevant, or why this would happen--what does user mode have to do with executing an interrupt? Does anyone have any thoughts?
If I had an OS, there would be a link here.
User avatar
alethiophile
Member
Member
Posts: 90
Joined: Sat May 30, 2009 10:28 am

Re: Syscalls in user mode

Post by alethiophile »

OK, reading the Intel manuals, I set the privilege level on the IDT entry to 3, and it works fine now. Never mind. #-o
If I had an OS, there would be a link here.
earlz
Member
Member
Posts: 1546
Joined: Thu Jul 07, 2005 11:00 pm
Contact:

Re: Syscalls in user mode

Post by earlz »

alethiophile wrote:OK, reading the Intel manuals, I set the privilege level on the IDT entry to 3, and it works fine now. Never mind. #-o
Yes, I believe thats a bug in his tutorial(I think I've messaged him about it too)
Post Reply