Headers used by system, kernel, and libc
Headers used by system, kernel, and libc
I've just ported newlib recently, and as I started writing a driver for the text mode screen and keyboard separately I realized I really needed to implement a TTY type driver mechanism. It would just make my life easier. As far as controlling attributes of terminal devices, I knew that termios was a standard way of doing it, so I was going to implement that. My problem is that I'm not sure what to do about header files like termios.h which are fairly standard (at least parts of them). There is a termios.h in my newlib/include/ folder, but it simply includes newlib/include/sys/termios.h, which doesn't exist. I'm trying to figure out if I was intended to create that file in newlib/include/sys or if I did something wrong when compiling/installing it. I could write one and put it there, but I don't want to pollute my libc includes with that, and I'm not sure what the purpose of sys/ directory is (is it for the system as in the kernel or what?).
Re: Headers used by system, kernel, and libc
There are (at least) 2 ways to use newlib:
1. Build directly - in this case you deal with the default nosys with minimum features, and provide libgloss for the "glue".
2. Tell newlib about your OS, in this case you put your system dependent files in the "sys" directory and configure it (check the manual).
If you plan to write your own termios, I recommend to take a look at:
http://pubs.opengroup.org/onlinepubs/00 ... ios.h.html
And, don't copy the linux header - not because of the license but it's a mess.
1. Build directly - in this case you deal with the default nosys with minimum features, and provide libgloss for the "glue".
2. Tell newlib about your OS, in this case you put your system dependent files in the "sys" directory and configure it (check the manual).
The sys/ directory is meant for system dependent files, although many OS (including Mac OS) also put system specific code on topmost directory.I'm not sure what the purpose of sys/ directory is (is it for the system as in the kernel or what?).
If you plan to write your own termios, I recommend to take a look at:
http://pubs.opengroup.org/onlinepubs/00 ... ios.h.html
And, don't copy the linux header - not because of the license but it's a mess.
- Brynet-Inc
- Member
- Posts: 2426
- Joined: Tue Oct 17, 2006 9:29 pm
- Libera.chat IRC: brynet
- Location: Canada
- Contact:
Re: Headers used by system, kernel, and libc
SUSv4..bluemoon wrote:If you plan to write your own termios, I recommend to take a look at:
http://pubs.opengroup.org/onlinepubs/00 ... ios.h.html
http://pubs.opengroup.org/onlinepubs/96 ... ios.h.html
Re: Headers used by system, kernel, and libc
Alright, so everything should just go with my libgloss. Thanks for the quick reply, everyone! Newlib doesn't have very much documentation, so I wasn't sure of the standard way of doing things.
Also, thanks for the link. That happens to be the one I've been following, anyway!
Also, thanks for the link. That happens to be the one I've been following, anyway!