Author Topic: Linux on CRTU-RU (o;  (Read 11331 times)

0 Members and 1 Guest are viewing this topic.

Offline davorinTopic starter

  • Supporter
  • ****
  • Posts: 922
  • Country: ch
Re: Linux on CRTU-RU (o;
« Reply #25 on: November 14, 2015, 05:12:04 pm »
Hmm...at least something on the built-in Screen....no mouse/keyboard yet due to some odd udev problems...

« Last Edit: November 14, 2015, 05:45:13 pm by davorin »
 

Offline fisafisa

  • Regular Contributor
  • *
  • Posts: 105
  • Country: es
Re: Linux on CRTU-RU (o;
« Reply #26 on: November 27, 2015, 11:10:13 pm »
Any news?
 

Offline Whales

  • Super Contributor
  • ***
  • Posts: 1899
  • Country: au
    • Halestrom
Re: Linux on CRTU-RU (o;
« Reply #27 on: November 27, 2015, 11:22:08 pm »
Are you compiling your own kernel in gentoo or using a precompiled one?  You may find some of the old features are still in the tree, just disabled. 

Offline davorinTopic starter

  • Supporter
  • ****
  • Posts: 922
  • Country: ch
Re: Linux on CRTU-RU (o;
« Reply #28 on: November 28, 2015, 09:36:36 am »
Always compiled the kernel....I might give NetBSD a chance this weekend....
 

Offline fisafisa

  • Regular Contributor
  • *
  • Posts: 105
  • Country: es
Re: Linux on CRTU-RU (o;
« Reply #29 on: November 29, 2015, 05:49:15 pm »
On my part I have reverse engineered part of the hardware interface for the TX/RX board.
So far I have identified that a 2K dual ported RAM is directly mapped on a bus.
There seem also to be at least 18 address bits of which 8 need to have the following bin pattern 110101xx where xx is probably slot dependant. So 0xD4 0xD5 0xD6 0xD7
This ties up with a previous post in this thread!
I suspect the whole protocol is a dialogue between main processor and board processor within the 2K shared ram.

The big FPGA does not seem to play  a role in the bus management.
Only 2 pins connected to it. Maybe clock?

Filippo
 

Offline langwadt

  • Super Contributor
  • ***
  • Posts: 4427
  • Country: dk
Re: Linux on CRTU-RU (o;
« Reply #30 on: November 29, 2015, 07:02:23 pm »
Also useful, under linux, would be a way to map these addresses to user-space, so that one can test things without need to write drivers.

/dev/mem will do that. Something like:

int fd = open("/dev/mem",O_RDWR|O_SYNC);
unsigned char* RxTxMem1 = (unsigned char *) mmap(0, getpagesize(), PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0x000D4000);
unsigned char* RxTxMem2 = (unsigned char *) mmap(0, getpagesize(), PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0x000D5000);

Also, accessing I/O ports from user space is pretty simple:

#include <sys/io.h>
//...
ioperm(0x0100, 0x10, 1);
ioperm(0x0140, 0x30, 1);
//...
uint8_t val8 = inb(0x100); // 8-bit wide read
uint16_t val16 = inw(0x100); // 16-bit wide read
uint32_t val32 = inl(0x100); // 32-bit wide read
outb(val8, 0x100); // 8-bit wide write
outw(val16, 0x100); // 16-bit wide write
outl(val32, 0x100); // 32-bit wide write

Dealing with interrupts from userspace is not as simple. But, writing a very simple driver that can block a userspace process that does a read (or ioctl) on a special file until the interrupt fires isn't that hard. I did it once years ago. The "Linux Device Drivers" O'Reily book is a pretty good resource for these things.

you have to be root to just map mem

the UIO driver maps a memory area for user space and give you interrupt  with a blocking read

 

Offline senseless

  • Contributor
  • Posts: 32
  • Country: de
Re: Linux on CRTU-RU (o;
« Reply #31 on: April 26, 2020, 03:05:01 pm »
Any news, @davorin or @fisafisa? Should have some spare time the next few days and want to do similar stuff.
 

Offline senseless

  • Contributor
  • Posts: 32
  • Country: de
Re: Linux on CRTU-RU (o;
« Reply #32 on: May 04, 2020, 07:37:36 pm »
Just to let you know, after some fiddling around, X is sort of running (will have to add some y shift obviously :D).
 

Offline fisafisa

  • Regular Contributor
  • *
  • Posts: 105
  • Country: es
Re: Linux on CRTU-RU (o;
« Reply #33 on: May 04, 2020, 07:53:47 pm »
no progress here.
Just using the uinit as is.
How did you achieve this?
Next step would be to try run the dos software under emulation, but would it be able to access the bus?

Good work anyway.

F
 

Offline senseless

  • Contributor
  • Posts: 32
  • Country: de
Re: Linux on CRTU-RU (o;
« Reply #34 on: May 04, 2020, 10:37:13 pm »
Got it working now :-+

Well, it was a lot of trial and error in the end. First, installing it was a pain, cause I had no medium to boot from (USB sticks not working, USB-CDROM/USB-FDD would). I ended up using unetbootin with the harddrive install option on the win2k partition.
Then, i compiled an additional kernel module for the graphics unit (don't actually know if that was necessary in the end, have to test it..). And in the end a lot of trying different xorg.confs, Modeline settings and grub2 parameters.
Regarding emulation, yes, that is the next step now. I am not really sure what the best option would be. After talking to the QEMU guys, they don't have support for ISA passthrough, although that shouldn't be to hard to implement rudimentary if there are no interrupts involved (I don't think there are any for the interesting boards, win2k drivers only show I/O and mem (except for the MacSpeech board?)). Getting DOS running in QEMU is easy though.
Dosemu (abandoned, dosemu2 is active) on the other hand could potentially have support for it, but it is much harder to get DOS running there...
 

Offline markus_jlrb

  • Regular Contributor
  • *
  • Posts: 141
  • Country: de
Re: Linux on CRTU-RU (o;
« Reply #35 on: May 13, 2020, 10:54:30 am »
@senseless

are you willing to share the configured linux image or
the configure/make Files to build it as well as grub2
config ;-)

Markus
Owner of a CMU200
See posts in https://www.mikrocontroller.net/topic/433164#6262821
 

Offline senseless

  • Contributor
  • Posts: 32
  • Country: de
Re: Linux on CRTU-RU (o;
« Reply #36 on: May 14, 2020, 09:18:23 pm »
Yeah, sooner or later I will release some additional info on how to replicate it on your machine, but it is still a mess..

During reverse engineering the software of the "cmud" executable (of V5.21), I came across some password protected functions, namely "eep_wrtsrncmu" (write serial number??) and "eep_sbhoc" (no idea what it means). Didn't take too long to figure out the passwords: "CIVIDARHSP" ( :wtf: ) for the first and "weissbier" for the second. Who would have guessed that considering that Rohde&Schwarz is based in Munich, Bavaria :-DD
 
The following users thanked this post: fisafisa, m.p.h

Offline RShacker

  • Newbie
  • Posts: 2
  • Country: de
Re: Linux on CRTU-RU (o;
« Reply #37 on: June 28, 2020, 09:19:05 pm »
Finally with my own account now...
So after reverse engineering the hack out of the 'cmud' executable (I guess I spent ~200 hours on it...), I finally got a good understanding of how it is communicating with the hardware.
As a short and quick proof, here is a video of the worlds most famous application 'blinky':
 
The following users thanked this post: Qw3rtzuiop, snickers

Offline fisafisa

  • Regular Contributor
  • *
  • Posts: 105
  • Country: es
Re: Linux on CRTU-RU (o;
« Reply #38 on: June 29, 2020, 10:29:58 pm »
Cool!

Looking forward to read more about this.
It would be great if we can get a bit more about that device.

Filippo :-+
 

Offline fisafisa

  • Regular Contributor
  • *
  • Posts: 105
  • Country: es
Re: Linux on CRTU-RU (o;
« Reply #39 on: July 02, 2020, 10:28:14 pm »
Hi.
I did not know about cmud.exe DOS program.
I found the only other reference in some elektor chat logs.

So are you running the original cmud on Linux, or did you make a Linux version?

Ciao
 

Offline RShacker

  • Newbie
  • Posts: 2
  • Country: de
Re: Linux on CRTU-RU (o;
« Reply #40 on: July 11, 2020, 11:35:15 am »
If you are running the regular DOS program, you can press alt+f4 and you will end up on the DOS command line interface. IIRC under C://CMU/BIN_V5.21/TOOLS you can find the cmud.exe. It stands for CMU Debugger and you have the possibility to setup different hardware parts separately, get some hardware and version information, read some EEPROMs and so on. As it does not contain any GUI stuff, is much smaller than the full GUI DOS program (base.exe), and you can infer what part of the code is doing what from the available commands (and allowing to run them separately), I started reverse engineering that executable.

And no, what I have shown is completely rewritten based on the RE findings. Currently, the MMIO an I/O Ports stuff is working; some I2C communication is work in progress.
 
The following users thanked this post: ps

Offline fisafisa

  • Regular Contributor
  • *
  • Posts: 105
  • Country: es
Re: Linux on CRTU-RU (o;
« Reply #41 on: July 12, 2020, 08:07:03 pm »
Good idea.
reverse engineering a simple test program is certainly easier.

In any case, what is your plan?
What objective are you trying to achieve?

The knowledge your are obtaining may come useful in repairing one of these units in the future.
So please consider sharing it.

Nice job in any case.
Filippo
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf