From e2a9ef71d6a1e4915b6fbcf519571381ce8c2bc1 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Micha=C5=82=20Januszewski?= Date: Thu, 7 Jun 2007 21:01:56 +0200 Subject: [PATCH] v86d: add support for ESBX buffers --- Makefile | 13 ++++++++++++- TODO | 2 -- main.c | 27 +++++++++++++++------------ v86.h | 5 ++++- v86_lrmi.c | 5 +++++ 5 files changed, 36 insertions(+), 16 deletions(-) diff --git a/Makefile b/Makefile index 8b854d9..eb99009 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,12 @@ -CFLAGS += -I/lib/modules/$(shell uname -r)/source/include +ifeq ($(strip $(LIBC)),klibc) + CC = klcc + LDFLAGS += -Llibs/lrmi-0.10 -static + CFLAGS += -Ilibs/lrmi-0.10 +else + CFLAGS += -I/lib/modules/$(shell uname -r)/source/include +endif + +INSTALL = install all: v86d @@ -8,3 +16,6 @@ v86d: main.o v86_lrmi.o clean: rm -rf *.o v86d +install: + $(INSTALL) -D v86d $(DESTDIR)/sbin/v86d + diff --git a/TODO b/TODO index 0bc549f..9c37e28 100644 --- a/TODO +++ b/TODO @@ -3,8 +3,6 @@ userspace: kernelspace: - finish driver probe and remove functions -- finish monitor limits settings - - check why EDID parsing doesn't work under X - task_prep -> check for failed memory allocations general: diff --git a/main.c b/main.c index 9784b3f..a7300a2 100644 --- a/main.c +++ b/main.c @@ -1,11 +1,3 @@ -#include -#include - -#include -#include - -#include - #include #include #include @@ -14,6 +6,14 @@ #include #include +#include +#include + +#include +#include + +#include + #include "v86.h" static int need_exit; @@ -24,7 +24,7 @@ static int netlink_send(int s, struct cn_msg *msg) struct nlmsghdr *nlh; unsigned int size; int err; - char buf[1024]; + char buf[CONNECTOR_MAX_MSG_SIZE]; struct cn_msg *m; size = NLMSG_SPACE(sizeof(struct cn_msg) + msg->len); @@ -52,9 +52,7 @@ int req_exec(int s, struct cn_msg *msg) u8 *buf = (u8*)tsk + sizeof(struct uvesafb_task); int i; -// ulog("performing request\n"); v86_task(tsk, buf); -// ulog("request done\n"); netlink_send(s, msg); return 0; @@ -64,7 +62,7 @@ int req_exec(int s, struct cn_msg *msg) int main(int argc, char *argv[]) { int s; - char buf[1024]; + char buf[CONNECTOR_MAX_MSG_SIZE]; int len, i; struct nlmsghdr *reply; struct sockaddr_nl l_local; @@ -72,6 +70,8 @@ int main(int argc, char *argv[]) time_t tm; struct pollfd pfd; + FILE *fout; + s = socket(PF_NETLINK, SOCK_DGRAM, NETLINK_CONNECTOR); if (s == -1) { perror("socket"); @@ -96,6 +96,8 @@ int main(int argc, char *argv[]) setsid(); chdir("/"); + openlog("v86d", 0, LOG_KERN); + if (v86_init()) return -1; @@ -151,6 +153,7 @@ int main(int argc, char *argv[]) } } + closelog(); close(s); return 0; } diff --git a/v86.h b/v86.h index f7ca0d5..39f1de6 100644 --- a/v86.h +++ b/v86.h @@ -2,6 +2,7 @@ #define __H_V86 #include +#include #include #include #include @@ -15,7 +16,9 @@ struct completion; #include "kernel/uvesafb.h" //#define ulog(args...) do {} while (0) -#define ulog(args...) fprintf(stdout, ##args) +//#define ulog(args...) fprintf(stdout, ##args) + +#define ulog(args...) syslog(LOG_INFO, ##args) int v86_init(); int v86_int(int num, struct vm86_regs *regs); diff --git a/v86_lrmi.c b/v86_lrmi.c index b4c2650..f8a1ee0 100644 --- a/v86_lrmi.c +++ b/v86_lrmi.c @@ -118,6 +118,11 @@ out_vbeib: tsk->regs.edi = 0x0000; } + if (tsk->flags & TF_BUF_ESBX) { + tsk->regs.es = (u32)lbuf >> 4; + tsk->regs.ebx = 0x0000; + } + if (v86_int(0x10, &tsk->regs) || (tsk->regs.eax & 0xffff) != 0x004f) goto out; -- 2.11.4.GIT