worsley@ditmela.oz (Andrew Worsley) (05/18/89)
#! /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 <file", e.g.. If this archive is complete, you
# will see the following message at the end:
# "End of archive 8 (of 10)."
# Contents: kerneldif/protect.c.cdif kerneldif/rs2.x.cdif
# kerneldif/rs232.c.cdif kerneldif/sconst.h.cdif
# kerneldif/sglo.h.cdif kerneldif/xt_wini.c.cdif libdif/head.s.cdif
# toolsdif/fsck1.s.cdif
# Wrapped by sys@besplex on Sun Mar 26 06:34:29 1989
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f 'kerneldif/protect.c.cdif' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'kerneldif/protect.c.cdif'\"
else
echo shar: Extracting \"'kerneldif/protect.c.cdif'\" \(9757 characters\)
sed "s/^X//" >'kerneldif/protect.c.cdif' <<'END_OF_FILE'
X*** /dev/null Thu Oct 13 22:40:42 1988
X--- kernel/protect.c Fri Mar 24 01:58:15 1989
X***************
X*** 0 ****
X--- 1,309 ----
X+ /* This file contains most of the static initialization for protected mode
X+ * (some is done in mpx286.x), and routines to initialize the code and data
X+ * segment descriptors for new processes.
X+ */
X+
X+ #include "../h/const.h"
X+ #include "../h/type.h"
X+ #include "const.h"
X+ #include "type.h"
X+ #include "glo.h"
X+ #include "proc.h"
X+ #include "protect.h"
X+
X+ struct desctableptr_s {
X+ u16_t limit;
X+ u32_t base; /* really u24_t + pad for 286 */
X+ };
X+
X+ struct gatedesc_s {
X+ u16_t offset_low;
X+ u16_t selector;
X+ u8_t pad; /* |000|XXXXX| ig & trpg, |XXXXXXXX| task g */
X+ u8_t p_dpl_type; /* |P|DL|0|TYPE| */
X+ u16_t reserved;
X+ };
X+
X+ struct tss286_s {
X+ u16_t backlink;
X+ u16_t sp0;
X+ u16_t ss0;
X+ u16_t sp1;
X+ u16_t ss1;
X+ u16_t sp2;
X+ u16_t ss2;
X+ u16_t ip;
X+ u16_t flags;
X+ u16_t ax;
X+ u16_t cx;
X+ u16_t dx;
X+ u16_t bx;
X+ u16_t sp;
X+ u16_t bp;
X+ u16_t si;
X+ u16_t di;
X+ u16_t es;
X+ u16_t cs;
X+ u16_t ss;
X+ u16_t ds;
X+ u16_t ldt;
X+ };
X+
X+ union tss_u {
X+ struct tss286_s t2;
X+ };
X+
X+ /* PRIVATE int gdt_pad = 0; /* attempt to align gdt on long boundary */
X+ PUBLIC struct segdesc_s gdt[GDT_SIZE] = { 0, };
X+ /* temporary initialize it to get it in data
X+ * segment for better control over alignment
X+ */
X+ PRIVATE struct gatedesc_s idt[IDT_SIZE]; /* zero-init so none present */
X+ PUBLIC union tss_u tss; /* zero init */
X+
X+ #ifdef DEBUGGER
X+ #define IF 0x0200
X+ PUBLIC union tss_u db_tss; /* zero init */
X+ extern char db_stacktop[];
X+ #endif
X+
X+ extern void divide_error();
X+ extern void debug2_exception();
X+ extern void debug3_exception();
X+ extern void nmi();
X+ extern void breakpoint();
X+ extern void overflow();
X+ extern void bounds_check();
X+ extern void inval_opcode();
X+ extern void copr_not_available();
X+ extern void double_fault();
X+ extern void copr_seg_overrun();
X+ extern void inval_tss();
X+ extern void segment_not_present();
X+ extern void stack_exception();
X+ extern void general_protection();
X+ extern void page_fault();
X+ extern void copr_error();
X+
X+ extern void clock_int();
X+ extern void tty_int();
X+ extern void psecondary_int();
X+ extern void prs232_int();
X+ extern void disk_int();
X+ extern void lpr_int();
X+ extern void wini_int();
X+
X+ extern void p2_s_call();
X+ extern void p3_s_call();
X+
X+ FORWARD void sdesc();
X+ FORWARD void task_gate();
X+
X+ PRIVATE void int_gate( vec_nr, base, dpl_type )
X+ unsigned vec_nr;
X+ offset_t base;
X+ unsigned dpl_type;
X+ {
X+ /* Build descriptor for an interrupt gate. */
X+
X+ register struct gatedesc_s *idp;
X+
X+ idp = &idt[vec_nr];
X+ idp->offset_low = base;
X+ idp->selector = CS_SELECTOR;
X+ idp->p_dpl_type = dpl_type;
X+ }
X+
X+ PUBLIC void init_codeseg( segdp, base, size, privilege )
X+ register struct segdesc_s *segdp;
X+ offset_t base;
X+ offset_t size;
X+ int privilege;
X+ {
X+ /* Build descriptor for a code segment. */
X+
X+ sdesc( segdp, base, size );
X+ segdp->access = (privilege << DPL_SHIFT)
X+ | (PRESENT | SEGMENT | EXECUTABLE | READABLE);
X+ /* CONFORMING = 0, ACCESSED = 0 */
X+ }
X+
X+ PUBLIC void init_dataseg( segdp, base, size, privilege )
X+ register struct segdesc_s *segdp;
X+ offset_t base;
X+ offset_t size;
X+ int privilege;
X+ {
X+ /* Build descriptor for a data segment. */
X+
X+ sdesc( segdp, base, size );
X+ segdp->access = (privilege << DPL_SHIFT) | (PRESENT | SEGMENT | WRITEABLE);
X+ /* EXECUTABLE = 0, EXPAND_DOWN = 0, ACCESSED = 0 */
X+ }
X+
X+ PUBLIC void prot_init()
X+ {
X+ /* Set up tables for protected mode, even if they will not be used.
X+ * All GDT slots are allocated at compile time.
X+ */
X+
X+ offset_t codebase;
X+ offset_t code_bytes;
X+ offset_t database;
X+ offset_t data_bytes;
X+ int gate_nr;
X+ u8_t type3_bit;
X+ unsigned ldt_selector;
X+ register struct proc *rp;
X+
X+ static struct
X+ {
X+ unsigned vec_nr;
X+ void (*gate)();
X+ }
X+ gate_table[] =
X+ {
X+ DIVIDE_VECTOR, divide_error,
X+ NMI_VECTOR, nmi,
X+ OVERFLOW_VECTOR, overflow,
X+ BOUNDS_VECTOR, bounds_check,
X+ INVAL_OP_VECTOR, inval_opcode,
X+ COPROC_NOT_VECTOR, copr_not_available,
X+ DOUBLE_FAULT_VECTOR, double_fault,
X+ COPROC_SEG_VECTOR, copr_seg_overrun,
X+ INVAL_TSS_VECTOR, inval_tss,
X+ SEG_NOT_VECTOR, segment_not_present,
X+ STACK_FAULT_VECTOR, stack_exception,
X+ PROTECTION_VECTOR, general_protection,
X+ IRQ0_VECTOR + CLOCK_IRQ, clock_int,
X+ IRQ0_VECTOR + KEYBOARD_IRQ, tty_int,
X+ IRQ0_VECTOR + SECONDARY_IRQ, psecondary_int,
X+ IRQ0_VECTOR + RS232_IRQ, prs232_int,
X+ IRQ0_VECTOR + FLOPPY_IRQ, disk_int,
X+ IRQ0_VECTOR + PRINTER_IRQ, lpr_int,
X+ IRQ8_VECTOR + AT_WINI_IRQ - 8, wini_int,
X+ };
X+
X+ /* This is called early and can't use tables set up by main(). */
X+ codebase = (offset_t) codeseg() << HCLICK_SHIFT;
X+ database = (offset_t) dataseg() << HCLICK_SHIFT;
X+ data_bytes = (offset_t) sizes[1] << CLICK_SHIFT;
X+ if (sizes[0] == 0)
X+ code_bytes = data_bytes; /* common I&D */
X+ else
X+ code_bytes = (offset_t) sizes[0] << CLICK_SHIFT;
X+
X+ /* Build temporary gdt and idt pointers in GDT where BIOS needs them. */
X+ ((struct desctableptr_s *) &gdt[GDT_INDEX])->limit = sizeof gdt - 1;
X+ ((struct desctableptr_s *) &gdt[GDT_INDEX])->base =
X+ database + (offset_t) gdt;
X+ ((struct desctableptr_s *) &gdt[IDT_INDEX])->limit = sizeof idt - 1;
X+ ((struct desctableptr_s *) &gdt[IDT_INDEX])->base =
X+ database + (offset_t) idt;
X+
X+ /* Build segment descriptors for tasks and interrupt handlers. */
X+ init_dataseg( &gdt[DS_INDEX], database, data_bytes, INTR_PRIVILEGE );
X+ init_dataseg( &gdt[ES_INDEX], database, data_bytes, INTR_PRIVILEGE );
X+ init_dataseg( &gdt[SS_INDEX], database, data_bytes, INTR_PRIVILEGE );
X+ init_codeseg( &gdt[CS_INDEX], codebase, code_bytes, INTR_PRIVILEGE );
X+
X+ /* Build scratch descriptors for functions in klib286. */
X+ init_dataseg( &gdt[DS_286_INDEX], (offset_t) 0, (offset_t) MAX_286_SEG_SIZE,
X+ TASK_PRIVILEGE );
X+ init_dataseg( &gdt[ES_286_INDEX], (offset_t) 0, (offset_t) MAX_286_SEG_SIZE,
X+ TASK_PRIVILEGE );
X+
X+ /* Build descriptors for video segments. */
X+ init_dataseg( &gdt[COLOR_INDEX], (offset_t) COLOR_BASE,
X+ (offset_t) COLOR_SIZE, TASK_PRIVILEGE );
X+ init_dataseg( &gdt[MONO_INDEX], (offset_t) MONO_BASE,
X+ (offset_t) MONO_SIZE, TASK_PRIVILEGE );
X+
X+ /* Build segment descriptors for switching to real mode.
X+ * They are only used by the debugger, which only works on 386's.
X+ */
X+ init_codeseg( &gdt[REAL_CS_INDEX], codebase, (offset_t) REAL_SEG_SIZE,
X+ INTR_PRIVILEGE );
X+ init_dataseg( &gdt[REAL_DS_INDEX], database, (offset_t) REAL_SEG_SIZE,
X+ INTR_PRIVILEGE );
X+
X+ /* Build main TSS. This is used only to record the stack pointer to
X+ * be used after an interrupt. This pointer is set up so that an
X+ * interrupt automatically saves the current process' registers
X+ * eip:cs:ef:esp:ss in the correct slots in the process table.
X+ */
X+ tss.t2.ss0 = DS_SELECTOR;
X+ type3_bit = 0;
X+ init_dataseg( &gdt[TSS_INDEX], database + (offset_t) &tss,
X+ (offset_t) sizeof tss, INTR_PRIVILEGE );
X+ gdt[TSS_INDEX].access = PRESENT | (INTR_PRIVILEGE << DPL_SHIFT)
X+ | AVL_286_TSS | type3_bit;
X+
X+ #ifdef DEBUGGER
X+ /* Build TSS and task gates for debugger. */
X+ init_dataseg( &gdt[DB_TSS_INDEX], database + (offset_t) &db_tss,
X+ (offset_t) sizeof db_tss, INTR_PRIVILEGE );
X+ gdt[DB_TSS_INDEX].access = PRESENT | (INTR_PRIVILEGE << DPL_SHIFT)
X+ | AVL_286_TSS | type3_bit;
X+ task_gate( &idt[DEBUG_VECTOR], DB_TSS_SELECTOR, USER_PRIVILEGE );
X+ task_gate( &idt[BREAKPOINT_VECTOR], DB_TSS_SELECTOR, USER_PRIVILEGE );
X+ db_tss.t2.cs = CS_SELECTOR;
X+ db_tss.t2.ip = (u16_t) debug2_exception;
X+ db_tss.t2.flags = INIT_PSW & ~IF;
X+ db_tss.t2.ds =
X+ db_tss.t2.es =
X+ db_tss.t2.ss = DS_SELECTOR;
X+ db_tss.t2.sp = (u16_t) db_stacktop;
X+ #endif
X+
X+ /* Build local descriptors in GDT for LDT's in process table.
X+ * The LDT's are allocated at compile time in the process table, and
X+ * initialized whenever a process' map is initialized or changed.
X+ */
X+ for ( rp = BEG_PROC_ADDR, ldt_selector = FIRST_LDT_INDEX * DESC_SIZE;
X+ rp < END_PROC_ADDR; ++rp, ldt_selector += DESC_SIZE )
X+ {
X+ init_dataseg( &gdt[ldt_selector / DESC_SIZE],
X+ database + (offset_t) rp->p_ldt,
X+ (offset_t) sizeof rp->p_ldt, INTR_PRIVILEGE );
X+ gdt[ldt_selector / DESC_SIZE].access = PRESENT | LDT;
X+ rp->p_ldt_sel = ldt_selector;
X+ }
X+
X+ /* Build descriptors for interrupt gates in IDT. */
X+ for ( gate_nr = 0; gate_nr < sizeof gate_table / sizeof gate_table[0];
X+ ++gate_nr )
X+ {
X+ int_gate( gate_table[gate_nr].vec_nr, (offset_t) gate_table[gate_nr].gate,
X+ PRESENT | (INTR_PRIVILEGE << DPL_SHIFT) |
X+ INT_286_GATE | type3_bit );
X+ }
X+ int_gate( SYS_VECTOR, (offset_t)
X+ p2_s_call,
X+ PRESENT | (USER_PRIVILEGE << DPL_SHIFT) |
X+ INT_286_GATE | type3_bit );
X+ }
X+
X+ PRIVATE void sdesc( segdp, base, size )
X+ register struct segdesc_s *segdp;
X+ offset_t base;
X+ offset_t size;
X+ {
X+ /* Fill in size fields (base and limit) of a descriptor. */
X+
X+ segdp->base_low = base;
X+ segdp->base_middle = base >> BASE_MIDDLE_SHIFT;
X+ segdp->limit_low = size - 1;
X+ }
X+
X+ PRIVATE void task_gate( gatedp, selector, privilege )
X+ register struct gatedesc_s *gatedp;
X+ unsigned selector;
X+ int privilege;
X+ {
X+ /* Build descriptor for a task gate. */
X+
X+ gatedp->selector = selector;
X+ gatedp->p_dpl_type = (privilege << DPL_SHIFT) | PRESENT | TASK_GATE;
X+ /* SEGMENT = 0 */
X+ }
END_OF_FILE
if test 9757 -ne `wc -c <'kerneldif/protect.c.cdif'`; then
echo shar: \"'kerneldif/protect.c.cdif'\" unpacked with wrong size!
fi
# end of 'kerneldif/protect.c.cdif'
fi
if test -f 'kerneldif/rs2.x.cdif' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'kerneldif/rs2.x.cdif'\"
else
echo shar: Extracting \"'kerneldif/rs2.x.cdif'\" \(6495 characters\)
sed "s/^X//" >'kerneldif/rs2.x.cdif' <<'END_OF_FILE'
X*** /dev/null Thu Oct 13 22:40:42 1988
X--- kernel/rs2.x Sun Mar 12 15:27:29 1989
X***************
X*** 0 ****
X--- 1,304 ----
X+ |*===========================================================================*
X+ |* rs232 interrupt handlers for real and protected modes *
X+ |*===========================================================================*
X+
X+ #include "../h/const.h"
X+ #include "const.h"
X+ #include "sconst.h"
X+ #define RS2 .define
X+ #include "sglo.h"
X+
X+ #undef MINOR
X+
X+ #ifdef ASLD
X+ #define add1_and_align(n) [[[n]+1+1] / 2 * 2] /* word alignment */
X+ #else
X+ #define add1_and_align(n) (((n)+1+1) & !1)
X+ #endif
X+
X+ | These constants are defined in tty.h. That has C stuff so can't be included.
X+ EVENT_THRESHOLD = 64
X+ RS_IBUFSIZE = 128
X+
X+ | These constants are defined in rs232.c.
X+ IS_LINE_STATUS_CHANGE = 6
X+ IS_MODEM_STATUS_CHANGE = 0
X+ IS_NO_INTERRUPT = 1
X+ IS_RECEIVER_READY = 4
X+ IS_TRANSMITTER_READY = 2
X+ LS_OVERRUN_ERR = 2
X+ LS_PARITY_ERR = 4
X+ LS_FRAMING_ERR = 8
X+ LS_BREAK_INTERRUPT = 0x10
X+ LS_TRANSMITTER_READY = 0x20
X+ MC_DTR = 1
X+ MC_OUT2 = 8
X+ MS_CTS = 0x10
X+ ODEVREADY = MS_CTS
X+ ODONE = 1
X+ OQUEUED = 0x20
X+ ORAW = 2
X+ OSWREADY = 0x40
X+ OWAKEUP = 4
X+ RS_IHIGHWATER = 3*RS_IBUFSIZE/4
X+
X+ | These port offsets are hard-coded in rs232.c.
X+ XMIT_OFFSET = 0
X+ RECV_OFFSET = 0
X+ INT_ID_OFFSET = 2
X+ MODEM_CTL_OFFSET = 4
X+ LINE_STATUS_OFFSET = 5
X+ MODEM_STATUS_OFFSET = 6
X+
X+ | Offsets in struct rs232_s. They must match rs232.c
X+ MINOR = 0
X+ IDEVREADY = MINOR+2
X+ ITTYREADY = IDEVREADY+1
X+ IBUF = add1_and_align(ITTYREADY)
X+ IBUFEND = IBUF+2
X+ IHIGHWATER = IBUFEND+2
X+ IPTR = IHIGHWATER+2
X+ OSTATE = IPTR+2
X+ OXOFF = OSTATE+1
X+ OBUFEND = add1_and_align(OXOFF)
X+ OPTR = OBUFEND+2
X+ XMIT_PORT = OPTR+2
X+ RECV_PORT = XMIT_PORT+2
X+ DIV_LOW_PORT = RECV_PORT+2
X+ DIV_HI_PORT = DIV_LOW_PORT+2
X+ INT_ENAB_PORT = DIV_HI_PORT+2
X+ INT_ID_PORT = INT_ENAB_PORT+2
X+ LINE_CTL_PORT = INT_ID_PORT+2
X+ MODEMCTL_PORT = LINE_CTL_PORT+2
X+ LINESTATUS_PORT = MODEMCTL_PORT+2
X+ MODEMSTATUS_PORT = LINESTATUS_PORT+2
X+ LSTATUS = MODEMSTATUS_PORT+2
X+ FRAMING_ERRORS = add1_and_align(LSTATUS)
X+ OVERRUN_ERRORS = FRAMING_ERRORS+2
X+ PARITY_ERRORS = OVERRUN_ERRORS+2
X+ BREAK_INTERRUPTS = PARITY_ERRORS+2
X+ IBUF1 = BREAK_INTERRUPTS+2
X+ IBUF2 = IBUF1+RS_IBUFSIZE+1
X+ SIZEOF_STRUCT_RS232_S = IBUF2+RS_IBUFSIZE+1
X+
X+ .text
X+
X+ #ifdef i80286
X+ | PUBLIC void interrupt _psecondary_int();
X+
X+ _psecondary_int:
X+ push ds
X+ push si
X+ mov si,ss
X+ mov ds,si
X+ mov si,#_rs_lines+SIZEOF_STRUCT_RS232_S
X+ j commonp
X+ #endif
X+
X+ | PUBLIC void interrupt _secondary_int();
X+
X+ _secondary_int:
X+ push ds
X+ push si
X+ mov si,#_rs_lines+SIZEOF_STRUCT_RS232_S
X+ j common
X+
X+ #ifdef i80286
X+ | PUBLIC void interrupt _prs232_int();
X+
X+ _prs232_int:
X+ push ds
X+ push si
X+ mov si,ss
X+ mov ds,si
X+ mov si,#_rs_lines
X+ j commonp
X+ #endif
X+
X+ | input interrupt
X+
X+ inint:
X+ addb dl,#RECV_OFFSET-INT_ID_OFFSET
X+ in
X+ mov bx,IPTR(si)
X+ movb (bx),al
X+ cmp bx,IBUFEND(si)
X+ jge checkxoff
X+ inc _tty_events
X+ inc bx
X+ mov IPTR(si),bx
X+ cmp bx,IHIGHWATER(si)
X+ jne checkxoff
X+ addb dl,#MODEM_CTL_OFFSET-RECV_OFFSET
X+ movb al,#MC_OUT2+MC_DTR
X+ out
X+ movb IDEVREADY(si),#FALSE
X+ checkxoff:
X+ testb ah,#ORAW
X+ jne rsnext
X+ cmpb al,OXOFF(si)
X+ je gotxoff
X+ testb ah,#OSWREADY
X+ jne rsnext
X+ orb ah,#OSWREADY
X+ mov dx,LINESTATUS_PORT(si)
X+ in
X+ testb al,#LS_TRANSMITTER_READY
X+ je rsnext
X+ addb dl,#XMIT_OFFSET-LINE_STATUS_OFFSET
X+ j outint1
X+
X+ gotxoff:
X+ andb ah,#notop(OSWREADY)
X+ j rsnext
X+
X+ | PUBLIC void interrupt rs232_int();
X+
X+ _rs232_int:
X+ push ds
X+ push si
X+ mov si,#_rs_lines
X+ common:
X+ seg cs
X+ mov ds,kernel_ds
X+ seg cs
X+ commonp:
X+ push ax
X+ push bx
X+ push dx
X+ movb ah,OSTATE(si)
X+ mov dx,INT_ID_PORT(si)
X+ in
X+ rsmore:
X+ cmpb al,#IS_RECEIVER_READY
X+ je inint
X+ cmpb al,#IS_TRANSMITTER_READY
X+ je outint
X+ cmpb al,#IS_MODEM_STATUS_CHANGE
X+ je modemint
X+ cmpb al,#IS_LINE_STATUS_CHANGE
X+ jne rsdone | fishy
X+
X+ | line status change interrupt
X+
X+ addb dl,#LINE_STATUS_OFFSET-INT_ID_OFFSET
X+ in
X+ testb al,#LS_FRAMING_ERR
X+ je over_framing_error
X+ inc FRAMING_ERRORS(si)
X+ over_framing_error:
X+ testb al,#LS_OVERRUN_ERR
X+ je over_overrun_error
X+ inc OVERRUN_ERRORS(si)
X+ over_overrun_error:
X+ testb al,#LS_PARITY_ERR
X+ je over_parity_error
X+ inc PARITY_ERRORS(si)
X+ over_parity_error:
X+ testb al,#LS_BREAK_INTERRUPT
X+ je over_break_interrupt
X+ inc BREAK_INTERRUPTS(si)
X+ over_break_interrupt:
X+
X+ rsnext:
X+ mov dx,INT_ID_PORT(si)
X+ in
X+ cmpb al,#IS_NO_INTERRUPT
X+ jne rsmore
X+ rsdone:
X+ movb al,#ENABLE
X+ out INT_CTL
X+ testb ah,#OWAKEUP
X+ jne owakeup
X+ movb OSTATE(si),ah
X+ pop dx
X+ pop bx
X+ pop ax
X+ pop si
X+ pop ds
X+ rs2_iret:
X+ iret | changed to iretd for 386 protected mode
X+ nop | space for longer opcode
X+ nop | padding since convenient to change 3 bytes
X+
X+ | output interrupt
X+
X+ outint:
X+ addb dl,#XMIT_OFFSET-INT_ID_OFFSET
X+ outint1:
X+ cmpb ah,#ODEVREADY+OQUEUED+OSWREADY
X+ jb rsnext | not all are set
X+ mov bx,OPTR(si)
X+ movb al,(bx)
X+ out
X+ inc bx
X+ mov OPTR(si),bx
X+ cmp bx,OBUFEND(si)
X+ jb rsnext
X+ add _tty_events,#EVENT_THRESHOLD
X+ xorb ah,#ODONE+OQUEUED+OWAKEUP | OQUEUED off, others on
X+ j rsnext | direct exit might lose interrupt
X+
X+ | modem status change interrupt
X+
X+ modemint:
X+ addb dl,#MODEM_STATUS_OFFSET-INT_ID_OFFSET
X+ in
X+ testb al,#MS_CTS
X+ jne m_devready
X+ andb ah,#notop(ODEVREADY)
X+ j rsnext
X+
X+ m_devready:
X+ testb ah,#ODEVREADY
X+ jne rsnext
X+ orb ah,#ODEVREADY
X+ addb dl,#LINE_STATUS_OFFSET-MODEM_STATUS_OFFSET
X+ in
X+ testb al,#LS_TRANSMITTER_READY
X+ je rsnext
X+ addb dl,#XMIT_OFFSET-LINE_STATUS_OFFSET
X+ j outint1
X+
X+ | special exit for output just completed
X+
X+ owakeup:
X+ andb ah,#notop(OWAKEUP)
X+ movb OSTATE(si),ah
X+
X+ | determine mask bit (it would be better to precalculate it in the struct)
X+
X+ movb ah,#SECONDARY_MASK
X+ cmp si,#_rs_lines
X+ jne got_rs_mask
X+ movb ah,#RS232_MASK
X+ got_rs_mask:
X+ mov rs_mask,ax | save ax to clear later
X+ in INT_CTLMASK
X+ orb al,ah
X+ out INT_CTLMASK
X+
X+ | rearrange context to call tty_wakeup()
X+
X+ pop dx
X+ pop bx
X+ pop ax
X+ pop si
X+ pop ds
X+ call save
X+ push rs_mask | save the mask again, reentrantly
X+ sti
X+ call _tty_wakeup
X+ cli
X+ pop ax
X+ notb ah | return this
X+ in INT_CTLMASK
X+ andb al,ah
X+ out INT_CTLMASK
X+ ret
X+
X+
X+ .data
X+ rs_mask:
X+ .space 2
X+ .space 2 | align
END_OF_FILE
if test 6495 -ne `wc -c <'kerneldif/rs2.x.cdif'`; then
echo shar: \"'kerneldif/rs2.x.cdif'\" unpacked with wrong size!
fi
# end of 'kerneldif/rs2.x.cdif'
fi
if test -f 'kerneldif/rs232.c.cdif' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'kerneldif/rs232.c.cdif'\"
else
echo shar: Extracting \"'kerneldif/rs232.c.cdif'\" \(3649 characters\)
sed "s/^X//" >'kerneldif/rs232.c.cdif' <<'END_OF_FILE'
X*** kernel-1.3/rs232.c Fri Dec 9 02:21:32 1988
X--- kernel/rs232.c Sun Mar 12 00:08:06 1989
X***************
X*** 173,174 ****
X--- 173,175 ----
X interrupt(TTY, &rs232_rd_mess); /* send a message to the tty task */
X+ lock(); /* new interrupt() may unlock() */
X }
X***************
X*** 229,230 ****
X--- 230,232 ----
X interrupt(TTY, &rs232_wt_mess); /* send the message to the tty task */
X+ lock(); /* new interrupt() may unlock() */
X } else {
X***************
X*** 279,281 ****
X char c, *limit;
X! unsigned short segment, offset, offset1;
X register struct rs_struct *rs;
X--- 281,283 ----
X char c, *limit;
X! unsigned long offset, offset1;
X register struct rs_struct *rs;
X***************
X*** 290,293 ****
X limit = &rs->rs_buf[RS_BUF_SIZE - SPARE];
X! segment = (tp->tty_phys >> 4) & WORD_MASK;
X! offset = tp->tty_phys & OFF_MASK;
X offset1 = offset;
X--- 292,294 ----
X limit = &rs->rs_buf[RS_BUF_SIZE - SPARE];
X! offset = tp->tty_phys;
X offset1 = offset;
X***************
X*** 296,298 ****
X while (tp->tty_outleft > 0 && rs->rs_next + rs->rs_left < limit) {
X! c = get_byte(segment, offset); /* fetch 1 byte */
X offset++;
X--- 297,299 ----
X while (tp->tty_outleft > 0 && rs->rs_next + rs->rs_left < limit) {
X! c = get_phys_byte(offset); /* fetch 1 byte */
X offset++;
X***************
X*** 322,324 ****
X *===========================================================================*/
X! PRIVATE rs_out_char(tp, c)
X register struct tty_struct *tp; /* pointer to tty struct */
X--- 323,325 ----
X *===========================================================================*/
X! PUBLIC rs_out_char(tp, c)
X register struct tty_struct *tp; /* pointer to tty struct */
X***************
X*** 420,425 ****
X caller = (int) tp->tty_outproc;
X- tty_reply(REVIVE, replyee, caller, tp->tty_cum, 0L, 0L);
X tp->tty_waiting = NOT_WAITING;
X output_done--;
X! restore(old_state);
X return(1);
X--- 421,426 ----
X caller = (int) tp->tty_outproc;
X tp->tty_waiting = NOT_WAITING;
X output_done--;
X! restore(old_state); /* don't try to lock the reply */
X! tty_reply(REVIVE, replyee, caller, tp->tty_cum, 0L, 0L);
X return(1);
X***************
X*** 453,455 ****
X *===========================================================================*/
X! PRIVATE init_rs232()
X {
X--- 454,456 ----
X *===========================================================================*/
X! PUBLIC init_rs232()
X {
X***************
X*** 491,492 ****
X--- 492,499 ----
X }
X+ #if NR_RS_LINES > 0
X+ enable_irq( RS232_IRQ );
X+ #endif
X+ #if NR_RS_LINES > 1
X+ enable_irq( SECONDARY_IRQ );
X+ #endif
X }
X***************
X*** 497,499 ****
X *===========================================================================*/
X! PRIVATE set_uart(line, mode, speeds)
X int line; /* which line number (>= NR_CONS) */
X--- 504,506 ----
X *===========================================================================*/
X! PUBLIC set_uart(line, mode, speeds)
X int line; /* which line number (>= NR_CONS) */
X***************
X*** 565,566 ****
X--- 572,604 ----
X port_out(base + RS232_LINE_CONTROL, line_controls);
X+ }
X+
X+
X+ /* Kludges to get this old tty version to work with the protected kernel. */
X+
X+ PUBLIC rs232_1handler()
X+ {
X+ rs232(1);
X+ }
X+
X+
X+ PUBLIC rs232_2handler()
X+ {
X+ rs232(2);
X+ }
X+
X+
X+ PUBLIC tty_wakeup()
X+ {
X+ /* Wake up TTY after a timeout if there is something to flush. */
X+
X+ #define WAKEUP_TIMEOUT (8*HZ/60)
X+
X+ static unsigned wakeup_timeout = WAKEUP_TIMEOUT;
X+
X+ lock();
X+ if (flush_flag && --wakeup_timeout == 0) {
X+ wakeup_timeout = WAKEUP_TIMEOUT;
X+ rs_flush();
X+ }
X+ unlock();
X }
END_OF_FILE
if test 3649 -ne `wc -c <'kerneldif/rs232.c.cdif'`; then
echo shar: \"'kerneldif/rs232.c.cdif'\" unpacked with wrong size!
fi
# end of 'kerneldif/rs232.c.cdif'
fi
if test -f 'kerneldif/sconst.h.cdif' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'kerneldif/sconst.h.cdif'\"
else
echo shar: Extracting \"'kerneldif/sconst.h.cdif'\" \(5266 characters\)
sed "s/^X//" >'kerneldif/sconst.h.cdif' <<'END_OF_FILE'
X*** /dev/null Thu Oct 13 22:40:42 1988
X--- kernel/sconst.h Sun Mar 26 01:22:20 1989
X***************
X*** 0 ****
X--- 1,168 ----
X+ /* Miscellaneous constants used in assembler code. */
X+ #define DS_286_OFFSET DS_286_INDEX*DESC_SIZE
X+ #define EM_MASK 0xFFF0 /* extended memory mask for hi word */
X+ #define ES_286_OFFSET ES_286_INDEX*DESC_SIZE
X+ #define HCHIGH_MASK 0x0F /* h/w click mask for low byte of hi word */
X+ #define HCLOW_MASK 0xF0 /* h/w click mask for low byte of low word */
X+ #define Msize 12 /* size of a message in 16-bit words */
X+ #define OFF_MASK 0x000F /* offset mask for long -> hclick:offset */
X+ #define TEST1PATTERN 0x55 /* memory test pattern 1 */
X+ #define TEST2PATTERN 0xAA /* memory test pattern 2 */
X+
X+ /* Opcodes (used in patching). */
X+ #define IRET_OPCODE 0xCF
X+ #define JMP_OPCODE 0xE9
X+ #define NOP_OPCODE 0x90
X+
X+ /* BIOS numbers. */
X+ #define EM_XFER_VEC 0x15 /* copy (normal or extended) memory */
X+ #define EM_XFER_FUNC 0x87
X+ #define GET_EXTMEM_VEC 0x15 /* get extended memory size */
X+ #define GET_EXTMEM_FUNC 0x88
X+ #define GET_MEM_VEC 0x12 /* get memory size */
X+ #define SET_PROTECT_VEC 0x15 /* set protected mode */
X+ #define SET_PROTECT_FUNC 0x89
X+
X+ /* 8259 mask bits. */
X+ #define AT_WINI_MASK 0x40 /* (1 << (AT_WINI_IRQ & 0x07)), etc */
X+ #define CLOCK_MASK 0x01
X+ #define ETHER_MASK 0x08
X+ #define FLOPPY_MASK 0x40
X+ #define KEYBOARD_MASK 0x02
X+ #define PRINTER_MASK 0x80
X+ #define RS232_MASK 0x10
X+ #define SECONDARY_MASK 0x08
X+ #define XT_WINI_MASK 0x20
X+
X+ /* Offsets in struct proc. They MUST match proc.h. Use '=' to define them
X+ * instead of '#define', so they can be built cumulatively (for easy changes)
X+ * without producing large macro expansions.
X+ */
X+ #if 0 /* uurghh, the duplicated labels cause asld to run out of memory */
X+ P_STACKBASE = 0
X+ ESREG = P_STACKBASE
X+ DSREG = ESREG + 2
X+ DIREG = DSREG + 2
X+ SIREG = DIREG + 2
X+ BPREG = SIREG + 2
X+ STREG = BPREG + 2 /* hole for another SP */
X+ BXREG = STREG + 2
X+ DXREG = BXREG + 2
X+ CXREG = DXREG + 2
X+ AXREG = CXREG + 2
X+ RETADR = AXREG + 2 /* return address for save() call */
X+ PCREG = RETADR + 2
X+ CSREG = PCREG + 2
X+ PSWREG = CSREG + 2
X+ SPREG = PSWREG + 2
X+ SSREG = SPREG + 2
X+ P_STACKTOP = SSREG + 2
X+ P_NR = P_STACKTOP
X+ P_LDT_SEL = P_NR + 2 /* assumes 16 bit ints */
X+ P_LDT = P_LDT_SEL + 2
X+ P_SPLIMIT = P_LDT_SEL + 16
X+ #endif
X+
X+ #define P_STACKBASE 0
X+ #define ESREG 0
X+ #define DSREG 2
X+ #define DIREG 4
X+ #define SIREG 6
X+ #define BPREG 8
X+ #define STREG 10 /* hole for another SP */
X+ #define BXREG 12
X+ #define DXREG 14
X+ #define CXREG 16
X+ #define AXREG 18
X+ #define RETADR 20 /* return address for save() call */
X+ #define PCREG 22
X+ #define CSREG 24
X+ #define PSWREG 26
X+ #define SPREG 28
X+ #define SSREG 30
X+ #define P_STACKTOP 32
X+ #define P_NR 32
X+ #define P_LDT_SEL 34 /* assumes 16 bit ints */
X+ #define P_LDT 36
X+ #define P_SPLIMIT 52
X+
X+ /* 286 tss offsets. */
X+ #define TSS2_S_BACKLINK 0
X+ #define TSS2_S_SP0 2
X+ #define TSS2_S_SS0 4
X+ #define TSS2_S_SP1 6
X+ #define TSS2_S_SS1 8
X+ #define TSS2_S_SP2 10
X+ #define TSS2_S_SS2 12
X+ #define TSS2_S_IP 14
X+ #define TSS2_S_FLAGS 16
X+ #define TSS2_S_AX 18
X+ #define TSS2_S_CX 20
X+ #define TSS2_S_DX 22
X+ #define TSS2_S_BX 24
X+ #define TSS2_S_SP 26
X+ #define TSS2_S_BP 28
X+ #define TSS2_S_SI 30
X+ #define TSS2_S_DI 32
X+ #define TSS2_S_ES 34
X+ #define TSS2_S_CS 36
X+ #define TSS2_S_SS 38
X+ #define TSS2_S_DS 40
X+ #define TSS2_S_LDT 42
X+ #define SIZEOF_TSS2_S 44
X+
X+ /* Macros to get some 8086 instructions through asld. */
X+ #ifdef ASLD
X+ #define callfar(s,o) calli o,s
X+ #define callfarptr(v) calli @v
X+ #define jmpfar(s,o) jmpi o,s
X+ #define jmpmem(adr) jmp @adr
X+ #define jmpreg(reg) jmp (reg)
X+ #define notop(n) [-[n]-1]
X+ #define orop + /* used only if same as add */
X+ #else
X+ #define callfar(s,o) call s:o
X+ #define callfarptr(v) call far [v]
X+ #define jmpfar(s,o) jmp s:o
X+ #define jmpmem(adr) jmp adr
X+ #define jmpreg(reg) jmp reg
X+ #define notop(n) (!(n))
X+ #define orop \ /* don't expose '\' to end of line */
X+ #endif /* ASLD */
X+
X+ /* Macros to get some 286 instructions through asld.
X+ * Some are used without i80286.
X+ */
X+ #ifdef ASLD
X+ #define ESC2 .byte 0x0F /* escape for some 286 instructions */
X+ #define defsgdt(adr) ESC2; add adr,ax /* may not be general */
X+ #define insw .byte 0x6D
X+ #define outsw .byte 0x6F
X+ #else
X+ #define defsgdt(adr) sgdt adr
X+ #endif
X+
X+ #ifdef i80286
X+ #ifdef ASLD
X+ #define deflgdt(adr) ESC2; add adr,dx /* may not be general */
X+ #define deflidt(adr) ESC2; add adr,bx /* may not be general */
X+ #define deflldt(adr) ESC2; addb adr,dl /* may not be general */
X+ #define defltrax ESC2; .byte 0x00,0xD8
X+ #define defsidt(adr) ESC2; add adr,cx /* may not be general */
X+ #define defsldt(adr) ESC2; addb adr,al /* may not be general */
X+ #define popa .byte 0x61
X+ #define pusha .byte 0x60
X+ #define pushi8(n) .byte 0x6A; .byte n
X+ #define pushi16(n) .byte 0x68; .word n
X+ #define use32
X+ #else
X+ #define deflgdt(adr) lgdt adr
X+ #define deflidt(adr) lidt adr
X+ #define deflldt(adr) lldt adr
X+ #define defltrax ltr ax
X+ #define defsidt(adr) sidt adr
X+ #define defsldt(adr) sldt adr
X+ #define pushi8(n) push #n
X+ #define pushi16(n) push #n
X+ #endif /* ASLD */
X+ #endif /* i80286 */
END_OF_FILE
if test 5266 -ne `wc -c <'kerneldif/sconst.h.cdif'`; then
echo shar: \"'kerneldif/sconst.h.cdif'\" unpacked with wrong size!
fi
# end of 'kerneldif/sconst.h.cdif'
fi
if test -f 'kerneldif/sglo.h.cdif' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'kerneldif/sglo.h.cdif'\"
else
echo shar: Extracting \"'kerneldif/sglo.h.cdif'\" \(4801 characters\)
sed "s/^X//" >'kerneldif/sglo.h.cdif' <<'END_OF_FILE'
X*** /dev/null Thu Oct 13 22:40:42 1988
X--- kernel/sglo.h Sun Mar 26 01:14:24 1989
X***************
X*** 0 ****
X--- 1,250 ----
X+ /* Functions, variables and data structures defined in various assembler
X+ * files. Each file should have a define like "#define KLIB88 .define" to
X+ * say what it is defining.
X+ */
X+
X+ .text
X+
X+ #ifndef DB286
X+ #define DB286 .extern
X+ #endif
X+ #ifndef KLIB88
X+ #define KLIB88 .extern
X+ #endif
X+ #ifndef KLIB286
X+ #define KLIB286 .extern
X+ #endif
X+ #ifndef MPX88
X+ #define MPX88 .extern
X+ #endif
X+ #ifndef MPX286
X+ #define MPX286 .extern
X+ #endif
X+ #ifndef RS2
X+ #define RS2 .extern
X+ #endif
X+
X+ /* Functions defined in db286.x. */
X+
X+ #ifdef i80286
X+ #ifdef DEBUGGER
X+ DB286 _debug2_exception
X+ DB286 _patch_phys_copy
X+ DB286 _unpatch_phys_copy
X+ #endif
X+ #endif
X+
X+ /* Functions defined in klib88.x. */
X+
X+ KLIB88 _ack_char
X+ KLIB88 _build_sig
X+ KLIB88 _check_mem
X+ KLIB88 _cim_at_wini
X+ KLIB88 _cim_printer
X+ KLIB88 _cim_xt_wini
X+ KLIB88 _cp_mess
X+ KLIB88 cret
X+ KLIB88 csv
X+ KLIB88 _exit
X+ KLIB88 .fat
X+ KLIB88 _get_phys_byte
X+ KLIB88 _get_chrome
X+ KLIB88 _get_ega
X+ KLIB88 _get_extmemsize
X+ KLIB88 _get_memsize
X+ KLIB88 _lock
X+ KLIB88 _phys_copy
X+ KLIB88 _porti_out
X+ KLIB88 _port_read
X+ KLIB88 _port_write
X+ KLIB88 _reboot
X+ KLIB88 _restore
X+ KLIB88 _save_tty_vec
X+ KLIB88 _scr_down
X+ KLIB88 _scr_up
X+ KLIB88 _sim_printer
X+ KLIB88 _tasim_printer
X+ KLIB88 _test_and_set
X+ KLIB88 .trp
X+ KLIB88 _unlock
X+ KLIB88 _vid_copy
X+ KLIB88 _wait_retrace
X+ KLIB88 _wreboot
X+
X+ #ifndef DEBUGGER
X+ KLIB88 _codeseg
X+ KLIB88 _dataseg
X+ KLIB88 _get_processor
X+ KLIB88 _inportb
X+ #endif
X+
X+ /* Functions defined in klib286.x. */
X+
X+ #ifdef i80286
X+ KLIB286 _klib286_init /* this patches the rest */
X+ #endif
X+
X+ /* Functions defined in mpx88.x. */
X+
X+ MPX88 begtext
X+ MPX88 _idle_task
X+ MPX88 kernel_ds
X+ MPX88 _restart
X+ MPX88 save
X+
X+ MPX88 _int00 /* exception handlers */
X+ MPX88 _int01
X+ MPX88 _int02
X+ MPX88 _int03
X+ MPX88 _int04
X+ MPX88 _int05
X+ MPX88 _int06
X+ MPX88 _int07
X+ MPX88 _int08
X+ MPX88 _int09
X+ MPX88 _int10
X+ MPX88 _int11
X+ MPX88 _int12
X+ MPX88 _int13
X+ MPX88 _int14
X+ MPX88 _int15
X+ MPX88 _int16
X+ MPX88 _trp
X+
X+ MPX88 _clock_int /* interrupt handlers */
X+ MPX88 _tty_int
X+ #ifdef C_RS232_INT_HANDLERS
X+ MPX88 _secondary_int
X+ MPX88 _rs232_int
X+ #ifdef i80286
X+ MPX88 _psecondary_int
X+ MPX88 _prs232_int
X+ #endif
X+ #endif
X+ MPX88 _wini_int
X+ MPX88 _disk_int
X+ MPX88 _lpr_int
X+
X+ MPX88 _s_call /* trap handlers */
X+
X+ /* Functions defined in mpx286.x. */
X+
X+ #ifdef i80286
X+ MPX286 p2_errexception
X+ MPX286 p2_save
X+ MPX286 p2_resdone
X+ MPX286 p_restart
X+
X+ MPX286 _divide_error /* exception handlers */
X+ MPX286 _nmi
X+ MPX286 _overflow
X+ MPX286 _bounds_check
X+ MPX286 _inval_opcode
X+ MPX286 _copr_not_available
X+ MPX286 _double_fault
X+ MPX286 _copr_seg_overrun
X+ MPX286 _inval_tss
X+ MPX286 _segment_not_present
X+ MPX286 _stack_exception
X+ MPX286 _general_protection
X+
X+ MPX286 _p2_s_call /* trap handlers */
X+ #endif /* i80286 */
X+
X+ /* Functions defined in rs2.x. */
X+
X+ #ifndef C_RS232_INT_HANDLERS
X+ #ifdef i80286
X+ RS2 _prs232_int
X+ RS2 _psecondary_int
X+ RS2 rs2_iret
X+ #endif
X+ RS2 _rs232_int
X+ RS2 _secondary_int
X+ #endif
X+
X+ /* C functions. */
X+
X+ .extern _clock_handler
X+ #ifdef DEBUGGER
X+ .extern _db_main /* old real mode debugger */
X+ #endif
X+ .extern _dp8390_int
X+ .extern _eth_stp
X+ .extern _exception
X+ .extern _init_8259
X+ .extern _interrupt
X+ .extern _keyboard
X+ .extern _main
X+ .extern _panic
X+ .extern _pr_char
X+ #ifdef C_RS232_INT_HANDLERS
X+ #ifdef OLD_TTY
X+ .extern _rs232
X+ #else
X+ .extern _rs232_1handler
X+ .extern _rs232_2handler
X+ #endif
X+ #endif
X+ .extern _scan_keyboard
X+ .extern _sys_call
X+ #ifndef OLD_TTY
X+ .extern _tty_wakeup
X+ #endif
X+ .extern _unhold
X+
X+ .bss
X+
X+ /* Variables defined in klib88.x. */
X+
X+ KLIB88 splimit
X+ KLIB88 _vec_table
X+
X+ /* Variables defined in mpx88.x. */
X+
X+ MPX88 begbss
X+ MPX88 begdata
X+ MPX88 k_stktop
X+ MPX88 _sizes
X+
X+ /* Variables defined in mpx286.x. */
X+
X+ #ifdef i80286
X+ MPX286 ds_ex_number
X+ MPX286 trap_errno
X+ #endif
X+
X+ /* C variables. */
X+
X+ .extern _blank_color
X+ .extern _boot_parameters
X+ .extern _held_head
X+ .extern _held_tail
X+ .extern _k_reenter
X+ .extern _pc_at
X+ .extern _port_65
X+ .extern _proc_ptr
X+ .extern _processor
X+ .extern _ps
X+ .extern _scan_code
X+ .extern _sizeof_bparam
X+ .extern _snow
X+ #ifndef C_RS232_INT_HANDLERS
X+ .extern _rs_lines
X+ .extern _tty_events
X+ #endif
X+ .extern _vid_mask
X+ .extern _vid_port
X+
X+ #ifdef i80286
X+ #ifdef DEBUGGER
X+ .extern _bits32
X+ .extern _db_processor
X+ .extern _db_tss
X+ .extern _protected
X+ #endif
X+ .extern _gdt
X+ .extern _tss
X+ #endif
X+
X+ .text
END_OF_FILE
if test 4801 -ne `wc -c <'kerneldif/sglo.h.cdif'`; then
echo shar: \"'kerneldif/sglo.h.cdif'\" unpacked with wrong size!
fi
# end of 'kerneldif/sglo.h.cdif'
fi
if test -f 'kerneldif/xt_wini.c.cdif' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'kerneldif/xt_wini.c.cdif'\"
else
echo shar: Extracting \"'kerneldif/xt_wini.c.cdif'\" \(4227 characters\)
sed "s/^X//" >'kerneldif/xt_wini.c.cdif' <<'END_OF_FILE'
X*** kernel-1.3/xt_wini.c Sat Oct 15 20:17:38 1988
X--- kernel/xt_wini.c Sun Mar 26 01:30:14 1989
X***************
X*** 247,249 ****
X
X! int mode, low_addr, high_addr, top_addr, low_ct, high_ct, top_end, old_state;
X vir_bytes vir, ct;
X--- 247,249 ----
X
X! int mode, low_addr, high_addr, top_addr, low_ct, high_ct, top_end;
X vir_bytes vir, ct;
X***************
X*** 273,275 ****
X /* Now set up the DMA registers. */
X- old_state = lock();
X port_out(DMA_M2, mode); /* set the DMA mode */
X--- 273,274 ----
X***************
X*** 281,283 ****
X port_out(DMA_COUNT, high_ct); /* output high 8 bits of count - 1 */
X- restore(old_state);
X }
X--- 280,281 ----
X***************
X*** 319,323 ****
X /*===========================================================================*
X! * win_results *
X *===========================================================================*/
X! PRIVATE int win_results(wn)
X register struct wini *wn; /* pointer to the drive struct */
X--- 317,321 ----
X /*===========================================================================*
X! * old_win_results *
X *===========================================================================*/
X! PRIVATE int old_win_results(wn)
X register struct wini *wn; /* pointer to the drive struct */
X***************
X*** 479,482 ****
X {
X- int old_state;
X-
X command[0] = WIN_SPECIFY; /* Specify some parameters */
X--- 477,478 ----
X***************
X*** 486,488 ****
X return(ERR);
X- old_state = lock();
X
X--- 482,483 ----
X***************
X*** 511,513 ****
X win_out(paramp->max_ecc);
X- restore(old_state);
X
X--- 506,507 ----
X***************
X*** 601,603 ****
X register int i;
X! int r, old_state;
X
X--- 595,597 ----
X register int i;
X! int r;
X
X***************
X*** 617,620 ****
X
X- old_state = lock();
X-
X for (i=0; i<6; i++) {
X--- 611,612 ----
X***************
X*** 632,635 ****
X
X- restore(old_state);
X-
X if(i != 6) {
X--- 624,625 ----
X***************
X*** 644,645 ****
X--- 634,636 ----
X *===========================================================================*/
X+
X PRIVATE init_params()
X***************
X*** 656,658 ****
X /* Get the number of drives from the bios */
X! phys_copy(0x475L, umap(proc_addr(WINCHESTER), D, buf, 1), 1L);
X nr_drives = (int) *buf > MAX_DRIVES ? MAX_DRIVES : (int) *buf;
X--- 647,649 ----
X /* Get the number of drives from the bios */
X! phys_copy(0x475L, umap(cproc_addr(WINCHESTER), D, buf, 1), 1L);
X nr_drives = (int) *buf > MAX_DRIVES ? MAX_DRIVES : (int) *buf;
X***************
X*** 731,733 ****
X address = ((phys_bytes)segment << 4) + offset;
X! phys_copy(address, umap(proc_addr(WINCHESTER), D, buf, 64), 64L);
X
X--- 722,724 ----
X address = ((phys_bytes)segment << 4) + offset;
X! phys_copy(address, umap(cproc_addr(WINCHESTER), D, buf, 64), 64L);
X
X***************
X*** 783,787 ****
X /*==========================================================================*
X! * copy_params *
X *==========================================================================*/
X! PRIVATE copy_params(src, dest)
X register unsigned char *src;
X--- 774,778 ----
X /*==========================================================================*
X! * copy_param *
X *==========================================================================*/
X! PRIVATE copy_param(src, dest)
X register unsigned char *src;
X***************
X*** 820,821 ****
X--- 811,813 ----
X wn->wn_low = *(long *)&buf[offset];
X+ #ifdef STUPID_WINI_ADJUST
X if ((wn->wn_low % (BLOCK_SIZE/SECTOR_SIZE)) != 0) {
X***************
X*** 825,826 ****
X--- 817,819 ----
X }
X+ #endif
X wn->wn_size = *(long *)&buf[offset + sizeof(long)] - adjust;
X***************
X*** 853 ****
X--- 846,863 ----
X
X+
X+ /*==========================================================================*
X+ * win_results *
X+ *==========================================================================*/
X+ PRIVATE int win_results(wn)
X+ register struct wini *wn; /* pointer to the drive struct */
X+ {
X+ /* Extract results from the controller after an operation, then reenable the
X+ * interrupt controller.
X+ */
X+
X+ int r;
X+
X+ r = old_win_results(wn);
X+ cim_xt_wini();
X+ return(r);
X+ }
END_OF_FILE
if test 4227 -ne `wc -c <'kerneldif/xt_wini.c.cdif'`; then
echo shar: \"'kerneldif/xt_wini.c.cdif'\" unpacked with wrong size!
fi
# end of 'kerneldif/xt_wini.c.cdif'
fi
if test -f 'libdif/head.s.cdif' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'libdif/head.s.cdif'\"
else
echo shar: Extracting \"'libdif/head.s.cdif'\" \(1162 characters\)
sed "s/^X//" >'libdif/head.s.cdif' <<'END_OF_FILE'
X*** lib-1.3/IBM_PC/head.s Wed Nov 2 09:00:07 1988
X--- lib/IBM_PC/head.s Thu Feb 16 02:07:37 1989
X***************
X*** 4,6 ****
X jmp L0
X! .zerow 7 | kernel uses this area as stack for inital IRET
X L0: mov sp,_stackpt
X--- 4,8 ----
X jmp L0
X! .zerow 13 | stack for inital IRET when common I&D
X! | also padding to make INIT_SP same as
X! | for separate I&D
X L0: mov sp,_stackpt
X***************
X*** 12,15 ****
X _data_org: | fs needs to know where build stuffed table
X! .word 0xDADA,0,0,0,0,0,0,0 | first 8 words of MM, FS, INIT are for stack
X! | 0xDADA is magic number for build
X .bss
X--- 14,25 ----
X _data_org: | fs needs to know where build stuffed table
X! .word 0xDADA | magic number for build
X! .word 8 | CLICK_SHIFT to check - must match h/const.h
X! .word 0,0,0 | used by FS only for sizes of init
X! | stack for separate I&D follows
X! .word 0,0,0 | for ip:ss:f pushed by debugger traps
X! .word 0,0,0 | for cs:ds:ret adr in save()
X! | this was missing - a bug as late as V1.3c
X! | for ds for new restart() as well
X! .word 0,0,0 | for ip:ss:f built by restart()
X! | so INIT_SP in const.h must be 0x1C
X .bss
END_OF_FILE
if test 1162 -ne `wc -c <'libdif/head.s.cdif'`; then
echo shar: \"'libdif/head.s.cdif'\" unpacked with wrong size!
fi
# end of 'libdif/head.s.cdif'
fi
if test -f 'toolsdif/fsck1.s.cdif' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'toolsdif/fsck1.s.cdif'\"
else
echo shar: Extracting \"'toolsdif/fsck1.s.cdif'\" \(462 characters\)
sed "s/^X//" >'toolsdif/fsck1.s.cdif' <<'END_OF_FILE'
X*** tools-1.3/fsck1.s Wed Nov 2 09:00:07 1988
X--- tools/fsck1.s Wed Mar 22 05:04:23 1989
X***************
X*** 25,26 ****
X--- 33,40 ----
X mov bx,ax | put scan code for '=' in bx
X+ sub ax,ax | ax == 0 to show new boot (was scan code)
X+ mov si,#_boot_parameters | pointer to boot parameters in di:si
X+ mov di,ds
X+ mov cx,#10 | sizeof structure in cx
X+ | next 'cli' and setting up segs is redundant
X+ | and the segments are wrong for sep I&D
X cli
END_OF_FILE
if test 462 -ne `wc -c <'toolsdif/fsck1.s.cdif'`; then
echo shar: \"'toolsdif/fsck1.s.cdif'\" unpacked with wrong size!
fi
# end of 'toolsdif/fsck1.s.cdif'
fi
echo shar: End of archive 8 \(of 10\).
cp /dev/null ark8isdone
MISSING=""
for I in 1 2 3 4 5 6 7 8 9 10 ; do
if test ! -f ark${I}isdone ; then
MISSING="${MISSING} ${I}"
fi
done
if test "${MISSING}" = "" ; then
echo You have unpacked all 10 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
--
Division of Information Technology (Melbourne), Phone +61 3 347 8644
C.S.I.R.O. Fax +61 3 347 8987
55 Barry St. Telex AA 152914
Carlton, Vic, 3053, Australia E-mail: worsley@ditmela.oz.au