Serial console core. Anyone?

https://github.com/MiSTer-devel/Main_MiSTer/wiki

Moderators: Mug UK, Zorro 2, Greenious, spiny, Sorgelig, Moderator Team

Sorgelig
Ultimate Atarian
Ultimate Atarian
Posts: 5274
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Serial console core. Anyone?

Postby Sorgelig » Wed Nov 14, 2018 7:14 pm

I want console core for MiSTer which will use already working serial port between FPGA and HPS to control the linux part directly from MiSTer keyboard.
I'm busy by many other cores so would like to ask if someone is willing to write such core. I think it won't be too complex and can be made by those who is just started to learn HDL and want to write something useful.
Basically the core is just keyboard inputs send to UART and receive from UART to the screen.
This core will be handy and can be used instead of USB console.

And this console should support xterm format. There is midnight commander already installed on Linux. So i would like to have it work in this console with colors and correct control codes from keyboard.

Anyone would like to try?

alanswx
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 144
Joined: Sat Nov 25, 2017 4:34 pm

Re: Serial console core. Anyone?

Postby alanswx » Wed Nov 14, 2018 7:50 pm


Sorgelig
Ultimate Atarian
Ultimate Atarian
Posts: 5274
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: Serial console core. Anyone?

Postby Sorgelig » Thu Nov 15, 2018 5:59 am

yeah. Something like that but really working on MiSTer and with color and keys working in midnight commander :)
I'm not sure if CPU is really required. I believe it can be written in pure HDL. But i really don't care if it will use CPU with firmware as long as it works.

oldgit
Atari User
Atari User
Posts: 40
Joined: Mon May 28, 2018 11:05 am

Re: Serial console core. Anyone?

Postby oldgit » Sat Nov 17, 2018 2:16 pm

I have ported across a vt220 xterm colour console and should be able to get it working, once I get past the requirement for 8Mbytes of sdram !!!

Is the HPS uart connections set up in MiSTer as I cannot find them ?
Old enough to remember B&W TV with 2 channels: Young enough to embrace new technology: Stupid enough to try and get it to work.

Sorgelig
Ultimate Atarian
Ultimate Atarian
Posts: 5274
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: Serial console core. Anyone?

Postby Sorgelig » Sat Nov 17, 2018 4:28 pm

oldgit wrote:I have ported across a vt220 xterm colour console and should be able to get it working, once I get past the requirement for 8Mbytes of sdram !!!

Is the HPS uart connections set up in MiSTer as I cannot find them ?

check sys_top.v file in Minimig. It has additional signals for UART

oldgit
Atari User
Atari User
Posts: 40
Joined: Mon May 28, 2018 11:05 am

Re: Serial console core. Anyone?

Postby oldgit » Sat Nov 17, 2018 5:17 pm

Sorgelig wrote: check sys_top.v file in Minimig. It has additional signals for UART


Thanks - I had just finished a qsys to add the uart and the code is very similar - I have set mine to uart_0
Do I need uart_1 ?
Old enough to remember B&W TV with 2 channels: Young enough to embrace new technology: Stupid enough to try and get it to work.

Sorgelig
Ultimate Atarian
Ultimate Atarian
Posts: 5274
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: Serial console core. Anyone?

Postby Sorgelig » Sat Nov 17, 2018 9:26 pm

Of course cannot. They are physical devices, so you cannot swap them.

User avatar
Newsdee
Atari God
Atari God
Posts: 1486
Joined: Fri Sep 19, 2014 8:40 am

Re: Serial console core. Anyone?

Postby Newsdee » Sun Nov 18, 2018 1:58 am

Interesting idea. It's basically a Linux shell that can be loaded like any core, and then it's easy to switch back to a core.
Looking forward to it!

Sorgelig
Ultimate Atarian
Ultimate Atarian
Posts: 5274
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: Serial console core. Anyone?

Postby Sorgelig » Sun Nov 18, 2018 9:18 pm

All cores released on 20181118 have UART signals in emu entity. So, just grab sys from any of these cores (Genesis, NES, SMS, Gameboy, TGFx16)
Your core needs return correct flags for hps_io:

Code: Select all

