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

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.
Post Reply
earlz
Member
Member
Posts: 1546
Joined: Thu Jul 07, 2005 11:00 pm
Contact:

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

Post by earlz »

matio wrote:Next up, keyboard support!
I find it hilarious that you have multitasking, but no keyboard support
User avatar
gravaera
Member
Member
Posts: 737
Joined: Tue Jun 02, 2009 4:35 pm
Location: Supporting the cause: Use \tabs to indent code. NOT \x20 spaces.

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

Post 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.
17:56 < sortie> Paging is called paging because you need to draw it on pages in your notebook to succeed at it.
xyzzy
Member
Member
Posts: 391
Joined: Wed Jul 25, 2007 8:45 am
Libera.chat IRC: aejsmith
Location: London, UK
Contact:

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

Post 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.
dosfan
Member
Member
Posts: 65
Joined: Tue Oct 14, 2008 1:18 pm
Location: Scotland

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

Post 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.
All your base are belong to us.
jal
Member
Member
Posts: 1385
Joined: Wed Oct 31, 2007 9:09 am

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

Post 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
User avatar
Owen
Member
Member
Posts: 1700
Joined: Fri Jun 13, 2008 3:21 pm
Location: Cambridge, United Kingdom
Contact:

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

Post 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...)
jal
Member
Member
Posts: 1385
Joined: Wed Oct 31, 2007 9:09 am

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

Post 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
pcmattman
Member
Member
Posts: 2566
Joined: Sun Jan 14, 2007 9:15 pm
Libera.chat IRC: miselin
Location: Sydney, Australia (I come from a land down under!)
Contact:

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

Post 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 :).
jal
Member
Member
Posts: 1385
Joined: Wed Oct 31, 2007 9:09 am

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

Post 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
User avatar
XanClic
Member
Member
Posts: 138
Joined: Wed Feb 13, 2008 9:38 am

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

Post by XanClic »

But I'd like to test your OS on my laptop, too. :wink:

(Which has a PS/2 keyboard)
User avatar
Owen
Member
Member
Posts: 1700
Joined: Fri Jun 13, 2008 3:21 pm
Location: Cambridge, United Kingdom
Contact:

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

Post 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
earlz
Member
Member
Posts: 1546
Joined: Thu Jul 07, 2005 11:00 pm
Contact:

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

Post 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
User avatar
neon
Member
Member
Posts: 1567
Joined: Sun Feb 18, 2007 7:28 pm
Contact:

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

Post 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.
OS Development Series | Wiki | os | ncc
char c[2]={"\x90\xC3"};int main(){void(*f)()=(void(__cdecl*)(void))(void*)&c;f();}
User avatar
gravaera
Member
Member
Posts: 737
Joined: Tue Jun 02, 2009 4:35 pm
Location: Supporting the cause: Use \tabs to indent code. NOT \x20 spaces.

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

Post 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. :?
17:56 < sortie> Paging is called paging because you need to draw it on pages in your notebook to succeed at it.
smeezekitty
Member
Member
Posts: 50
Joined: Sat Mar 21, 2009 9:42 pm

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

Post by smeezekitty »

Being in real mode, keyboard support was as easy as calling interrupt 16h.
Post Reply