x86emu: add support for the rdtsc opcode
[v86d.git] / testvbe.c
blob8aa39319d938bfd4d5ff61c1fad557ffb8995f3f
1 #include <stdio.h>
2 #include <stdlib.h>
3 #include <unistd.h>
4 #include <string.h>
5 #include <errno.h>
6 #include <time.h>
7 #include <fcntl.h>
9 #include <sys/socket.h>
10 #include <sys/poll.h>
12 #include <linux/netlink.h>
13 #include <linux/rtnetlink.h>
15 #include <arpa/inet.h>
17 #include "v86.h"
19 int main(int argc, char *argv[])
21 struct uvesafb_task tsk;
22 u8 buf[4096];
24 if (v86_init())
25 return -1;
27 tsk.regs.eax = 0x4f00;
28 tsk.flags = TF_VBEIB;
29 tsk.buf_len = sizeof(struct vbe_ib);
30 strncpy(&(((struct vbe_ib*)buf)->vbe_signature), "VBE2", 4);
32 v86_task(&tsk, buf);
34 printf("%s\n", ((struct vbe_ib*)buf)->oem_vendor_name_ptr + buf);
36 tsk.regs.eax = 0x4f02;
37 tsk.regs.ebx = 0x0118;
38 tsk.buf_len = 0;
39 tsk.flags = 0;
41 v86_task(&tsk, buf);
43 printf("got eax = %x\n", tsk.regs.eax);
45 v86_cleanup();
47 return 0;