.uart_mode(16'b000_11111_000_11111),

so MiSTer will know your core is using UART and will give the option to choose the UART mode.

oldgit
Atari User
Atari User
Posts: 40
Joined: Mon May 28, 2018 11:05 am

Re: Serial console core. Anyone?

Postby oldgit » Thu Jan 24, 2019 11:20 am

I am running a vt220 core using uart connections.
I have selected console from the OSD and on PuTTy the command cat /proc/tty/driver/serial shows that the irq:41 is receiving the keyboard commands from the core but I am receiving only 3 bytes at the start.
Do I need flow control - DTR and DTS are set to 1'b1
Old enough to remember B&W TV with 2 channels: Young enough to embrace new technology: Stupid enough to try and get it to work.

ex68k
Atari freak
Atari freak
Posts: 74
Joined: Sat Oct 26, 2013 11:13 am

Re: Serial console core. Anyone?

Postby ex68k » Thu Jan 24, 2019 1:00 pm

oldgit wrote:I am running a vt220 core using uart connections.


is it in any git repository?

Cheers!

P.S. Just got mine (the "real thing") back from storage yesterday ;-)

oldgit
Atari User
Atari User
Posts: 40
Joined: Mon May 28, 2018 11:05 am

Re: Serial console core. Anyone?

Postby oldgit » Thu Jan 24, 2019 1:41 pm

ex68k wrote:is it in any git repository?


Not at present I have ported (nearly) this one https://github.com/Harry-Chen/fpga-virtual-console.
I had to get around the ram requirement of 20 address bits and 32 data bits running at 100Mhz.
I simplified the video out to 3k but as usual its not perfect (1 pixel out on left)
I don't think the char rom is correct .
It has 9 bit video so 256 colour is no problem and has the space for 4 different character sets.
The bottom pic is what it should look like if I can get it to talk to the DE10 the other pic should be mcommander but the lines are not being drawn.
You do not have the required permissions to view the files attached to this post.
Old enough to remember B&W TV with 2 channels: Young enough to embrace new technology: Stupid enough to try and get it to work.

Sorgelig
Ultimate Atarian
Ultimate Atarian
Posts: 5274
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: Serial console core. Anyone?

Postby Sorgelig » Thu Jan 24, 2019 3:14 pm

The text mode is basically attribute + text. The raw graphics frame buffer is not required. You just need a small buffer 2bytes per char. So, in this case you don't need SDRAM at all. You can use only BRAM.

oldgit
Atari User
Atari User
Posts: 40
Joined: Mon May 28, 2018 11:05 am

Re: Serial console core. Anyone?

Postby oldgit » Thu Jan 24, 2019 3:51 pm

Sorgelig wrote:The text mode is basically attribute + text. The raw graphics frame buffer is not required. You just need a small buffer 2bytes per char. So, in this case you don't need SDRAM at all. You can use only BRAM.


I got rid of the graphics frame buffer and produce the vga from the text buffer which is 80 x 40 x 32bits as follows
[K][N][B][U][ BG ][ FG ][ CS ][ ASCII ]
31 30 29 28 19 10 8 0

K: Blink
N: Negative ( swaps bg and fg )
B: Bright ( applies brightness/intensity flag to fg )
U: Underline
BG: Background color ( RGB333 )
FG: Foreground color ( RGB333 )
CS: Charset

I just cannot get any response on tty1
Old enough to remember B&W TV with 2 channels: Young enough to embrace new technology: Stupid enough to try and get it to work.

Sorgelig
Ultimate Atarian
Ultimate Atarian
Posts: 5274
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: Serial console core. Anyone?

Postby Sorgelig » Thu Jan 24, 2019 8:47 pm

publish your code and i will check the problem.
Btw, is history buffer (shift+pgup/pgdn) should be handled by console core or it's done on Linux side?

oldgit
Atari User
Atari User
Posts: 40
Joined: Mon May 28, 2018 11:05 am

Re: Serial console core. Anyone?

Postby oldgit » Fri Jan 25, 2019 5:03 pm

Sorgelig wrote:publish your code and i will check the problem.
Btw, is history buffer (shift+pgup/pgdn) should be handled by console core or it's done on Linux side?


The code is a mess, I have just bolted on the vga to get it working. Without a connection on UART it would be difficult to improve.
I have sent you a pm.
Old enough to remember B&W TV with 2 channels: Young enough to embrace new technology: Stupid enough to try and get it to work.

Vlait
Atarian
Atarian
Posts: 2
Joined: Tue Apr 17, 2018 3:58 pm

Re: Serial console core. Anyone?

Postby Vlait » Fri Jan 25, 2019 6:08 pm

just a thought, did you set the tty params same on both side (and wouldn't you be reading ttyS-something if you're interfacing with a serial line ?)
.. and no, did not look into the uart interface on either side so this is just a blind guess from reference dating back to the 90's when we still had serial cards for terminal lines that came with no drivers for unix-like os'es :P

