I hacked up an implementation of TCGETS2, TCSETS2, TCSETSF2, TCSETSW2 in
QEMU and used it ti run the resolute docker images.

A proper implementation will include:

Functions:

in linux-user/syscall.c:
host_to_target_termios2()
target_to_host_termios2()
print_termios2()

Definitions:

in linux-user/syscall.c
#define termios2 host_termios2

in linux-user/syscall_types.h
STRUCT_SPECIAL(termios2) 

in linux-user/ioctls.h:
IOCTL(TCGETS2, IOC_R, MK_PTR(MK_STRUCT(STRUCT_termios2)))
IOCTL(TCSETS2, IOC_W, MK_PTR(MK_STRUCT(STRUCT_termios2)))
IOCTL(TCSETSF2, IOC_W, MK_PTR(MK_STRUCT(STRUCT_termios2)))
IOCTL(TCSETSW2, IOC_W, MK_PTR(MK_STRUCT(STRUCT_termios2)))

in linux-user/user-internals.h:
void print_termios2(void *arg);


With the hacked up qemu-riscv64 I get:

root@b0ee67925b73:/# tty
/dev/pts/0

root@b0ee67925b73:/# cmake --system-information
Illegal instruction        (core dumped) cmake --system-information


Debugging with GDB is not possible:

Reading symbols from cmake...
Reading symbols from 
/usr/lib/debug/.build-id/ab/670866ae2092b8fb1236f5f740619ad80ab79c.debug...
(gdb) r
Starting program: /usr/bin/cmake --system-information
warning: Error disabling address space randomization: Operation not permitted
warning: Could not trace the inferior process.
warning: ptrace: Function not implemented
During startup program exited with code 127.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2133188

Title:
  Illegal instruction in memset under qemu-user for riscv64

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/2133188/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to