I am making an OS and I have now finished making the bootloader and kernel. I have a working print() function and cls() function. I also have inportb() and outportb(), but I do not know how I would use these to get input from a user
The kernel is written in C, any help is appreciated
(btw: I read somewhere you need to use inportb() on port 60, but I have no idea what to do from there :3 )
Equivalent of gets() or scanf() ??
Equivalent of gets() or scanf() ??
Current Project:
Unnamed OS (5% complete)
Unnamed OS (5% complete)
- xenos
- Member
- Posts: 1121
- Joined: Thu Aug 11, 2005 11:00 pm
- Libera.chat IRC: xenos1984
- Location: Tartu, Estonia
- Contact:
Re: Equivalent of gets() or scanf() ??
Hint: You need a keyboard driver.
Re: Equivalent of gets() or scanf() ??
You may need a keyboard driver or some network / serial port support.
- Love4Boobies
- Member
- Posts: 2111
- Joined: Fri Mar 07, 2008 5:36 pm
- Location: Bucharest, Romania
Re: Equivalent of gets() or scanf() ??
If you're asking for gets, then you don't know C. So how can you write a kernel in it?
"Computers in the future may weigh no more than 1.5 tons.", Popular Mechanics (1949)
[ Project UDI ]
[ Project UDI ]
- Kazinsal
- Member
- Posts: 559
- Joined: Wed Jul 13, 2011 7:38 pm
- Libera.chat IRC: Kazinsal
- Location: Vancouver
- Contact:
Re: Equivalent of gets() or scanf() ??
This. gets() is probably one of the more insecure functions in the C standard library. Not to mention that it's deprecated in C99 and outright obsoleted (as in it may not even exist in some C standard library implementations) in C11. It's probably not a good idea to be writing an operating system kernel if you're used to using such hilariously broken libc functions.Love4Boobies wrote:If you're asking for gets, then you don't know C. So how can you write a kernel in it?
- Owen
- Member
- Posts: 1700
- Joined: Fri Jun 13, 2008 3:21 pm
- Location: Cambridge, United Kingdom
- Contact:
Re: Equivalent of gets() or scanf() ??
Every libc that I know of which has a "C11" mode removes gets in itBlacklight wrote:outright obsoleted (as in it may not even exist in some C standard library implementations) in C11