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.
Hi. I'm trying to use a printf in newlib, with rudimentary sbrk and write syscall support in my kernel. However, before it even gets to running the syscall, a page error gets thrown at the address of
(CR2=00000034) because of what seems like a null pointer.
This doesn't seem to happen because of any code I wrote (at least from what I can glance obviously) because from what I've been able to glance people don't have errors until the syscall has finished running. If someone could help it would be great.
Have you run it under gdb to determine the call sequence leading to the fault? That should at least tell you the variable containing the null pointer and you can place a watch on that variable to see how it gets set.
Thanks for the help! What ended up being the problem was something along the lines that the libc I used to compile gcc wasn't playing nice with newlib, and there were a lot of problems. After a simple recompilation (making sure that gcc targets newlib instead of my stubbed libc), it works now.