Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!batcomputer!munnari.oz.au!manuel!anucsd!pdact!dbell From: dbell@pdact.pd.necisa.oz.au (David I. Bell) Newsgroups: comp.os.minix Subject: MINI-X graphics package (part 1/9) Message-ID: <992@pdact.pd.necisa.oz.au> Date: 22 Apr 91 00:48:12 GMT Organization: NEC Information Systems Australia, Canberra Lines: 2044 This is my mini-X graphics package for 32-bit IBM PC MINIX. Enjoy, and let me know if there are any problems. David I. Bell dbell@pdact.pd.necisa.oz.au #! /bin/sh # This is a shell archive. Remove anything before this line, then unpack # it by saving it into a file and typing "sh file". To overwrite existing # files, type "sh file -c". You can also feed this as standard input via # unshar, or by typing "sh 'mini-x/CRCS' <<'END_OF_FILE' X62472 2528 FILES X11163 22803 README X18215 45475 TUTORIAL X30700 9582 clients/demo.c X23193 472 clients/makefile X48396 181 clients/tm.c X07810 623 cpp/cpp5.c.cdif X26598 429 cpp/cpp6.c.cdif X14859 502 fs/table.c.cdif X23825 5685 include/graph_msg.h X44796 14242 include/graphics.h X47124 676 kernel/cstart.c.cdif X19215 8077 kernel/cursor_gen.c X57267 18881 kernel/ega.x X37490 483 kernel/glo.h.cdif X63954 8352 kernel/graph_clip.c X55049 3989 kernel/graph_dev.h X58440 14152 kernel/graph_ega.c X48462 11017 kernel/graph_gen.c X28400 21918 kernel/graph_main.c X43163 19967 kernel/graphics.c X58006 2827 kernel/klib386.x.cdif X11354 2505 kernel/makefile.cdif X23516 2119 kernel/makefile.cpp.c X03828 4726 kernel/makefile.cpp.n X32556 3325 kernel/makefile.new X26435 294 kernel/proto.h.cdif X21896 571 kernel/start.x.cdif X63621 736 kernel/start.x.insert X10882 1162 kernel/table.c.cdif X28761 619 kernel/tty.c.cdif X14280 16055 server/client.c X21673 9325 server/graph_serv.h X40374 2281 server/keyboard.c X29806 965 server/makefile X42686 4826 server/mouse.c X59503 6673 server/mousedev.c X05554 21102 server/serv_dev.c X23366 16971 server/serv_event.c X39406 33072 server/serv_func.c X53799 5039 server/serv_main.c X14628 26728 server/serv_util.c END_OF_FILE if test 1292 -ne `wc -c <'mini-x/CRCS'`; then echo shar: \"'mini-x/CRCS'\" unpacked with wrong size! fi # end of 'mini-x/CRCS' fi if test -f 'mini-x/FILES' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'mini-x/FILES'\" else echo shar: Extracting \"'mini-x/FILES'\" \(2528 characters\) sed "s/^X//" >'mini-x/FILES' <<'END_OF_FILE' XFILES this file giving summary of changes to files XCRCS checksums for files in the package XREADME overall description and installation instructions XTUTORIAL tutorial in concepts and usage of graphics routines X Xfs/table.c.cdif diff of table.c: add graphics device interface X Xkernel/makefile.cdif diff of makefile: add graphics device files Xkernel/makefile.cpp.c diff of makefile.cpp: add graphics device files Xkernel/makefile.new complete copy of new makefile Xkernel/makefile.cpp.n complete copy of new makefile.cpp Xkernel/cstart.c.cdif diff of cstart.c: get rom character table address Xkernel/glo.h.cdif diff of glo.h: add external symbol rom_char_addr Xkernel/klib386.x.cdif diff of klib386.x: add put_byte routine Xkernel/proto.h.cdif diff of proto.h: add graphics task definition Xkernel/start.x.cdif diff of start.x: add get_rom_char_addr definition Xkernel/start.x.insert insert for start.x: add get_rom_char_addr routine Xkernel/table.c.cdif diff of table.c: add graphics task definitions Xkernel/tty.c.cdif diff of tty.c: make non-blocking reads work Xkernel/graph_dev.h new: global definitions for graphics device Xkernel/graphics.c new: graphics device driver Xkernel/graph_clip.c new: clipping routines Xkernel/graph_gen.c new: generic drawing routines Xkernel/graph_main.c new: top-level drawing routines Xkernel/graph_ega.c new: EGA graphics high-level routines Xkernel/ega.x new: EGA graphics assembly routines Xkernel/cursor_gen.c new: software cursor routines X Xserver/makefile new: makefile to build graphics server library Xserver/graph_serv.h new: global definitions for graphics server Xserver/client.c new: routines called by client programs Xserver/serv_dev.c new: interface routines to kernel graphics device Xserver/serv_event.c new: event routines Xserver/serv_func.c new: interface routines to call graphics server Xserver/serv_main.c new: graphics server initialization Xserver/serv_util.c new: utility routines for graphics server Xserver/keyboard.c new: keyboard interface Xserver/mouse.c new: mouse high-level interface Xserver/mousedev.c new: mouse low-level interface X Xclients/makefile new: makefile to build client programs Xclients/demo.c new: demonstration program for graphics Xclients/tm.c new: utility to reset terminal back to text mode X Xinclude/graphics.h new: public include file in /usr/include Xinclude/graph_msg.h new: server/kernel include file in /usr/include/minix X Xcpp/cpp5.c.cdif diff of cpp5.c: fix for undefined symbol errors Xcpp/cpp5.c.cdif diff of cpp5.c: fix for misquoted string errors END_OF_FILE if test 2528 -ne `wc -c <'mini-x/FILES'`; then echo shar: \"'mini-x/FILES'\" unpacked with wrong size! fi # end of 'mini-x/FILES' fi if test -f 'mini-x/clients/makefile' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'mini-x/clients/makefile'\" else echo shar: Extracting \"'mini-x/clients/makefile'\" \(472 characters\) sed "s/^X//" >'mini-x/clients/makefile' <<'END_OF_FILE' XCFLAGS = -i -O XLDFLAGS = -i XINCLUDES = /usr/include/graphics.h XLIBRARIES = /usr/local/lib/i386/libgraph.a XBINDIR = /bin XPROGS = demo tm X X Xall: $(PROGS) X Xinstall: $(PROGS) X cp $(PROGS) $(BINDIR) X cd $(BINDIR); strip $(PROGS); chmod 755 $(PROGS) X Xclean: X rm -rf $(PROGS) *.o X Xdemo: demo.o $(LIBRARIES) X cc -o demo $(LDFLAGS) demo.o -lgraph X chmem =24000 demo X Xtm: tm.o $(LIBRARIES) X cc -o tm $(LDFLAGS) tm.o -lgraph X chmem =8192 tm X X Xtm.o: $(INCLUDES) Xdemo.o: $(INCLUDES) END_OF_FILE if test 472 -ne `wc -c <'mini-x/clients/makefile'`; then echo shar: \"'mini-x/clients/makefile'\" unpacked with wrong size! fi # end of 'mini-x/clients/makefile' fi if test -f 'mini-x/clients/tm.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'mini-x/clients/tm.c'\" else echo shar: Extracting \"'mini-x/clients/tm.c'\" \(181 characters\) sed "s/^X//" >'mini-x/clients/tm.c' <<'END_OF_FILE' X/* X * Reset the terminal back to text mode. X * This is done by simply opening the graphics screen and closing it again. X */ X#include "graphics.h" X Xmain() X{ X GrOpen(); X GrClose(); X} END_OF_FILE if test 181 -ne `wc -c <'mini-x/clients/tm.c'`; then echo shar: \"'mini-x/clients/tm.c'\" unpacked with wrong size! fi # end of 'mini-x/clients/tm.c' fi if test -f 'mini-x/cpp/cpp5.c.cdif' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'mini-x/cpp/cpp5.c.cdif'\" else echo shar: Extracting \"'mini-x/cpp/cpp5.c.cdif'\" \(623 characters\) sed "s/^X//" >'mini-x/cpp/cpp5.c.cdif' <<'END_OF_FILE' X*** old/cpp5.c Sun Apr 21 12:17:37 1991 X--- cpp5.c Sat Apr 20 16:04:30 1991 X*************** X*** 417,424 **** X * warning except where the programmer was careful to write X * #if defined(foo) ? foo : 0 X */ X! if (!skip) X! cwarn("undefined symbol \"%s\" in #if, 0 used", token); X evalue = 0; X return (DIG); X } X--- 417,426 ---- X * warning except where the programmer was careful to write X * #if defined(foo) ? foo : 0 X */ X! #if 0 X! if (!skip) X! cwarn("undefined symbol \"%s\" in #if, 0 used", token); X! #endif X evalue = 0; X return (DIG); X } END_OF_FILE if test 623 -ne `wc -c <'mini-x/cpp/cpp5.c.cdif'`; then echo shar: \"'mini-x/cpp/cpp5.c.cdif'\" unpacked with wrong size! fi # end of 'mini-x/cpp/cpp5.c.cdif' fi if test -f 'mini-x/cpp/cpp6.c.cdif' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'mini-x/cpp/cpp6.c.cdif'\" else echo shar: Extracting \"'mini-x/cpp/cpp6.c.cdif'\" \(429 characters\) sed "s/^X//" >'mini-x/cpp/cpp6.c.cdif' <<'END_OF_FILE' X*** old/cpp6.c Sun Apr 21 12:17:43 1991 X--- cpp6.c Sat Apr 20 16:04:31 1991 X*************** X*** 295,302 **** X return (TRUE); X } X else { X! if (!eflag) X! cerror("Unterminated string", NULLST); X unget(); X return (FALSE); X } X--- 295,304 ---- X return (TRUE); X } X else { X! #if 0 X! if (!eflag) X! cerror("Unterminated string", NULLST); X! #endif X unget(); X return (FALSE); X } END_OF_FILE if test 429 -ne `wc -c <'mini-x/cpp/cpp6.c.cdif'`; then echo shar: \"'mini-x/cpp/cpp6.c.cdif'\" unpacked with wrong size! fi # end of 'mini-x/cpp/cpp6.c.cdif' fi if test -f 'mini-x/fs/table.c.cdif' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'mini-x/fs/table.c.cdif'\" else echo shar: Extracting \"'mini-x/fs/table.c.cdif'\" \(502 characters\) sed "s/^X//" >'mini-x/fs/table.c.cdif' <<'END_OF_FILE' X*** ../old/fs/table.c Sun Jan 27 10:54:20 1991 X--- table.c Tue Mar 12 21:52:41 1991 X*************** X*** 111,116 **** X--- 111,117 ---- X tty_open, rw_dev, no_call, TTY, /* 4 = /dev/tty0 */ X no_call, rw_dev2, no_call, TTY, /* 5 = /dev/tty */ X no_call, rw_dev, no_call, PRINTER, /* 6 = /dev/lp */ X+ no_call, rw_dev, no_call, GRAPHICS, /* 7 = /dev/graphics */ X }; X X PUBLIC int max_major = sizeof(dmap)/sizeof(struct dmap); END_OF_FILE if test 502 -ne `wc -c <'mini-x/fs/table.c.cdif'`; then echo shar: \"'mini-x/fs/table.c.cdif'\" unpacked with wrong size! fi # end of 'mini-x/fs/table.c.cdif' fi if test -f 'mini-x/kernel/cstart.c.cdif' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'mini-x/kernel/cstart.c.cdif'\" else echo shar: Extracting \"'mini-x/kernel/cstart.c.cdif'\" \(676 characters\) sed "s/^X//" >'mini-x/kernel/cstart.c.cdif' <<'END_OF_FILE' X*** ../old/kernel/cstart.c Tue Mar 5 22:13:16 1991 X--- cstart.c Tue Mar 26 22:16:46 1991 X*************** X*** 42,47 **** X--- 42,50 ---- X FORWARD char *k_getenv(); X FORWARD void rel_vec(); X X+ EXTERN u32_t get_rom_char_addr(); X+ X+ X /*==========================================================================* X * cstart * X *==========================================================================*/ X*************** X*** 99,104 **** X--- 102,108 ---- X /* Get information from the BIOS. */ X color = get_chrome(); X ega = get_ega(); X+ rom_char_addr = get_rom_char_addr(); X ext_memsize = get_ext_memsize(); X low_memsize = get_low_memsize(); X END_OF_FILE if test 676 -ne `wc -c <'mini-x/kernel/cstart.c.cdif'`; then echo shar: \"'mini-x/kernel/cstart.c.cdif'\" unpacked with wrong size! fi # end of 'mini-x/kernel/cstart.c.cdif' fi if test -f 'mini-x/kernel/glo.h.cdif' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'mini-x/kernel/glo.h.cdif'\" else echo shar: Extracting \"'mini-x/kernel/glo.h.cdif'\" \(483 characters\) sed "s/^X//" >'mini-x/kernel/glo.h.cdif' <<'END_OF_FILE' X*** ../old/kernel/glo.h Tue Mar 5 22:13:22 1991 X--- glo.h Sun Mar 24 17:39:26 1991 X*************** X*** 42,47 **** X--- 42,48 ---- X EXTERN int ega; /* nonzero if console is EGA */ X EXTERN int scan_code; /* scan code of key pressed to start minix */ X EXTERN int snow; /* nonzero if screen needs snow removal */ X+ EXTERN u32_t rom_char_addr; /* address of rom character table */ X X /* Memory sizes. */ X EXTERN unsigned ext_memsize; /* initialized by assembler startup code */ END_OF_FILE if test 483 -ne `wc -c <'mini-x/kernel/glo.h.cdif'`; then echo shar: \"'mini-x/kernel/glo.h.cdif'\" unpacked with wrong size! fi # end of 'mini-x/kernel/glo.h.cdif' fi if test -f 'mini-x/kernel/graph_dev.h' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'mini-x/kernel/graph_dev.h'\" else echo shar: Extracting \"'mini-x/kernel/graph_dev.h'\" \(3989 characters\) sed "s/^X//" >'mini-x/kernel/graph_dev.h' <<'END_OF_FILE' X/* Copyright (c) 1991 David I. Bell X * Permission is granted to use, distribute, or modify this source, X * provided that this copyright notice remains intact. X * X * mini-X graphics - kernel private definitions X */ X X#ifndef GRAPH_DEV_H X#define GRAPH_DEV_H X X#include X X X/* Pixel packings within words. */ X#define GR_BITMAPBITS (sizeof(GR_BITMAP) * 8) X#define GR_ZEROBITS ((GR_BITMAP) 0x0000) X#define GR_ONEBITS ((GR_BITMAP) 0xffff) X#define GR_FIRSTBIT ((GR_BITMAP) 0x8000) X#define GR_LASTBIT ((GR_BITMAP) 0x0001) X#define GR_BITVALUE(n) ((GR_BITMAP) (((GR_BITMAP) 1) << (n))) X#define GR_SHIFTBIT(m) ((GR_BITMAP) ((m) << 1)) X#define GR_NEXTBIT(m) ((GR_BITMAP) ((m) >> 1)) X#define GR_TESTBIT(m) (((m) & GR_FIRSTBIT) != 0) X X Xtypedef struct { X int (*init) (); /* init graphics mode for device */ X void (*term) (); /* terminate graphics mode for device */ X void (*setmode) (); /* set drawing mode */ X void (*drawpoint) (); /* draw point */ X void (*drawline) (); /* draw line */ X void (*drawrow) (); /* draw horizontal line */ X void (*drawcol) (); /* draw vertical line */ X void (*fillrect) (); /* draw filled in rectangle */ X void (*drawellipse) (); /* draw ellipse */ X void (*fillellipse) (); /* fill ellipse */ X void (*drawtext) (); /* draw text string */ X void (*sizetext) (); /* return size of text string */ X void (*drawarea8) (); /* draw area with 8 bit color values */ X void (*drawbitmap) (); /* draw bitmap */ X GR_COLOR(*readpoint) (); /* read pixel value */ X void (*setcursor) (); /* set cursor size and shape */ X void (*movecursor) (); /* move location of cursor */ X void (*checkcursor) (); /* check cursor for overlapped io */ X void (*fixcursor) (); /* fix back cursor after overlaps */ X void (*copyarea) (); /* copy rectangular area */ X void (*getcharbits) (); /* return bitmap for character */ X void (*getscreeninfo) (); /* return screen configuration info */ X void (*getfontinfo) (); /* return font information */ X X /* Data values which are constants of the device. */ X GR_SIZE rows; /* number of rows in device */ X GR_SIZE cols; /* number of columns in device */ X long colors; /* number of colors for device */ X GR_COLOR black; /* color value for black */ X GR_COLOR white; /* color value for white */ X} GR_DEV; X XEXTERN GR_DEV gr_dev; /* device for drawing */ X X X/* Other useful global symbols. */ XEXTERN GR_MODE gr_mode; /* current drawing mode */ XEXTERN GR_COLOR gr_foreground; /* foreground color */ XEXTERN GR_COLOR gr_background; /* background color */ XEXTERN GR_BOOL gr_usebg; /* TRUE if use background in pixmaps */ XEXTERN GR_BOOL gr_error; /* TRUE if had graphics error */ X X X/* Clip cache rectangle information. X * After calling clipcheck, this rectangle is guaranteed to contain the X * specified point (among others), and all points in the rectangle are X * plottable or not according to the value of clipresult. X */ XEXTERN GR_COORD clipminx; /* minimum x value of cache rectangle */ XEXTERN GR_COORD clipminy; /* minimum y value of cache rectangle */ XEXTERN GR_COORD clipmaxx; /* maximum x value of cache rectangle */ XEXTERN GR_COORD clipmaxy; /* maximum y value of cache rectangle */ XEXTERN GR_BOOL clipresult; /* whether clip rectangle is plottable */ X X#define GR_CLIP_INVISIBLE 0 /* clip area is invisible */ X#define GR_CLIP_VISIBLE 1 /* clip area is visible */ X#define GR_CLIP_PARTIAL 2 /* clip area may be partially visible */ X X X/* Generic routines for drawing which use other primitives. */ Xextern void gen_drawline(); Xextern void gen_drawrow(); Xextern void gen_drawcol(); Xextern void gen_fillrect(); Xextern void gen_drawellipse(); Xextern void gen_fillellipse(); Xextern void gen_drawtext(); Xextern void gen_drawarea8(); Xextern void gen_drawbitmap(); Xextern void gen_initcursor(); Xextern void gen_setcursor(); Xextern void gen_movecursor(); Xextern void gen_checkcursor(); Xextern void gen_fixcursor(); Xextern void gen_copyarea(); X Xextern GR_BOOL clippoint(); Xextern int cliparea(); X X#endif X X/* END CODE */ END_OF_FILE if test 3989 -ne `wc -c <'mini-x/kernel/graph_dev.h'`; then echo shar: \"'mini-x/kernel/graph_dev.h'\" unpacked with wrong size! fi # end of 'mini-x/kernel/graph_dev.h' fi if test -f 'mini-x/kernel/klib386.x.cdif' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'mini-x/kernel/klib386.x.cdif'\" else echo shar: Extracting \"'mini-x/kernel/klib386.x.cdif'\" \(2827 characters\) sed "s/^X//" >'mini-x/kernel/klib386.x.cdif' <<'END_OF_FILE' X*** ../old/kernel/klib386.x Tue Mar 5 22:13:24 1991 X--- klib386.x Tue Apr 16 22:35:01 1991 X*************** X*** 9,14 **** X--- 9,15 ---- X .define _cim_xt_wini X .define _cp_mess X .define _get_byte X+ .define _put_byte X .define _in_byte X .define _klib_1hook X .define _klib_2hook X*************** X*** 260,289 **** X X X |*===========================================================================* X! |* in_byte * X! |*===========================================================================* X! | PUBLIC unsigned in_byte(port_t port); X! | Read an (unsigned) byte from the i/o port port and return it. X! X! _in_byte: X! mov edx,4(esp) | port X! sub eax,eax X! in | read 1 byte X ret X X X |*===========================================================================* X! |* klib_1hook * X! |*===========================================================================* X! | PUBLIC void klib_1hook(); X! | Initialize klib from real mode for protected mode (no real mode). X! | Nothing to do. X! X! _klib_1hook: X! ret | cheat: opcode same for 16/32-bits X X X |*===========================================================================* X |* klib_2hook * X |*===========================================================================* X | PUBLIC void klib_2hook(); X--- 261,306 ---- X X X |*===========================================================================* X! |* put_byte * X! |*===========================================================================* X! | PUBLIC void put_byte(u32_t segment, u32_t *offset, data); X! | Store the data byte at the far pointer segment:offset. X! X! _put_byte: X! mov cx,ds X! mov ds,4(esp) | segment X! mov eax,4+4(esp) | offset X! mov ebx,4+4+4(esp) | data byte X! movb (eax),bl | byte to store X! mov ds,cx X ret X X X |*===========================================================================* X! |* in_byte * X! |*===========================================================================* X! | PUBLIC unsigned in_byte(port_t port); X! | Read an (unsigned) byte from the i/o port port and return it. X! X! _in_byte: X! mov edx,4(esp) | port X! sub eax,eax X! in | read 1 byte X! ret X X X |*===========================================================================* X+ |* klib_1hook * X+ |*===========================================================================* X+ | PUBLIC void klib_1hook(); X+ | Initialize klib from real mode for protected mode (no real mode). X+ | Nothing to do. X+ X+ _klib_1hook: X+ ret | cheat: opcode same for 16/32-bits X+ X+ X+ |*===========================================================================* X |* klib_2hook * X |*===========================================================================* X | PUBLIC void klib_2hook(); END_OF_FILE if test 2827 -ne `wc -c <'mini-x/kernel/klib386.x.cdif'`; then echo shar: \"'mini-x/kernel/klib386.x.cdif'\" unpacked with wrong size! fi # end of 'mini-x/kernel/klib386.x.cdif' fi if test -f 'mini-x/kernel/makefile.cdif' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'mini-x/kernel/makefile.cdif'\" else echo shar: Extracting \"'mini-x/kernel/makefile.cdif'\" \(2505 characters\) sed "s/^X//" >'mini-x/kernel/makefile.cdif' <<'END_OF_FILE' X*** ../old/kernel/makefile Mon Mar 4 21:05:43 1991 X--- makefile Sat Apr 20 13:35:08 1991 X*************** X*** 1,4 **** X- X AS =as -3 X BIN =/etc/system X CC =cc -3 X--- 1,3 ---- X*************** X*** 15,21 **** X s =/usr/include/sys X X KEROBJS =cstart.o protect.o protect1.o klib.o mpx.o wini.o table.o main.o tty.o floppy.o system.o proc.o clock.o memory.o console.o rs232.o rs2.o printer.o dmp.o exception.o i8259.o misc.o keyboard.o X! SOBJS =start.s klib.s mpx.s rs2.s X X .SUFFIXES: .x X .x.s: X--- 14,20 ---- X s =/usr/include/sys X X KEROBJS =cstart.o protect.o protect1.o klib.o mpx.o wini.o table.o main.o tty.o floppy.o system.o proc.o clock.o memory.o console.o rs232.o rs2.o printer.o dmp.o exception.o i8259.o misc.o keyboard.o graphics.o graph_main.o graph_gen.o graph_clip.o cursor_gen.o graph_ega.o ega.o X! SOBJS =start.s klib.s mpx.s rs2.s ega.s X X .SUFFIXES: .x X .x.s: X*************** X*** 33,41 **** X $(BIN)/kernel: $(START) $(KEROBJS) $(LIBS) $(END) X $(LD) $(LDFLAGS) -o $(BIN)/kernel $(START) $(KEROBJS) $(LIBS) $(END) X clean: X- X- X- X rm -f $(START) $(KEROBJS) $(SOBJS) X X X--- 32,37 ---- X*************** X*** 43,48 **** X--- 39,45 ---- X mpx.s: $h/config.h $h/const.h $h/com.h const.h protect.h sconst.h mpx.x X rs2.s: $h/config.h $h/const.h const.h sconst.h rs2.x X start.s: $h/config.h $h/const.h $h/com.h const.h protect.h sconst.h start.x X+ ega.s: $h/config.h $h/const.h $h/com.h const.h protect.h sconst.h ega.x X X start.o: start.s X $(AS) -0 -a start.s -o start.o X*************** X*** 64,73 **** X cstart.o: $a X cstart.o: $h/boot.h X cstart.o: cstart.c X- X bcc -0 -c $(CFLAGS) cstart.c X X X dmp.o: $a X dmp.o: $h/callnr.h X dmp.o: $h/com.h X--- 61,74 ---- X cstart.o: $a X cstart.o: $h/boot.h X cstart.o: cstart.c X bcc -0 -c $(CFLAGS) cstart.c X X X+ cursor_gen.o: $a X+ cursor_gen.o: $i/graphics.h X+ cursor_gen.o: $h/graph_msg.h X+ cursor_gen.o: graph_dev.h X+ X dmp.o: $a X dmp.o: $h/callnr.h X dmp.o: $h/com.h X*************** X*** 81,86 **** X--- 82,108 ---- X floppy.o: $h/callnr.h X floppy.o: $h/com.h X X+ graphics.o: $a X+ graphics.o: $i/graphics.h X+ graphics.o: $h/graph_msg.h X+ graphics.o: graph_dev.h X+ X+ graph_clip.o: $a X+ graph_clip.o: $i/graphics.h X+ graph_clip.o: graph_dev.h X+ X+ graph_ega.o: $a X+ graph_ega.o: $i/graphics.h X+ graph_ega.o: graph_dev.h X+ X+ graph_gen.o: $a X+ graph_gen.o: $i/graphics.h X+ graph_gen.o: graph_dev.h X+ X+ graph_main.o: $a X+ graph_main.o: $i/graphics.h X+ graph_main.o: graph_dev.h X+ X i8259.o: $a X X keyboard.o: $a END_OF_FILE if test 2505 -ne `wc -c <'mini-x/kernel/makefile.cdif'`; then echo shar: \"'mini-x/kernel/makefile.cdif'\" unpacked with wrong size! fi # end of 'mini-x/kernel/makefile.cdif' fi if test -f 'mini-x/kernel/makefile.cpp.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'mini-x/kernel/makefile.cpp.c'\" else echo shar: Extracting \"'mini-x/kernel/makefile.cpp.c'\" \(2119 characters\) sed "s/^X//" >'mini-x/kernel/makefile.cpp.c' <<'END_OF_FILE' X*** ../old/kernel/makefile.cpp Tue Mar 5 22:13:26 1991 X--- makefile.cpp Sat Apr 20 13:35:36 1991 X*************** X*** 56,63 **** X KEROBJS =cstart.O protect.O protect1.O klib.O mpx.O wini.O \ X table.O main.O tty.O floppy.O system.O proc.O \ X clock.O memory.O console.O rs232.O rs2.O printer.O \ X! dmp.O exception.O i8259.O misc.O keyboard.O X! SOBJS =start.s klib.s mpx.s rs2.s X X # Rules. X .SUFFIXES: .x # .x files are .s files which need C-preprocessing X--- 56,66 ---- X KEROBJS =cstart.O protect.O protect1.O klib.O mpx.O wini.O \ X table.O main.O tty.O floppy.O system.O proc.O \ X clock.O memory.O console.O rs232.O rs2.O printer.O \ X! dmp.O exception.O i8259.O misc.O keyboard.O \ X! graphics.O graph_main.O graph_gen.O graph_clip.O cursor_gen.O \ X! graph_ega.O ega.O X! X! SOBJS =start.s klib.s mpx.s rs2.s ega.s X X # Rules. X .SUFFIXES: .x # .x files are .s files which need C-preprocessing X*************** X*** 98,103 **** X--- 101,107 ---- X mpx.s: $h/config.h $h/const.h $h/com.h const.h protect.h sconst.h mpx.x X rs2.s: $h/config.h $h/const.h const.h sconst.h rs2.x X start.s: $h/config.h $h/const.h $h/com.h const.h protect.h sconst.h start.x X+ ega.s: $h/config.h $h/const.h $h/com.h const.h protect.h sconst.h ega.x X #if !ACK X start.O: start.s X $(AS) -0 -a start.s -o start.O X*************** X*** 123,128 **** X--- 127,137 ---- X bcc -0 -c $(CFLAGS) cstart.c X #endif X X+ cursor_gen.O: $a X+ cursor_gen.O: $i/graphics.h X+ cursor_gen.O: $h/graph_msg.h X+ cursor_gen.O: graph_dev.h X+ X dmp.O: $a X dmp.O: $h/callnr.h X dmp.O: $h/com.h X*************** X*** 136,141 **** X--- 145,171 ---- X floppy.O: $h/callnr.h X floppy.O: $h/com.h X X+ graphics.O: $a X+ graphics.O: $i/graphics.h X+ graphics.O: $h/graph_msg.h X+ graphics.O: graph_dev.h X+ X+ graph_clip.O: $a X+ graph_clip.O: $i/graphics.h X+ graph_clip.O: graph_dev.h X+ X+ graph_ega.O: $a X+ graph_ega.O: $i/graphics.h X+ graph_ega.O: graph_dev.h X+ X+ graph_gen.O: $a X+ graph_gen.O: $i/graphics.h X+ graph_gen.O: graph_dev.h X+ X+ graph_main.O: $a X+ graph_main.O: $i/graphics.h X+ graph_main.O: graph_dev.h X+ X i8259.O: $a X X keyboard.O: $a END_OF_FILE if test 2119 -ne `wc -c <'mini-x/kernel/makefile.cpp.c'`; then echo shar: \"'mini-x/kernel/makefile.cpp.c'\" unpacked with wrong size! fi # end of 'mini-x/kernel/makefile.cpp.c' fi if test -f 'mini-x/kernel/makefile.cpp.n' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'mini-x/kernel/makefile.cpp.n'\" else echo shar: Extracting \"'mini-x/kernel/makefile.cpp.n'\" \(4726 characters\) sed "s/^X//" >'mini-x/kernel/makefile.cpp.n' <<'END_OF_FILE' X#if ACK X# Makefile for kernel using standard Minix directory layout and compiler. X# CPP may need changing to /usr/lib/cpp. X# The following nonstandard flags are used: X# -F: run cpp and cem sequentially (used when memory is tight) X# -T.: put temporaries in working directory (when RAM disk is small) X# define O s XBIN =. XCC =cc XCFLAGS =-F -T. XCPP =/usr/lib/cpp XCPPFLAGS =-DASLD -P XEND =/usr/lib/end.s XLD =asld XLDFLAGS =-i XLIBS =/usr/lib/libc.a XSTART =start.O X#else X# Makefile for kernel using Bruce's Minix directory layout and compiler. X# The following nonstandard flags are used: X# -0: produce 16-bit (8086) object code X# -3: produce 32-bit (80386) object code X# define O o X# if INTEL_32BITS XAS =as -3 XBIN =/etc/system XCC =cc -3 XCFLAGS =-DINTEL_32BITS XCPP =/usr/lib/cpp XCPPFLAGS =-DINTEL_32BITS -P XLD =ld -3 XLDFLAGS =-i XLIBS =/usr/local/lib/i386/libc.a longlib.a XSTART =start.O X# else XAS =as -0 -a XBIN =/tmp XCC =cc -0 XCFLAGS = XCPP =/usr/lib/cpp XCPPFLAGS =-P XLD =ld -0 XLDFLAGS =-i XLIBS =/usr/local/lib/i86/libc.a XSTART =start.O X# endif X#endif X Xa =kernel.h $h/config.h $h/const.h $h/type.h \ X $s/types.h $i/limits.h $i/errno.h \ X const.h type.h proto.h glo.h Xh =/usr/include/minix Xi =/usr/include Xs =/usr/include/sys X XKEROBJS =cstart.O protect.O protect1.O klib.O mpx.O wini.O \ X table.O main.O tty.O floppy.O system.O proc.O \ X clock.O memory.O console.O rs232.O rs2.O printer.O \ X dmp.O exception.O i8259.O misc.O keyboard.O \ X graphics.O graph_main.O graph_gen.O graph_clip.O cursor_gen.O \ X graph_ega.O ega.O X XSOBJS =start.s klib.s mpx.s rs2.s ega.s X X# Rules. X.SUFFIXES: .x # .x files are .s files which need C-preprocessing X.x.s: X $(CPP) $(CPPFLAGS) $< >$@ X#if !ACK X.s.O: X $(AS) $< -o $@ X.x.O: X $(CPP) $(CPPFLAGS) $< >$@ X $(AS) $< -o $@ X#endif X X# What to make. Xdummy: $(BIN)/kernel # this line fixes a bug in RAL's latest make X X$(BIN)/kernel: $(START) $(KEROBJS) $(LIBS) $(END) X#if ACK X $(LD) $(LDFLAGS) -o $(BIN)/kernel \ X $(START) $(KEROBJS) \ X $(LIBS) $(END) -s > kernel.sym X ast -X $(BIN)/kernel kernel.sym X @rm kernel.sym X#else X $(LD) $(LDFLAGS) -o $(BIN)/kernel \ X $(START) $(KEROBJS) \ X $(LIBS) $(END) X#endif X Xclean: X#if ACK X @rm -f $(START) $(KEROBJS) $(SOBJS) X#else X rm -f $(START) $(KEROBJS) $(SOBJS) X#endif X Xklib.s: $h/config.h $h/const.h const.h protect.h sconst.h klib.x Xmpx.s: $h/config.h $h/const.h $h/com.h const.h protect.h sconst.h mpx.x Xrs2.s: $h/config.h $h/const.h const.h sconst.h rs2.x Xstart.s: $h/config.h $h/const.h $h/com.h const.h protect.h sconst.h start.x Xega.s: $h/config.h $h/const.h $h/com.h const.h protect.h sconst.h ega.x X#if !ACK Xstart.O: start.s X $(AS) -0 -a start.s -o start.O X#endif X Xclock.O: $a Xclock.O: $i/signal.h Xclock.O: $h/callnr.h Xclock.O: $h/com.h Xclock.O: proc.h X Xconsole.O: $a Xconsole.O: $i/sgtty.h Xconsole.O: $h/callnr.h Xconsole.O: $h/com.h Xconsole.O: protect.h Xconsole.O: tty.h X Xcstart.O: $a Xcstart.O: $h/boot.h Xcstart.O: cstart.c X#if INTEL_32BITS X bcc -0 -c $(CFLAGS) cstart.c X#endif X Xcursor_gen.O: $a Xcursor_gen.O: $i/graphics.h Xcursor_gen.O: $h/graph_msg.h Xcursor_gen.O: graph_dev.h X Xdmp.O: $a Xdmp.O: $h/callnr.h Xdmp.O: $h/com.h Xdmp.O: proc.h X Xexception.O: $a Xexception.O: $i/signal.h Xexception.O: proc.h X Xfloppy.O: $a Xfloppy.O: $h/callnr.h Xfloppy.O: $h/com.h X Xgraphics.O: $a Xgraphics.O: $i/graphics.h Xgraphics.O: $h/graph_msg.h Xgraphics.O: graph_dev.h X Xgraph_clip.O: $a Xgraph_clip.O: $i/graphics.h Xgraph_clip.O: graph_dev.h X Xgraph_ega.O: $a Xgraph_ega.O: $i/graphics.h Xgraph_ega.O: graph_dev.h X Xgraph_gen.O: $a Xgraph_gen.O: $i/graphics.h Xgraph_gen.O: graph_dev.h X Xgraph_main.O: $a Xgraph_main.O: $i/graphics.h Xgraph_main.O: graph_dev.h X Xi8259.O: $a X Xkeyboard.O: $a Xkeyboard.O: $i/sgtty.h Xkeyboard.O: $i/signal.h Xkeyboard.O: $h/callnr.h Xkeyboard.O: $h/com.h Xkeyboard.O: tty.h X Xmain.O: $a Xmain.O: $i/signal.h Xmain.O: $h/callnr.h Xmain.O: $h/com.h Xmain.O: proc.h X Xmemory.O: $a Xmemory.O: $h/callnr.h Xmemory.O: $h/com.h X Xmisc.O: $a Xmisc.O: $h/com.h X Xprinter.O: $a Xprinter.O: $h/callnr.h Xprinter.O: $h/com.h X Xproc.O: $a Xproc.O: $h/callnr.h Xproc.O: $h/com.h Xproc.O: proc.h X Xprotect.O: $a Xprotect.O: protect.h Xprotect.O: protect1.c X#if INTEL_32BITS Xprotect.O: protect.c X bcc -0 -c $(CFLAGS) protect.c X#endif X Xprotect1.O: $a Xprotect1.O: proc.h Xprotect1.O: protect.h X Xrs232.O: $a Xrs232.O: $i/sgtty.h Xrs232.O: tty.h X Xsystem.O: $a Xsystem.O: $i/signal.h Xsystem.O: $h/boot.h Xsystem.O: $h/callnr.h Xsystem.O: $h/com.h Xsystem.O: proc.h Xsystem.O: protect.h X Xtable.O: $a Xtable.O: $h/com.h Xtable.O: proc.h Xtable.O: tty.h X Xtty.O: $a Xtty.O: $i/sgtty.h Xtty.O: $i/signal.h Xtty.O: $h/callnr.h Xtty.O: $h/com.h Xtty.O: tty.h X Xwini.O: $a Xwini.O: $h/callnr.h Xwini.O: $h/com.h Xwini.O: $h/partition.h X#if ACK /* two gratuitous blank lines :-( */ X X X#endif END_OF_FILE if test 4726 -ne `wc -c <'mini-x/kernel/makefile.cpp.n'`; then echo shar: \"'mini-x/kernel/makefile.cpp.n'\" unpacked with wrong size! fi # end of 'mini-x/kernel/makefile.cpp.n' fi if test -f 'mini-x/kernel/makefile.new' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'mini-x/kernel/makefile.new'\" else echo shar: Extracting \"'mini-x/kernel/makefile.new'\" \(3325 characters\) sed "s/^X//" >'mini-x/kernel/makefile.new' <<'END_OF_FILE' XAS =as -3 XBIN =/etc/system XCC =cc -3 XCFLAGS =-DINTEL_32BITS XCPP =/usr/lib/cpp XCPPFLAGS =-DINTEL_32BITS -P XLD =ld -3 XLDFLAGS =-i XLIBS =/usr/local/lib/i386/libc.a longlib.a XSTART =start.o Xa =kernel.h $h/config.h $h/const.h $h/type.h $s/types.h $i/limits.h $i/errno.h const.h type.h proto.h glo.h Xh =/usr/include/minix Xi =/usr/include Xs =/usr/include/sys X XKEROBJS =cstart.o protect.o protect1.o klib.o mpx.o wini.o table.o main.o tty.o floppy.o system.o proc.o clock.o memory.o console.o rs232.o rs2.o printer.o dmp.o exception.o i8259.o misc.o keyboard.o graphics.o graph_main.o graph_gen.o graph_clip.o cursor_gen.o graph_ega.o ega.o XSOBJS =start.s klib.s mpx.s rs2.s ega.s X X.SUFFIXES: .x X.x.s: X $(CPP) $(CPPFLAGS) $< >$@ X X.s.o: X $(AS) $< -o $@ X.x.o: X $(CPP) $(CPPFLAGS) $< >$@ X $(AS) $< -o $@ X X Xdummy: $(BIN)/kernel X X$(BIN)/kernel: $(START) $(KEROBJS) $(LIBS) $(END) X $(LD) $(LDFLAGS) -o $(BIN)/kernel $(START) $(KEROBJS) $(LIBS) $(END) Xclean: X rm -f $(START) $(KEROBJS) $(SOBJS) X X Xklib.s: $h/config.h $h/const.h const.h protect.h sconst.h klib.x Xmpx.s: $h/config.h $h/const.h $h/com.h const.h protect.h sconst.h mpx.x Xrs2.s: $h/config.h $h/const.h const.h sconst.h rs2.x Xstart.s: $h/config.h $h/const.h $h/com.h const.h protect.h sconst.h start.x Xega.s: $h/config.h $h/const.h $h/com.h const.h protect.h sconst.h ega.x X Xstart.o: start.s X $(AS) -0 -a start.s -o start.o X X Xclock.o: $a Xclock.o: $i/signal.h Xclock.o: $h/callnr.h Xclock.o: $h/com.h Xclock.o: proc.h X Xconsole.o: $a Xconsole.o: $i/sgtty.h Xconsole.o: $h/callnr.h Xconsole.o: $h/com.h Xconsole.o: protect.h Xconsole.o: tty.h X Xcstart.o: $a Xcstart.o: $h/boot.h Xcstart.o: cstart.c X bcc -0 -c $(CFLAGS) cstart.c X X Xcursor_gen.o: $a Xcursor_gen.o: $i/graphics.h Xcursor_gen.o: $h/graph_msg.h Xcursor_gen.o: graph_dev.h X Xdmp.o: $a Xdmp.o: $h/callnr.h Xdmp.o: $h/com.h Xdmp.o: proc.h X Xexception.o: $a Xexception.o: $i/signal.h Xexception.o: proc.h X Xfloppy.o: $a Xfloppy.o: $h/callnr.h Xfloppy.o: $h/com.h X Xgraphics.o: $a Xgraphics.o: $i/graphics.h Xgraphics.o: $h/graph_msg.h Xgraphics.o: graph_dev.h X Xgraph_clip.o: $a Xgraph_clip.o: $i/graphics.h Xgraph_clip.o: graph_dev.h X Xgraph_ega.o: $a Xgraph_ega.o: $i/graphics.h Xgraph_ega.o: graph_dev.h X Xgraph_gen.o: $a Xgraph_gen.o: $i/graphics.h Xgraph_gen.o: graph_dev.h X Xgraph_main.o: $a Xgraph_main.o: $i/graphics.h Xgraph_main.o: graph_dev.h X Xi8259.o: $a X Xkeyboard.o: $a Xkeyboard.o: $i/sgtty.h Xkeyboard.o: $i/signal.h Xkeyboard.o: $h/callnr.h Xkeyboard.o: $h/com.h Xkeyboard.o: tty.h X Xmain.o: $a Xmain.o: $i/signal.h Xmain.o: $h/callnr.h Xmain.o: $h/com.h Xmain.o: proc.h X Xmemory.o: $a Xmemory.o: $h/callnr.h Xmemory.o: $h/com.h X Xmisc.o: $a Xmisc.o: $h/com.h X Xprinter.o: $a Xprinter.o: $h/callnr.h Xprinter.o: $h/com.h X Xproc.o: $a Xproc.o: $h/callnr.h Xproc.o: $h/com.h Xproc.o: proc.h X Xprotect.o: $a Xprotect.o: protect.h Xprotect.o: protect1.c X Xprotect.o: protect.c X bcc -0 -c $(CFLAGS) protect.c X X Xprotect1.o: $a Xprotect1.o: proc.h Xprotect1.o: protect.h X Xrs232.o: $a Xrs232.o: $i/sgtty.h Xrs232.o: tty.h X Xsystem.o: $a Xsystem.o: $i/signal.h Xsystem.o: $h/boot.h Xsystem.o: $h/callnr.h Xsystem.o: $h/com.h Xsystem.o: proc.h Xsystem.o: protect.h X Xtable.o: $a Xtable.o: $h/com.h Xtable.o: proc.h Xtable.o: tty.h X Xtty.o: $a Xtty.o: $i/sgtty.h Xtty.o: $i/signal.h Xtty.o: $h/callnr.h Xtty.o: $h/com.h Xtty.o: tty.h X Xwini.o: $a Xwini.o: $h/callnr.h Xwini.o: $h/com.h Xwini.o: $h/partition.h END_OF_FILE if test 3325 -ne `wc -c <'mini-x/kernel/makefile.new'`; then echo shar: \"'mini-x/kernel/makefile.new'\" unpacked with wrong size! fi # end of 'mini-x/kernel/makefile.new' fi if test -f 'mini-x/kernel/proto.h.cdif' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'mini-x/kernel/proto.h.cdif'\" else echo shar: Extracting \"'mini-x/kernel/proto.h.cdif'\" \(294 characters\) sed "s/^X//" >'mini-x/kernel/proto.h.cdif' <<'END_OF_FILE' X*** ../old/kernel/proto.h Tue Mar 5 22:13:23 1991 X--- proto.h Tue Mar 12 21:38:17 1991 X*************** X*** 32,37 **** X--- 32,40 ---- X /* printer.c, stprint.c */ X void printer_task(); X X+ /* graphics.c */ X+ void graphics_task(); X+ X /* proc.c */ X void interrupt(); X int lock_mini_send(); END_OF_FILE if test 294 -ne `wc -c <'mini-x/kernel/proto.h.cdif'`; then echo shar: \"'mini-x/kernel/proto.h.cdif'\" unpacked with wrong size! fi # end of 'mini-x/kernel/proto.h.cdif' fi if test -f 'mini-x/kernel/start.x.cdif' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'mini-x/kernel/start.x.cdif'\" else echo shar: Extracting \"'mini-x/kernel/start.x.cdif'\" \(571 characters\) sed "s/^X//" >'mini-x/kernel/start.x.cdif' <<'END_OF_FILE' X*** ../old/kernel/start.x Tue Mar 5 22:13:26 1991 X--- start.x Wed Apr 10 09:32:05 1991 X*************** X*** 5,10 **** X--- 5,11 ---- X .define _db | trap to external debugger X .define _get_chrome | returns nonzero if display is color X .define _get_ega | returns nonzero if display is ega X+ .define _get_rom_char_addr | returns address of ROM character table X .define _get_ext_memsize | returns amount of extended memory in K X .define _get_low_memsize | returns amount of low memory in K X .define _get_processor | returns processor type (86, 186, 286, 386) END_OF_FILE if test 571 -ne `wc -c <'mini-x/kernel/start.x.cdif'`; then echo shar: \"'mini-x/kernel/start.x.cdif'\" unpacked with wrong size! fi # end of 'mini-x/kernel/start.x.cdif' fi if test -f 'mini-x/kernel/start.x.insert' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'mini-x/kernel/start.x.insert'\" else echo shar: Extracting \"'mini-x/kernel/start.x.insert'\" \(736 characters\) sed "s/^X//" >'mini-x/kernel/start.x.insert' <<'END_OF_FILE' X|*===========================================================================* X|* get_rom_char_addr * X|*===========================================================================* X X| PUBLIC u32_t get_rom_char_addr(); X| Call the BIOS to find out the address of the ROM character table. X X_get_rom_char_addr: X push bp | interrupt uses these X push es X mov ax,#0x1130 | function for address of rom character table X mov bx,#0x0202 | want address of ROM 8x14 character table X int VIDEO | return address in es:bp X mov ax,es | turn segment into physical address X mov bx,ax X shl ax,#4 X shr bx,#12 X mov cx,bp | add offset into physical address X add ax,cx X adc bx,#0 X mov dx,bx X pop es | restore registers and return X pop bp X ret END_OF_FILE if test 736 -ne `wc -c <'mini-x/kernel/start.x.insert'`; then echo shar: \"'mini-x/kernel/start.x.insert'\" unpacked with wrong size! fi # end of 'mini-x/kernel/start.x.insert' fi if test -f 'mini-x/kernel/table.c.cdif' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'mini-x/kernel/table.c.cdif'\" else echo shar: Extracting \"'mini-x/kernel/table.c.cdif'\" \(1162 characters\) sed "s/^X//" >'mini-x/kernel/table.c.cdif' <<'END_OF_FILE' X*** ../old/kernel/table.c Tue Mar 5 22:13:20 1991 X--- table.c Tue Mar 12 21:37:44 1991 X*************** X*** 42,47 **** X--- 42,48 ---- X #else X #define IDLE_STACK (3 * 2 + 3 * 2 + 4 * 2) /* 3 intr, 3 temps, 4 db */ X #endif X+ #define GRAPHICS_STACK SMALL_STACK X #define PRINTER_STACK SMALL_STACK X #define WINCH_STACK SMALL_STACK X #define FLOP_STACK (3*SMALL_STACK/2) X*************** X*** 61,67 **** X #endif X X #define TOT_STACK_SPACE (TTY_STACK + AMOEBA_STACK_SPACE + \ X! IDLE_STACK + HARDWARE_STACK + \ X PRINTER_STACK + WINCH_STACK + FLOP_STACK + \ X MEM_STACK + CLOCK_STACK + SYS_STACK) X X--- 62,68 ---- X #endif X X #define TOT_STACK_SPACE (TTY_STACK + AMOEBA_STACK_SPACE + \ X! IDLE_STACK + HARDWARE_STACK + GRAPHICS_STACK + \ X PRINTER_STACK + WINCH_STACK + FLOP_STACK + \ X MEM_STACK + CLOCK_STACK + SYS_STACK) X X*************** X*** 85,90 **** X--- 86,92 ---- X amoeba_task, AMOEBA_STACK, "AMTASK", X #endif X idle_task, IDLE_STACK, "IDLE ", X+ graphics_task, GRAPHICS_STACK, "GRAPH ", X printer_task, PRINTER_STACK, "PRINTR", X winchester_task, WINCH_STACK, "WINCHE", X floppy_task, FLOP_STACK, "FLOPPY", END_OF_FILE if test 1162 -ne `wc -c <'mini-x/kernel/table.c.cdif'`; then echo shar: \"'mini-x/kernel/table.c.cdif'\" unpacked with wrong size! fi # end of 'mini-x/kernel/table.c.cdif' fi if test -f 'mini-x/kernel/tty.c.cdif' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'mini-x/kernel/tty.c.cdif'\" else echo shar: Extracting \"'mini-x/kernel/tty.c.cdif'\" \(619 characters\) sed "s/^X//" >'mini-x/kernel/tty.c.cdif' <<'END_OF_FILE' X*** ../old/kernel/tty.c Tue Mar 5 22:13:22 1991 X--- tty.c Mon Apr 1 15:35:25 1991 X*************** X*** 461,466 **** X--- 461,476 ---- X return; X } X X+ /* If non-blocking is required see if we would block, and if so, X+ * return EAGAIN to the caller. X+ */ X+ if (m_ptr->TTY_FLAGS && (tp->tty_incount == 0 || X+ !(tp->tty_mode & (RAW | CBREAK)) && tp->tty_lfct == 0)) X+ { X+ tty_reply(TASK_REPLY, m_ptr->m_source, m_ptr->PROC_NR, EAGAIN); X+ return; X+ } X+ X /* Copy information from the message to the tty struct. */ X tp->tty_incaller = m_ptr->m_source; X tp->tty_inproc = m_ptr->PROC_NR; END_OF_FILE if test 619 -ne `wc -c <'mini-x/kernel/tty.c.cdif'`; then echo shar: \"'mini-x/kernel/tty.c.cdif'\" unpacked with wrong size! fi # end of 'mini-x/kernel/tty.c.cdif' fi if test -f 'mini-x/server/keyboard.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'mini-x/server/keyboard.c'\" else echo shar: Extracting \"'mini-x/server/keyboard.c'\" \(2281 characters\) sed "s/^X//" >'mini-x/server/keyboard.c' <<'END_OF_FILE' X/* X * Copyright (c) 1991 David I. Bell X * Permission is granted to use, distribute, or modify this source, X * provided that this copyright notice remains intact. X * X * Keyboard reading routines. X */ X#include X#include X#include X#include "graph_serv.h" X X X/* X * The following is the keyboard device associated with the screen. X */ X#define KEYBOARD "/dev/console" X X X/* X * Defining debug disables setting of the terminal modes, making it X * easier to see output. X */ X#define DEBUG 0 X X Xstatic int fd; /* file descriptor for keyboard */ Xstatic struct sgttyb oldsgttyb; /* original terminal modes */ X X X/* X * Open the keyboard. X * This is real simple, we just use a special file handle X * that allows non-blocking I/O, and put the terminal into X * character mode. X */ Xint XGsOpenKeyboard() X{ X struct sgttyb newsgttyb; /* new terminal modes */ X X fd = open(KEYBOARD, O_NONBLOCK); X if (fd < 0) X return -1; X X if (ioctl(fd, TIOCGETP, &oldsgttyb) < 0) { X close(fd); X fd = 0; X return -1; X } X X#if !DEBUG X newsgttyb = oldsgttyb; X newsgttyb.sg_flags |= CBREAK; X newsgttyb.sg_flags &= ~(EVENP | ODDP | ECHO | XTABS | CRMOD); X X if (ioctl(fd, TIOCSETP, &newsgttyb) < 0) { X close(fd); X fd = 0; X return -1; X } X#endif X return 0; X} X X X X/* X * Return the possible modifiers for the keyboard. X */ Xvoid XGsGetModifierInfo(modifiers) X GR_MODIFIER *modifiers; /* returned mask of modifiers */ X{ X *modifiers = 0; /* no modifiers available */ X} X X X/* X * Close the keyboard. X * This resets the terminal modes. X */ Xvoid XGsCloseKeyboard() X{ X ioctl(fd, TIOCSETP, &oldsgttyb); X close(fd); X fd = 0; X} X X X/* X * This reads one keystroke from the keyboard, and the current state of X * the mode keys (ALT, SHIFT, CTRL). Returns -1 on error, 0 if no data X * is ready, and 1 if data was read. This is a non-blocking call. X * Without MINIX kernel changes, no shift keys information is available. X */ Xint XGsReadKeyboard(buf, modifiers) X GR_CHAR *buf; /* data character */ X GR_MODIFIER *modifiers; /* modifier keys (SHIFT, CTRL, etc) */ X{ X int cc; /* characters read */ X X#if DEBUG X return 0; X#endif X X *modifiers = 0; /* no modifiers yet */ X cc = read(fd, buf, 1); X if (cc > 0) X return 1; X if ((cc < 0) && (errno != EINTR) && (errno != EAGAIN)) X return -1; X return 0; X} X X/* END CODE */ END_OF_FILE if test 2281 -ne `wc -c <'mini-x/server/keyboard.c'`; then echo shar: \"'mini-x/server/keyboard.c'\" unpacked with wrong size! fi # end of 'mini-x/server/keyboard.c' fi if test -f 'mini-x/server/makefile' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'mini-x/server/makefile'\" else echo shar: Extracting \"'mini-x/server/makefile'\" \(965 characters\) sed "s/^X//" >'mini-x/server/makefile' <<'END_OF_FILE' XCFLAGS = -i -O XLDFLAGS = -i XLIBDIR = /usr/local/lib/i386 X XLIBFILES = client.o serv_main.o serv_func.o serv_util.o serv_event.o \ X serv_dev.o mouse.o mousedev.o keyboard.o X Xall: libgraph.a X Xinstall: libgraph.a X cp libgraph.a $(LIBDIR)/libgraph.a X chmod 644 $(LIBDIR)/libgraph.a X Xclean: X rm -rf $(LIBFILES) libgraph.a X Xlibgraph.a: $(LIBFILES) X rm -f libgraph.a X ar qc libgraph.a $(LIBFILES) X Xclient.o: /usr/include/graphics.h Xclient.o: graph_serv.h X Xkeyboard.o: /usr/include/graphics.h Xkeyboard.o: graph_serv.h X Xmouse.o: /usr/include/graphics.h Xmouse.o: graph_serv.h X Xmousedev.o: /usr/include/graphics.h X Xserv_dev.o: /usr/include/graphics.h Xserv_dev.o: /usr/include/minix/graph_msg.h Xserv_dev.o: graph_serv.h X Xserv_event.o: /usr/include/graphics.h Xserv_event.o: graph_serv.h X Xserv_func.o: /usr/include/graphics.h Xserv_func.o: graph_serv.h X Xserv_main.o: /usr/include/graphics.h Xserv_main.o: graph_serv.h X Xserv_util.o: /usr/include/graphics.h Xserv_util.o: graph_serv.h END_OF_FILE if test 965 -ne `wc -c <'mini-x/server/makefile'`; then echo shar: \"'mini-x/server/makefile'\" unpacked with wrong size! fi # end of 'mini-x/server/makefile' fi if test -f 'mini-x/server/mouse.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'mini-x/server/mouse.c'\" else echo shar: Extracting \"'mini-x/server/mouse.c'\" \(4826 characters\) sed "s/^X//" >'mini-x/server/mouse.c' <<'END_OF_FILE' X/* X * Copyright (c) 1991 David I. Bell X * Permission is granted to use, distribute, or modify this source, X * provided that this copyright notice remains intact. X * X * Mouse server routines. X * Reads data from mouse driver and tracks real position on the screen. X */ X#include X#include "graph_serv.h" X X X#define SCALE 3 /* default scaling factor for acceleration */ X#define THRESH 5 /* default threshhold for acceleration */ X X Xstatic GR_COORD xpos; /* current x position of mouse */ Xstatic GR_COORD ypos; /* current y position of mouse */ Xstatic GR_COORD minx; /* minimum allowed x position */ Xstatic GR_COORD maxx; /* maximum allowed x position */ Xstatic GR_COORD miny; /* minimum allowed y position */ Xstatic GR_COORD maxy; /* maximum allowed y position */ Xstatic GR_SIZE scale; /* acceleration scale factor */ Xstatic GR_SIZE thresh; /* acceleration threshhold */ Xstatic GR_BUTTON buttons; /* current state of buttons */ Xstatic GR_BOOL changed; /* mouse state has changed */ X X Xextern int GdOpenMouse(); Xextern int GdReadMouse(); Xextern void GdGetButtonInfo(); Xextern void GdCloseMouse(); X X X/* X * Initialize the mouse. X * This sets its position to (0, 0) with no boundaries and no buttons pressed. X * Returns nonzero on error. X */ XGsOpenMouse() X{ X if (GdOpenMouse(NULL, NULL) < 0) X return -1; X thresh = THRESH; X scale = SCALE; X buttons = 0; X xpos = 0; X ypos = 0; X minx = GR_COORD_MIN; X miny = GR_COORD_MIN; X maxx = GR_COORD_MAX; X maxy = GR_COORD_MAX; X changed = GR_TRUE; X return 0; X} X X X/* X * Return which mouse buttons are implemented. X */ Xvoid XGsGetButtonInfo(buttons) X GR_BUTTON *buttons; /* buttons which are implemented */ X{ X GdGetButtonInfo(buttons); X} X X X/* X * Terminate the use of the mouse. X */ Xvoid XGsCloseMouse() X{ X GdCloseMouse(); X} X X X/* X * Restrict the coordinates of the mouse to the specified coordinates. X */ Xvoid XGsRestrictMouse(newminx, newminy, newmaxx, newmaxy) X GR_COORD newminx; /* new minimum x position */ X GR_COORD newminy; /* new minimum y position */ X GR_COORD newmaxx; /* new maximum x position */ X GR_COORD newmaxy; /* new maximum y position */ X{ X minx = newminx; X miny = newminy; X maxx = newmaxx; X maxy = newmaxy; X GsMoveMouse(xpos, ypos); X} X X X/* X * Set the acceleration threshhold and scale factors. X * Acceleration makes the cursor move further for faster movements. X * Basically, at mouse speeds above the threshold, the excess distance X * moved is multiplied by the scale factor. For example, with a threshhold X * of 5 and a scale of 3, the following gives examples of the original and X * modified mouse movements: X * input: 0 4 5 6 9 20 X * output: 0 4 5 8 17 50 X */ Xvoid XGsSetAccelMouse(newthresh, newscale) X GR_SIZE newthresh; /* new acceleration threshhold */ X GR_SIZE newscale; /* new acceleration scale factor */ X{ X if (newthresh < 0) X newthresh = 0; X if (newscale < 0) X newscale = 0; X thresh = newthresh; X scale = newscale; X} X X X/* X * Move the mouse to the specified coordinates. X * The location is limited by the current mouse coordinate restrictions. X */ Xvoid XGsMoveMouse(newx, newy) X GR_COORD newx; /* desired new x position of mouse */ X GR_COORD newy; /* desired new y position of mouse */ X{ X if (newx < minx) X newx = minx; X if (newx > maxx) X newx = maxx; X if (newy < miny) X newy = miny; X if (newy > maxy) X newy = maxy; X if ((newx != xpos) || (newy != ypos)) X changed = GR_TRUE; X xpos = newx; X ypos = newy; X} X X X/* X * Read the current location and button states of the mouse. X * Returns -1 on read error, 0 if nothing new has happened, and 1 if a X * new position was read. The current mouse position and buttons are X * returned even if the position hasn't changed. This routine does X * not block. X */ Xint XGsReadMouse(xp, yp, bp) X GR_COORD *xp; /* returned x position */ X GR_COORD *yp; /* returned y position */ X GR_BUTTON *bp; /* returned button state */ X{ X GR_COORD deltax; /* change in x position */ X GR_COORD deltay; /* change in y position */ X GR_BUTTON newbuttons; /* new button state */ X int sign; /* sign of change */ X int status; /* status of reading mouse */ X X *xp = xpos; X *yp = ypos; X *bp = buttons; X X if (changed) { X changed = GR_FALSE; X return 1; X } X X status = GdReadMouse(&deltax, &deltay, &newbuttons); X if (status < 0) X return -1; X X if (status == 0) X return 0; X X if (buttons != newbuttons) { X changed = GR_TRUE; X buttons = newbuttons; X } X X sign = 1; X if (deltax < 0) { X sign = -1; X deltax = -deltax; X } X if (deltax > thresh) X deltax = thresh + (deltax - thresh) * scale; X deltax *= sign; X X sign = 1; X if (deltay < 0) { X sign = -1; X deltay = -deltay; X } X if (deltay > thresh) X deltay = thresh + (deltay - thresh) * scale; X deltay *= sign; X X GsMoveMouse(xpos + deltax, ypos + deltay); X X if (!changed) X return 0; X X changed = GR_FALSE; X *xp = xpos; X *yp = ypos; X *bp = buttons; X return 1; X} X X/* END CODE */ END_OF_FILE if test 4826 -ne `wc -c <'mini-x/server/mouse.c'`; then echo shar: \"'mini-x/server/mouse.c'\" unpacked with wrong size! fi # end of 'mini-x/server/mouse.c' fi if test -f 'mini-x/server/serv_main.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'mini-x/server/serv_main.c'\" else echo shar: Extracting \"'mini-x/server/serv_main.c'\" \(5039 characters\) sed "s/^X//" >'mini-x/server/serv_main.c' <<'END_OF_FILE' X/* X * Copyright (c) 1991 David I. Bell X * Permission is granted to use, distribute, or modify this source, X * provided that this copyright notice remains intact. X * X * Main module of graphics server. X */ X#include X#include "graph_serv.h" X X X/* X * External definitions defined here. X */ Xchar * curfunc; /* current function name */ XGR_WINDOW_ID cachewindowid; /* cached window id */ XGR_GC_ID cachegcid; /* cached graphics context id */ XGR_WINDOW *cachewp; /* cached window pointer */ XGR_GC *cachegcp; /* cached graphics context */ XGR_WINDOW *listwp; /* list of all windows */ XGR_WINDOW *rootwp; /* root window pointer */ XGR_GC *listgcp; /* list of all gc */ XGR_GC *curgcp; /* currently enabled gc */ XGR_WINDOW *clipwp; /* window clipping is set for */ XGR_WINDOW *focuswp; /* focus window for keyboard */ XGR_WINDOW *mousewp; /* window mouse is currently in */ XGR_WINDOW *grabbuttonwp; /* window grabbed by button */ XGR_CURSOR *curcursor; /* currently enabled cursor */ XGR_COORD cursorx; /* current x position of cursor */ XGR_COORD cursory; /* current y position of cursor */ XGR_BUTTON curbuttons; /* current state of buttons */ XGR_CLIENT *curclient; /* client currently executing for */ XGR_EVENT_LIST *eventfree; /* list of free events */ XGR_EVENT_NUMBER eventnumber; /* current event number */ XGR_BOOL inited; /* TRUE if been initialized */ XGR_BOOL focusfixed; /* TRUE if focus is fixed on a window */ XGR_SCREEN_INFO sinfo; /* screen information */ XGR_FONT_INFO curfont; /* current font information */ XGR_CLIENT clients[GR_MAX_CLIENTS]; /* table of clients */ X X Xstatic int connectcount; /* number of connections to server */ X X X/* X * When the server is a separate process from the client, X * then this main would be executed, and would drive the whole X * server loop. X */ X#if 0 Xmain(argc, argv) X char **argv; X{ X if (GsInitialize()) X exit(1); X X /* read initialization file to start up default clients */ X X /* let clients connect and service them until all are gone */ X X GsTerminate(); X} X#endif X X X/* X * Initialize the graphics and mouse devices at startup. X * Returns nonzero with a message printed if the initialization failed. X */ Xint XGsInitialize() X{ X GR_WINDOW *wp; /* root window */ X GR_CURSOR *cp; /* cursor for root window */ X X if (connectcount > 0) { X connectcount++; X return 0; X } X X wp = (GR_WINDOW *) malloc(sizeof(GR_WINDOW)); X if (wp == NULL) { X fprintf(stderr, "Cannot allocate root window\n"); X return -1; X } X X cp = (GR_CURSOR *) malloc(sizeof(GR_CURSOR)); X if (cp == NULL) { X fprintf(stderr, "Cannot allocate cursor\n"); X return -1; X } X X if (GsOpenMouse() < 0) { X fprintf(stderr, "Cannot initialize mouse: "); X perror(""); X free(wp); X free(cp); X return -1; X } X X if (GsOpenKeyboard() < 0) { X fprintf(stderr, "Cannot initialize keyboard: "); X perror(""); X GsCloseMouse(); X free(wp); X free(cp); X return -1; X } X X if (GdOpenScreen(0, 0, 0) < 0) { X fprintf(stderr, "Cannot initialize screen: "); X perror(""); X GsCloseMouse(); X GsCloseKeyboard(); X free(wp); X free(cp); X return -1; X } X X /* X * Get screen dimensions for our own and the client's use, X * and the information about the default font. X */ X GdGetScreenInfo(&sinfo); X GdGetFontInfo(0, &curfont); X GsGetModifierInfo(&sinfo.modifiers); X GsGetButtonInfo(&sinfo.buttons); X X /* X * Initialize the default cursor. X */ X cp->usecount = 1; X cp->foreground = sinfo.white; X cp->background = sinfo.black; X cp->width = 5; X cp->height = 5; X cp->hotx = 2; X cp->hoty = 2; X cp->fgbitmap[0] = 0x8800; /* X---X */ X cp->fgbitmap[1] = 0x5000; /* -X-X- */ X cp->fgbitmap[2] = 0x2000; /* --X-- */ X cp->fgbitmap[3] = 0x5000; /* -X-X- */ X cp->fgbitmap[4] = 0x8800; /* X---X */ X X cp->bgbitmap[0] = 0xd800; /* XX-XX */ X cp->bgbitmap[1] = 0xf800; /* XXXXX */ X cp->bgbitmap[2] = 0x7000; /* -XXX- */ X cp->bgbitmap[3] = 0xf800; /* XXXXX */ X cp->bgbitmap[4] = 0xd800; /* XX-XX */ X X curcursor = NULL; X cursorx = -1; X cursory = -1; X X /* X * Initialize the root window. X */ X wp->id = GR_ROOT_WINDOW_ID; X wp->parent = wp; X wp->children = NULL; X wp->siblings = NULL; X wp->next = NULL; X wp->x = 0; X wp->y = 0; X wp->width = sinfo.cols; X wp->height = sinfo.rows; X wp->bordersize = 0; X wp->background = sinfo.black; X wp->bordercolor = sinfo.black; X wp->nopropmask = 0; X wp->eventclients = NULL; X wp->cursor = cp; X wp->mapped = GR_TRUE; X wp->unmapcount = 0; X wp->output = GR_TRUE; X listwp = wp; X rootwp = wp; X focuswp = wp; X mousewp = wp; X focusfixed = GR_FALSE; X X /* X * Finally tell the mouse driver some things and tell the X * screen driver where the cursor should go. X */ X curbuttons = 0; X GsSetAccelMouse(5, 3); X GsRestrictMouse(0, 0, sinfo.cols - 1, sinfo.rows - 1); X GsMoveMouse(sinfo.cols / 2, sinfo.rows / 2); X GsMoveCursor(sinfo.cols / 2, sinfo.rows / 2); X GsFlush(); X X /* X * All done. X */ X connectcount = 1; X inited = GR_TRUE; X X return 0; X} X X X/* X * Here to close down the server. X */ Xvoid XGsTerminate() X{ X if (--connectcount == 0) { X GdCloseScreen(); X GsCloseMouse(); X GsCloseKeyboard(); X inited = GR_FALSE; X } X} X X/* END CODE */ END_OF_FILE if test 5039 -ne `wc -c <'mini-x/server/serv_main.c'`; then echo shar: \"'mini-x/server/serv_main.c'\" unpacked with wrong size! fi # end of 'mini-x/server/serv_main.c' fi echo shar: End of archive 1 \(of 9\). cp /dev/null ark1isdone MISSING="" for I in 1 2 3 4 5 6 7 8 9 ; do if test ! -f ark${I}isdone ; then MISSING="${MISSING} ${I}" fi done if test "${MISSING}" = "" ; then echo You have unpacked all 9 archives. rm -f ark[1-9]isdone ark[1-9][0-9]isdone else echo You still need to unpack the following archives: echo " " ${MISSING} fi ## End of shell archive. exit 0