Page 1 of 1

When to add keyboard support (Split: Screen Shots Topic)

Posted: Tue Nov 17, 2009 12:53 pm
by earlz
matio wrote:Next up, keyboard support!
I find it hilarious that you have multitasking, but no keyboard support

Re: What does your OS look like? (Screen Shots..)

Posted: Tue Nov 17, 2009 1:42 pm
by gravaera
@earlz: It's really not that incredible; A PS/2 keyboard driver is technically useless for the first bout of the bootstrapping race. The PS/2 keyboard was used as an example for coding drivers in more than one tutorial, so it has become a de facto 'must have' driver for most projects, even though it really can't be used for anything while a kernel initializes itself, and a logically thinking individual would want to initialize all user input devices at a particular stage in the OS (enumeration, or whatever term you coin), when it simply makes more sense.

In fact, if a kernel is properly designed, one would find it best to leave the initialization of the PS/2 keyboard driver until later on. It's not used, and a static method of initialization really goes an limits how you implement locales (whatever that means for your OS) later on.

Initializing a PS/2 controller driver at early boot makes sense, though.

Re: What does your OS look like? (Screen Shots..)

Posted: Tue Nov 17, 2009 3:35 pm
by xyzzy
earlz wrote:
matio wrote:Next up, keyboard support!
I find it hilarious that you have multitasking, but no keyboard support
I find it hilarious that you find that hilarious. A keyboard driver isn't exactly a necessity - I managed fine without one for 8 months in my current kernel's development, and I had multitasking 5 months before a keyboard driver.

Re: What does your OS look like? (Screen Shots..)

Posted: Tue Nov 17, 2009 3:53 pm
by dosfan
AlexExtreme wrote:
I find it hilarious that you find that hilarious. A keyboard driver isn't exactly a necessity - I managed fine without one for 8 months in my current kernel's development, and I had multitasking 5 months before a keyboard driver.
I second that. I had GNU Bash running in a previous project before I implemented any kind of keyboard support.

Re: What does your OS look like? (Screen Shots..)

Posted: Wed Nov 18, 2009 2:29 am
by jal
I have keyboard support hacked in for easy testing (copied from some previous old project), but still no proper driver support. Also I doubt whether I'll ever add PS/2 keyboard support, since USB is the way to go.


JAL

Re: What does your OS look like? (Screen Shots..)

Posted: Wed Nov 18, 2009 7:40 am
by Owen
jal wrote:I have keyboard support hacked in for easy testing (copied from some previous old project), but still no proper driver support. Also I doubt whether I'll ever add PS/2 keyboard support, since USB is the way to go.


JAL
Aren't many (all?) internal laptop keyboards still PS/2? Also, at least round here, 90% of keyboards in stores are PS/2 (Which is annoying - I have a USB hub attached to my desk which a USB keyboard would go into...)

Re: What does your OS look like? (Screen Shots..)

Posted: Wed Nov 18, 2009 8:14 am
by jal
Owen wrote:Aren't many (all?) internal laptop keyboards still PS/2?
I didn't think so. If so, I'd have to add support for it of course.
Also, at least round here, 90% of keyboards in stores are PS/2 (Which is annoying - I have a USB hub attached to my desk which a USB keyboard would go into...)
Where exactly is "round here"? Here, in the Netherlands, almost all keyboards are USB, and PCs without PS/2 connections are common.


JAL

Re: What does your OS look like? (Screen Shots..)

Posted: Wed Nov 18, 2009 8:31 am
by pcmattman
jal wrote:
Owen wrote:Aren't many (all?) internal laptop keyboards still PS/2?
I didn't think so. If so, I'd have to add support for it of course.
As far as I know, most laptop keyboards are either PS/2 or connected directly to an internal USB hub.

Also, most systems allow you to turn on PS/2 emulation, so a USB keyboard usually ends up being no different to a PS/2 keyboard (to your OS, anyway). This is how I used to test my OS a couple of years ago on real hardware, as I stopped using PS/2 keyboards a long time ago :).

Re: When to add keyboard support (Split: Screen Shots Topic)

Posted: Wed Nov 18, 2009 9:11 am
by jal
pcmattman wrote:Also, most systems allow you to turn on PS/2 emulation, so a USB keyboard usually ends up being no different to a PS/2 keyboard (to your OS, anyway). This is how I used to test my OS a couple of years ago on real hardware, as I stopped using PS/2 keyboards a long time ago :).
Yeah, I know about the emulation, but I'm not too fond of using legacy stuff. Of course I can use the PIC, PIT, PS/2 and such, but I'd rather concentrate on the latest standards.


JAL

Re: When to add keyboard support (Split: Screen Shots Topic)

Posted: Wed Nov 18, 2009 10:24 am
by XanClic
But I'd like to test your OS on my laptop, too. :wink:

(Which has a PS/2 keyboard)

Re: When to add keyboard support (Split: Screen Shots Topic)

Posted: Wed Nov 18, 2009 10:26 am
by Owen
jal wrote:Where exactly is "round here"? Here, in the Netherlands, almost all keyboards are USB, and PCs without PS/2 connections are common.
United Kingdom (Updated profile). It's possible the situation has changed; I haven't been in a physical computer store for ~1 year

Re: When to add keyboard support (Split: Screen Shots Topic)

Posted: Wed Nov 18, 2009 12:08 pm
by earlz
I would say a PS/2 driver should come before a USB keyboard driver because it is trivial to implement(once you have a HID "Stack" for handling such input in your kernel from any kind of driver) and almost every computer out there has PS/2 or PS/2 emulation.

That being said.. I find having a keyboard is very useful in my OS because I don't have to recompile the kernel when I want to test different things in different orders.. I usually implement a very basic shell in my OSs too wit a special "test" command. This is so I can do `test 10` and run test #10 for my OS and thus don't have to recompile to do past tests and such.. and like I said, PS/2 keyboard is sooo trivial to implement(especially if you just do a hacky implementation ignoring keyboard LEDs and such

Re: When to add keyboard support (Split: Screen Shots Topic)

Posted: Wed Nov 18, 2009 2:33 pm
by neon
earlz wrote: I find having a keyboard is very useful in my OS because I don't have to recompile the kernel when I want to test different things in different orders.. I usually implement a very basic shell in my OSs too wit a special "test" command
I personally am doing things through boot time switches passed to the kernel. Be default it displays a progress bar and splash screen, however I can pass switches to the kernel to configure it to test different things and display information via text mode. No recompiling needed: just edit my bootloaders config file to test something.

I personally rather not rewrite the same driver twice. I rather wait until the core system is up and running and I can write them as user mode drivers instead.

Just my 2 cents.

Re: When to add keyboard support (Split: Screen Shots Topic)

Posted: Wed Nov 18, 2009 6:12 pm
by gravaera
QFT at the post above me (neon). Microkernels and modularity all the way. UDI and modular mode drivers 'till death. Dynamic loading and unloading of OS components to save memory and make a clean internal OS structure is probably a great design decision.

I have yet to implement anything that would actually intensively do that, so I could be wrong of course. :?

Re: When to add keyboard support (Split: Screen Shots Topic)

Posted: Thu Mar 04, 2010 10:24 pm
by smeezekitty
Being in real mode, keyboard support was as easy as calling interrupt 16h.