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.
I have my OS and i created an os specific toolkit with the newlib c library. I have some syscalls such as the write. I can write a program that uses printf and compile it and run it on user space on my os. Now i am trying to implement the read system call. I wrote the keyboard drivers, and also i wrote a kscanf and getchar functions and they work just fine on kernel space, but when i use scanf on user space through the read system call, it allow me to write and press enter but it doesn't save the value to show it when i printf the string. The read system call declaration is like the linux format,
I checked it and it is big enough, i also tried to enlarge it but still almost the same. Just a symbol like @ appears which i guess means it is Null.
Try not to guess and do simple inspection. Rather than printing characters, try printing the hex value of what you receive. If you are printing '@' then the byte you received was 0x40, not 0. It might also be useful to print the return value of read (i.e. the number of characters read).
I tried to print the buffer in hex but it prints this '0x80402fc6' which is probably just a random value in memory of an uninitialised buffer, so i think the buffer does not keep the value i am giving.
The problem is that i have the scanf function and in kernel mode it transfers it, so the problem is more likely with the read system call calling. That's what i don't know how to fix. The system calls with just printing work, this one which needs a value to be returned doesn't.