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

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
gerryg400
Member
Member
Posts: 1801
Joined: Thu Mar 25, 2010 11:26 pm
Location: Melbourne, Australia

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

Post by gerryg400 »

Piranha, how did you get arrow keys working ? Did you port libreadline ?
If a trainstation is where trains stop, what is a workstation ?
User avatar
Nessphoro
Member
Member
Posts: 308
Joined: Sat Apr 30, 2011 12:50 am

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

Post by Nessphoro »

gerryg400 wrote:Piranha, how did you get arrow keys working ? Did you port libreadline ?
Scancodes for Arrow Keys:
0x48 : Up
0x50 : Down
0x4D : Right
0x4B : Left
gerryg400
Member
Member
Posts: 1801
Joined: Thu Mar 25, 2010 11:26 pm
Location: Melbourne, Australia

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

Post by gerryg400 »

Nessphoro wrote:
gerryg400 wrote:Piranha, how did you get arrow keys working ? Did you port libreadline ?
Scancodes for Arrow Keys:
0x48 : Up
0x50 : Down
0x4D : Right
0x4B : Left
Thanks, but I was wondering how the keys get to the application. I compiled Dash on my OS and when I ran it the arrow key didn't work. Dash configure didn't detect libreadline (I didn't port it) and apparently disabled arrow key handling. Because Piranha has ported Bash (I think) I though he might know the easy way to get it going.
If a trainstation is where trains stop, what is a workstation ?
User avatar
piranha
Member
Member
Posts: 1391
Joined: Thu Dec 21, 2006 7:42 pm
Location: Unknown. Momentum is pretty certain, however.
Contact:

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

Post by piranha »

gerryg400 wrote:Piranha, how did you get arrow keys working ? Did you port libreadline ?
My keyboard handler detects if it's an arrow key, using appropriate scan codes. My tty read function returns the appropriate escape sequence: "\E[A" is the code for the up arrow. Took quite a while to actually get it to work, but tty_read returns that sequence in the buffer (ncurses requests 1 key at a time, so it returns 1 element of the sequence per call to ncurses since the count argument is 1).

The annoying part is that the way ncurses decides if you've pressed the escape key or if you're giving it an escape sequence is by calling select() to figure out if theres data to read still (I've stubbed this, it always says theres more data). select() has to deal with timeouts (and it wasn't until I properly implemented the timeout code that the arrow keys started to work).

Basically, a lot of trial and error, looking through the ncurses library code and researching select() and termios. I didn't port libreadline, but I did port termcap.

I don't actually have bash detecting the arrow keys, but I ported bash before I implemented all the termios and select() stuff. At some point in the near future, I'll report bash and see if it detects arrow keys.

-JL
SeaOS: Adding VT-x, networking, and ARM support
dbittman on IRC, @danielbittman on twitter
https://dbittman.github.io
gerryg400
Member
Member
Posts: 1801
Joined: Thu Mar 25, 2010 11:26 pm
Location: Melbourne, Australia

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

Post by gerryg400 »

piranha wrote:
gerryg400 wrote:Piranha, how did you get arrow keys working ? Did you port libreadline ?
My keyboard handler detects if it's an arrow key, using appropriate scan codes. My tty read function returns the appropriate escape sequence: "\E[A" is the code for the up arrow. Took quite a while to actually get it to work, but tty_read returns that sequence in the buffer (ncurses requests 1 key at a time, so it returns 1 element of the sequence per call to ncurses since the count argument is 1).

The annoying part is that the way ncurses decides if you've pressed the escape key or if you're giving it an escape sequence is by calling select() to figure out if theres data to read still (I've stubbed this, it always says theres more data). select() has to deal with timeouts (and it wasn't until I properly implemented the timeout code that the arrow keys started to work).

Basically, a lot of trial and error, looking through the ncurses library code and researching select() and termios. I didn't port libreadline, but I did port termcap.

I don't actually have bash detecting the arrow keys, but I ported bash before I implemented all the termios and select() stuff. At some point in the near future, I'll report bash and see if it detects arrow keys.

-JL
It's quite depressing just how convoluted some of this sh*t is. It's no great surprise then that it didn't 'just work' for me.
If a trainstation is where trains stop, what is a workstation ?
User avatar
piranha
Member
Member
Posts: 1391
Joined: Thu Dec 21, 2006 7:42 pm
Location: Unknown. Momentum is pretty certain, however.
Contact:

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

Post by piranha »

gerryg400 wrote:It's quite depressing just how convoluted some of this sh*t is. It's no great surprise then that it didn't 'just work' for me.
It's not too bad. There are just a lot of details that you need to work out...

As to your earlier question about bash and arrow keys, I just reported bash and enabled its libreadline at configure time and arrow keys seem to work properly. I can scroll through history now!

-JL
SeaOS: Adding VT-x, networking, and ARM support
dbittman on IRC, @danielbittman on twitter
https://dbittman.github.io
gerryg400
Member
Member
Posts: 1801
Joined: Thu Mar 25, 2010 11:26 pm
Location: Melbourne, Australia

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

Post by gerryg400 »

What level of debugging support do you have on your OS ?
If a trainstation is where trains stop, what is a workstation ?
User avatar
piranha
Member
Member
Posts: 1391
Joined: Thu Dec 21, 2006 7:42 pm
Location: Unknown. Momentum is pretty certain, however.
Contact:

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

Post by piranha »

gerryg400 wrote:What level of debugging support do you have on your OS ?
AHAHAHA. debugging? :shock:

Haha, uh, what do you mean? As in, can I debug applications? Like with gdb? Or in kernel? I don't currently have a kernel debugger, I mostly just do a lot of printks if I need to get information. Why do you ask?

-JL
SeaOS: Adding VT-x, networking, and ARM support
dbittman on IRC, @danielbittman on twitter
https://dbittman.github.io
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 »

piranha wrote:
gerryg400 wrote:What level of debugging support do you have on your OS ?
AHAHAHA. debugging? :shock:

Haha, uh, what do you mean? As in, can I debug applications? Like with gdb? Or in kernel? I don't currently have a kernel debugger, I mostly just do a lot of printks if I need to get information. Why do you ask?

-JL
Dat old school zen
17:56 < sortie> Paging is called paging because you need to draw it on pages in your notebook to succeed at it.
Post Reply