Products > Test Equipment
Linux on CRTU-RU (o;
langwadt:
--- Quote from: kfitch42 on November 09, 2015, 08:01:42 pm ---
--- Quote from: fisafisa on November 08, 2015, 04:56:52 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.
--- End quote ---
/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.
--- End quote ---
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
senseless:
Any news, @davorin or @fisafisa? Should have some spare time the next few days and want to do similar stuff.
senseless:
Just to let you know, after some fiddling around, X is sort of running (will have to add some y shift obviously :D).
fisafisa:
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
senseless:
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...
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version