Sorgelig
Ultimate Atarian
Ultimate Atarian
Posts: 5274
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: Serial console core. Anyone?

Postby Sorgelig » Sat Jan 26, 2019 10:03 am

200MHz clock for 80x40 text mode - that's insane :)

Sorgelig
Ultimate Atarian
Ultimate Atarian
Posts: 5274
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: Serial console core. Anyone?

Postby Sorgelig » Sat Jan 26, 2019 10:25 am

to make UART working:

Code: Select all

assign UART_RTS = UART_CTS;
assign UART_DTR = UART_DSR;

oldgit
Atari User
Atari User
Posts: 40
Joined: Mon May 28, 2018 11:05 am

Re: Serial console core. Anyone?

Postby oldgit » Sat Jan 26, 2019 12:42 pm

Sorgelig wrote:200MHz clock for 80x40 text mode - that's insane :)
Thats me 8O

Thanks for the fix for the UART . I shall now see what this LARGE amount of code can do.
Old enough to remember B&W TV with 2 channels: Young enough to embrace new technology: Stupid enough to try and get it to work.

oldgit
Atari User
Atari User
Posts: 40
Joined: Mon May 28, 2018 11:05 am

Re: Serial console core. Anyone?

Postby oldgit » Sat Feb 09, 2019 3:45 pm

I have posted a console core at https://github.com/davewoo999/Virtual-Console

IMPORTANT PLEASE READ THE README I know I sometimes do not.

This is a work in progress (slowly), sometimes I update this core several times a day or only once in a few weeks. I will not update this post unless a major change. The github will always have the dates of the changes made. It is not in the MiSTer portal as it is not good enough at the moment. Any glaring errors or problems please report.
Thanks.
Old enough to remember B&W TV with 2 channels: Young enough to embrace new technology: Stupid enough to try and get it to work.

NML32
Atari Super Hero
Atari Super Hero
Posts: 643
Joined: Tue Mar 11, 2014 1:54 am
Location: USA/Florida

Re: Serial console core. Anyone?

Postby NML32 » Sat Feb 09, 2019 4:53 pm

oldgit wrote:I have posted a console core at https://github.com/davewoo999/Virtual-Console

IMPORTANT PLEASE READ THE README I know I sometimes do not.

This is a work in progress (slowly), sometimes I update this core several times a day or only once in a few weeks. I will not update this post unless a major change. The github will always have the dates of the changes made. It is not in the MiSTer portal as it is not good enough at the moment. Any glaring errors or problems please report.
Thanks.

Thanks.
When I boot up the core I only see a flashing cursor in the upper left part of the screen. It doesn't appear to respond to input.
Should I see a login screen when the core is started?

BBond007
Captain Atari
Captain Atari
Posts: 391
Joined: Wed Feb 28, 2018 3:23 am

Re: Serial console core. Anyone?

Postby BBond007 » Sat Feb 09, 2019 6:52 pm

NML32 wrote:When I boot up the core I only see a flashing cursor in the upper left part of the screen. It doesn't appear to respond to input.
Should I see a login screen when the core is started?


You need to set UART mode to 'Console' in the system menu.

NML32
Atari Super Hero
Atari Super Hero
Posts: 643
Joined: Tue Mar 11, 2014 1:54 am
Location: USA/Florida

Re: Serial console core. Anyone?

Postby NML32 » Sat Feb 09, 2019 8:07 pm

BBond007 wrote:
NML32 wrote:When I boot up the core I only see a flashing cursor in the upper left part of the screen. It doesn't appear to respond to input.
Should I see a login screen when the core is started?


You need to set UART mode to 'Console' in the system menu.

Thanks, it's working great. :)

oldgit
Atari User
Atari User
Posts: 40
Joined: Mon May 28, 2018 11:05 am

Re: Serial console core. Anyone?

Postby oldgit » Sun Feb 10, 2019 9:30 am

BBond007 wrote:
NML32 wrote:When I boot up the core I only see a flashing cursor in the upper left part of the screen. It doesn't appear to respond to input.
Should I see a login screen when the core is started?


You need to set UART mode to 'Console' in the system menu.



Oops - I have amended the readme
Old enough to remember B&W TV with 2 channels: Young enough to embrace new technology: Stupid enough to try and get it to work.


Return to “MiSTer”

Who is online

Users browsing this forum: Atmosfear and 6 guests