What does your OS look like? (Screen Shots..)
What does your OS look like? (Screen Shots..)
Piranha, how did you get arrow keys working ? Did you port libreadline ?
If a trainstation is where trains stop, what is a workstation ?
Re: What does your OS look like? (Screen Shots..)
Scancodes for Arrow Keys:gerryg400 wrote:Piranha, how did you get arrow keys working ? Did you port libreadline ?
0x48 : Up
0x50 : Down
0x4D : Right
0x4B : Left
Re: What does your OS look like? (Screen Shots..)
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.Nessphoro wrote:Scancodes for Arrow Keys:gerryg400 wrote:Piranha, how did you get arrow keys working ? Did you port libreadline ?
0x48 : Up
0x50 : Down
0x4D : Right
0x4B : Left
If a trainstation is where trains stop, what is a workstation ?
- piranha
- 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..)
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).gerryg400 wrote:Piranha, how did you get arrow keys working ? Did you port libreadline ?
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
dbittman on IRC, @danielbittman on twitter
https://dbittman.github.io
Re: What does your OS look like? (Screen Shots..)
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.piranha wrote: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).gerryg400 wrote:Piranha, how did you get arrow keys working ? Did you port libreadline ?
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
If a trainstation is where trains stop, what is a workstation ?
- piranha
- 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..)
It's not too bad. There are just a lot of details that you need to work out...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.
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
dbittman on IRC, @danielbittman on twitter
https://dbittman.github.io
Re: What does your OS look like? (Screen Shots..)
What level of debugging support do you have on your OS ?
If a trainstation is where trains stop, what is a workstation ?
- piranha
- 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..)
AHAHAHA. debugging?gerryg400 wrote:What level of debugging support do you have on your OS ?
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
dbittman on IRC, @danielbittman on twitter
https://dbittman.github.io
- gravaera
- 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..)
Dat old school zenpiranha wrote:AHAHAHA. debugging?gerryg400 wrote:What level of debugging support do you have on your OS ?
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
17:56 < sortie> Paging is called paging because you need to draw it on pages in your notebook to succeed at it.