-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dual terminal support #56
Conversation
Pulling upstream changes
Additional note: terminal 1 now runs using
|
Getting the virtual UART to work reliably (albeit slowly in some cases) The UART requires RTSCTS handshaking_; this will need to be set for So I expect you'll need ... | stty -F /dev/ttyS0 -clocal crtscts -ixoff | sysbuild/app/scripts/sys-runtime.js Line 34 in 9688029
this.sendKeys('\nstty -clocal crtscts -ixoff\ngcc hello.c;echo boot2ready-$?;rm a.out\n', 'boot2ready-0', onBootFinished); For each tty because we're bringing the kernel's view of the hardware ((FYI Other handshaking is possible - e.g. S_ON S_OFF characters - )) L.
|
Yep, I had a hell of a time trying to trace the flow of the UART code. I didn't try setting parameters using |
@wchill Is the test setup you hosted running your latest changes? The compilation does not seem to work (An exception is thrown when the compile button is pressed). |
SysViewModel.getInstance().ttyFullScreen.subscribe(function () { | ||
this.lastMouseDownTarget = this.terminalcanvas; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did you change this? Based on your hosted test setup, currently what happens is when you switch to full screen on the first (left) terminal, the focus is set to the second terminal -- hence anything you type is sent to the second (right) terminal.
You need to set focus to the terminal on which the full screen button was clicked.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I forgot to fix that. I'll get around to fixing that.
Compilation is most likely because terminal one is using a different TTY device, I will look into that also
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Your latest commit fixed it.
Just found out why compilation causes an exception: I edited the file using Chrome's developer tools and verified that this fixes it. Will fix in next commit. |
Also Neelabh, yes the test setup is running directly off my |
Also, can you edit the PR description to briefly describe what you changed in the binary file |
Done. |
I've pushed a new commit fixing the two previous mentioned bugs, please review. |
this.terminput = new TerminalInput(new UARTDev(this)); | ||
this.termTwo = new Terminal(24, 80, termIdTwo); | ||
this.terminput = new TerminalInput(new UARTDev(this, termId)); | ||
this.terminputtwo = new TerminalInput(new UARTDev(this, termIdTwo)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't the tty
parameter to the UARTDev
constructors be the literal strings 'tty0'
and 'tty1'
instead of termId
and termIdTwo
?
The uart sends the command to the worker which only understands 'tty0'
and 'tty1'
- it doesn't know about the HTML element ids. It just happens that the element ids are the strings 'tty0'
and 'tty1'
so everything works.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That was deliberate on my part, I prefer not to use hardcoded constants and it makes sense if you think of a terminal canvas 'attaching' to a UART for I/O.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see your point. However, the way I see it is that you are supposed to use the hardcoded constants. The jor1k codebase, sys-runtime.js
and live-edit.js
all use these string constants to refer to the ttys. These should ideally be global constants/enums or something instead of strings. If you want to use the element ids to refer to the ttys then the ids should be constants - the element ids shouldn't then be passed in as parameters to the Jor1kGUI constructor. What happens if the HTML programmer uses some different ids and passes them to the Jor1kGUI constructor? The very fact that the ids are accepted as params means that we cannot rely on them being the constants we expect them to be. If you want to get rid of the constants entirely, then you'll need to modify jor1k itself or somehow map from the term ids to the constants. This was just my opinion, what do you think?
Anyway, no changes are required, I just merged in your code.
I just merged PR #55 , which is causing merge conflicts with this one. Do you mind merging the changes and updating your branch? I think the following steps should do it:
Hopefully git will be able to auto-merge so that you do not have to do it manually. |
Nevermind, I did it manually from the command line. |
Support for two terminals in the emulator. Closes #19
Note that sometimes junk and/or the error message
mkdir: can't create directory '/tmp/root-runtime-dir': File exists
will appear in either terminal window; as far as I can tell this is related to how the login process is now handled in/etc/inittab
and does not affect functionality in any way.To switch between terminals, press the newly added arrow button in the top right corner of the terminal. Fullscreen state is maintained between switches.
gcc
compilation still happens in the first terminal window, but this can be changed later if necessary.hdgcc-mod.bz2
(the disk image) has been modified to startgetty
on boot./etc/inittab
and/bin/autologin
were modified to achieve this.There is a test setup running on http://tf2.intense.io:9000/#playground