Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!seismo!husc6!mit-eddie!uw-beaver!tikal!amc!ipmoea!ericr From: ericr@ipmoea.UUCP (Eric Roskos) Newsgroups: comp.os.minix Subject: Changes to compile Minix with MSC (lib changes: 4 of 12) Message-ID: <14@ipmoea.UUCP> Date: Wed, 5-Aug-87 20:00:00 EDT Article-I.D.: ipmoea.14 Posted: Wed Aug 5 20:00:00 1987 Date-Received: Sat, 8-Aug-87 19:37:37 EDT Reply-To: ericr@ipmoea.UUCP (Eric Roskos) Organization: Redmond, WA Lines: 1020 Directory: /usr2/ericr/minix/minix/lib ------------------------------------------------------------ *** catchsig.asm Sat Aug 1 13:36:05 1987 --- ../../dos/lib/catchsig.asm Sat Aug 1 13:30:07 1987 *************** *** 3,10 INCLUDE ..\lib\prologue.h ! PUBLIC begsig ! EXTRN vectab:WORD, M:WORD @CODE SEGMENT --- 3,10 ----- INCLUDE ..\lib\prologue.h ! PUBLIC _begsig ! EXTRN _vectab:WORD, _M:WORD _TEXT SEGMENT *************** *** 7,14 EXTRN vectab:WORD, M:WORD ! @CODE SEGMENT ! ASSUME CS:@CODE,DS:DGROUP MTYPE = 2 ; M+mtype = &M.m_type begsig: --- 7,14 ----- EXTRN _vectab:WORD, _M:WORD ! _TEXT SEGMENT ! ASSUME CS:_TEXT,DS:DGROUP MTYPE = 2 ; M+mtype = &M.m_type _begsig: *************** *** 11,17 ASSUME CS:@CODE,DS:DGROUP MTYPE = 2 ; M+mtype = &M.m_type ! begsig: push ax ; after interrupt, save all regs push bx push cx --- 11,17 ----- ASSUME CS:_TEXT,DS:DGROUP MTYPE = 2 ; M+mtype = &M.m_type ! _begsig: push ax ; after interrupt, save all regs push bx push cx *************** *** 25,32 mov bx,18[bp] ; bx = signal number dec bx ; vectab[0] is for sig 1 add bx,bx ; pointers are two bytes on 8088 ! mov bx,vectab[bx] ; bx = address of routine to call ! push M+mtype ; push status of last system call push ax ; func called with signal number as arg call bx back: --- 25,32 ----- mov bx,18[bp] ; bx = signal number dec bx ; vectab[0] is for sig 1 add bx,bx ; pointers are two bytes on 8088 ! mov bx,_vectab[bx] ; bx = address of routine to call ! push _M+mtype ; push status of last system call push ax ; func called with signal number as arg call bx back: *************** *** 31,37 call bx back: pop ax ; get signal number off stack ! pop M+mtype ; restore status of previous system call pop es ; signal handling finished pop ds pop bp --- 31,37 ----- call bx back: pop ax ; get signal number off stack ! pop _M+mtype ; restore status of previous system call pop es ; signal handling finished pop ds pop bp *************** *** 43,49 pop ax pop dummy ; remove signal number from stack iret ! @CODE ENDS @DATAI SEGMENT dummy DW 0 --- 43,49 ----- pop ax pop dummy ; remove signal number from stack iret ! _TEXT ENDS _DATA SEGMENT dummy DW 0 *************** *** 45,51 iret @CODE ENDS ! @DATAI SEGMENT dummy DW 0 @DATAI ENDS --- 45,51 ----- iret _TEXT ENDS ! _DATA SEGMENT dummy DW 0 _DATA ENDS *************** *** 47,52 @DATAI SEGMENT dummy DW 0 ! @DATAI ENDS END ; end of assembly-file --- 47,52 ----- _DATA SEGMENT dummy DW 0 ! _DATA ENDS END ; end of assembly-file ------------------------------------------------------------ *** crtso.asm Sat Aug 1 13:36:11 1987 --- ../../dos/lib/crtso.asm Sat Aug 1 13:30:18 1987 *************** *** 3,10 ! PUBLIC @end, brksize, edata, $main, environ, kamikaze ! EXTRN main:NEAR, exit:NEAR INCLUDE ..\lib\prologue.h --- 3,10 ----- ! PUBLIC _end, _brksize, _edata, $main, _environ, _kamikaze ! EXTRN _main:NEAR, _exit:NEAR INCLUDE ..\lib\prologue.h *************** *** 10,15 STACKSIZE EQU 2560 ; default stack is 5 Kb (2K words) @CODE SEGMENT --- 10,17 ----- STACKSIZE EQU 2560 ; default stack is 5 Kb (2K words) + PUBLIC __acrtused + __acrtused EQU 9876H ; used by MSC to pull in startup routine *************** *** 12,19 - @CODE SEGMENT - ASSUME CS:@CODE,DS:DGROUP ; This is the C run-time start-off routine. It's job is to take the ; arguments as put on the stack by EXEC, and to parse them and set them up the --- 14,19 ----- __acrtused EQU 9876H ; used by MSC to pull in startup routine _TEXT SEGMENT ASSUME CS:_TEXT,DS:DGROUP *************** *** 15,20 @CODE SEGMENT ASSUME CS:@CODE,DS:DGROUP ; This is the C run-time start-off routine. It's job is to take the ; arguments as put on the stack by EXEC, and to parse them and set them up the ; way main expects them. --- 15,23 ----- + _TEXT SEGMENT + ASSUME CS:_TEXT,DS:DGROUP + ; This is the C run-time start-off routine. It's job is to take the ; arguments as put on the stack by EXEC, and to parse them and set them up the ; way main expects them. *************** *** 29,35 inc ax ; calculate envp shl ax,1 add ax,bx ! mov environ,ax ; save envp push ax ; stack envp push bx ; stack argv push cx ; stack argc --- 32,38 ----- inc ax ; calculate envp shl ax,1 add ax,bx ! mov _environ,ax ; save envp push ax ; stack envp push bx ; stack argv push cx ; stack argc *************** *** 34,40 push bx ; stack argv push cx ; stack argc ! call main ; call main (arc,argv,envp) add sp,6 push ax ; stack program-termination status --- 37,43 ----- push bx ; stack argv push cx ; stack argc ! call _main ; call main (arc,argv,envp) add sp,6 push ax ; stack program-termination status *************** *** 38,44 add sp,6 push ax ; stack program-termination status ! call exit ; this will never return ; DEBUG from here on --- 41,47 ----- add sp,6 push ax ; stack program-termination status ! call _exit ; this will never return ; DEBUG from here on *************** *** 42,48 ; DEBUG from here on ! kamikaze: int 3 ret @CODE ENDS --- 45,51 ----- ; DEBUG from here on ! _kamikaze: int 3 ret _TEXT ENDS *************** *** 45,51 kamikaze: int 3 ret ! @CODE ENDS @DATAC SEGMENT --- 48,54 ----- _kamikaze: int 3 ret ! _TEXT ENDS _DATA SEGMENT *************** *** 48,57 @CODE ENDS ! @DATAC SEGMENT ! brksize DW offset dgroup:@END+2 ; dynamic changeable end of bss ! environ DW 0 ; save environment pointer here ! @DATAC ENDS @DATAT SEGMENT ; DATAT holds nothing. The label just edata label byte ; tells us where the initialized data --- 51,60 ----- _TEXT ENDS ! _DATA SEGMENT ! _brksize DW offset dgroup:_END+2 ; dynamic changeable end of bss ! _environ DW 0 ; save environment pointer here ! _DATA ENDS _DATAT SEGMENT ; DATAT holds nothing. The label just _edata label byte ; tells us where the initialized data *************** *** 53,61 environ DW 0 ; save environment pointer here @DATAC ENDS ! @DATAT SEGMENT ; DATAT holds nothing. The label just ! edata label byte ; tells us where the initialized data ! @DATAT ENDS ; (.data) ends. @DATAV SEGMENT ; DATAV holds nothing. The label in @end label byte ; the segment just tells us where --- 56,64 ----- _environ DW 0 ; save environment pointer here _DATA ENDS ! _DATAT SEGMENT ; DATAT holds nothing. The label just ! _edata label byte ; tells us where the initialized data ! _DATAT ENDS ; (.data) ends. _DATAV SEGMENT ; DATAV holds nothing. The label in _end label byte ; the segment just tells us where *************** *** 57,65 edata label byte ; tells us where the initialized data @DATAT ENDS ; (.data) ends. ! @DATAV SEGMENT ; DATAV holds nothing. The label in ! @end label byte ; the segment just tells us where ! @DATAV ENDS ; the data+bss ends. @STACK SEGMENT BYTE STACK 'STACK' DW STACKSIZE dup(?) ; add stack segment to bss --- 60,68 ----- _edata label byte ; tells us where the initialized data _DATAT ENDS ; (.data) ends. ! _DATAV SEGMENT ; DATAV holds nothing. The label in ! _end label byte ; the segment just tells us where ! _DATAV ENDS ; the data+bss ends. _STACK SEGMENT BYTE STACK 'STACK' DW STACKSIZE dup(?) ; add stack segment to bss *************** *** 61,67 @end label byte ; the segment just tells us where @DATAV ENDS ; the data+bss ends. ! @STACK SEGMENT BYTE STACK 'STACK' DW STACKSIZE dup(?) ; add stack segment to bss @STACK ENDS --- 64,70 ----- _end label byte ; the segment just tells us where _DATAV ENDS ; the data+bss ends. ! _STACK SEGMENT BYTE STACK 'STACK' DW STACKSIZE dup(?) ; add stack segment to bss _STACK ENDS *************** *** 63,69 @STACK SEGMENT BYTE STACK 'STACK' DW STACKSIZE dup(?) ; add stack segment to bss ! @STACK ENDS END $main ; program entry-point (could be anywhere) --- 66,72 ----- _STACK SEGMENT BYTE STACK 'STACK' DW STACKSIZE dup(?) ; add stack segment to bss ! _STACK ENDS END $main ; program entry-point (could be anywhere) ------------------------------------------------------------ *** getutil.asm Sat Aug 1 13:35:51 1987 --- ../../dos/lib/getutil.asm Sat Aug 1 13:29:47 1987 *************** *** 4,11 INCLUDE ..\lib\prologue.h ! PUBLIC get_base, get_size, get_tot_ ! EXTRN brksize:WORD, @end:byte @CODE SEGMENT --- 4,11 ----- INCLUDE ..\lib\prologue.h ! PUBLIC _get_base, _get_size, _get_tot_mem ! EXTRN _brksize:WORD, _end:byte _TEXT SEGMENT *************** *** 8,15 EXTRN brksize:WORD, @end:byte ! @CODE SEGMENT ! ASSUME CS:@CODE,DS:DGROUP ;======================================================================== ; utilities --- 8,15 ----- EXTRN _brksize:WORD, _end:byte ! _TEXT SEGMENT ! ASSUME CS:_TEXT,DS:DGROUP ;======================================================================== ; utilities *************** *** 15,21 ; utilities ;======================================================================== ! get_base: ; return click at which prog starts mov ax,ds ret --- 15,21 ----- ; utilities ;======================================================================== ! _get_base: ; return click at which prog starts mov ax,ds ret *************** *** 19,26 mov ax,ds ret ! get_size: ; return prog size in bytes [text+data+bss] ! mov ax,offset dgroup:@end ; end is label at end of bss ret ; Find out how much memory the machine has, including vectors, kernel MM, etc. --- 19,26 ----- mov ax,ds ret ! _get_size: ; return prog size in bytes [text+data+bss] ! mov ax,offset dgroup:_end ; end is label at end of bss ret ; Find out how much memory the machine has, including vectors, kernel MM, etc. *************** *** 24,30 ret ; Find out how much memory the machine has, including vectors, kernel MM, etc. ! get_tot_: cli push es push di --- 24,30 ----- ret ; Find out how much memory the machine has, including vectors, kernel MM, etc. ! _get_tot_mem: cli push es push di *************** *** 44,49 sti ret ! @CODE ENDS END ; end of assembly-file --- 44,49 ----- sti ret ! _TEXT ENDS END ; end of assembly-file ------------------------------------------------------------ *** head.asm Sat Aug 1 13:36:11 1987 --- ../../dos/lib/head.asm Sat Aug 1 13:30:14 1987 *************** *** 1,4 ! title Head - Start-off for initt, mm and fs (C86-compiler) page ,132 EXTRN main:NEAR --- 1,4 ----- ! title Head - Start-off for init, mm and fs (C86-compiler) page ,132 PUBLIC __acrtused ; magic symbol for MSC (indicates startup present) *************** *** 1,9 title Head - Start-off for initt, mm and fs (C86-compiler) page ,132 ! EXTRN main:NEAR ! PUBLIC $main, data_org, brksize, sp_limit, @end ! EXTRN stackpt:word INCLUDE ..\lib\prologue.h --- 1,8 ----- title Head - Start-off for init, mm and fs (C86-compiler) page ,132 ! PUBLIC __acrtused ; magic symbol for MSC (indicates startup present) ! __acrtused EQU 9876H EXTRN _main:NEAR PUBLIC $main, _data_org, _brksize, _sp_limit, _end *************** *** 5,10 PUBLIC $main, data_org, brksize, sp_limit, @end EXTRN stackpt:word INCLUDE ..\lib\prologue.h --- 4,13 ----- PUBLIC __acrtused ; magic symbol for MSC (indicates startup present) __acrtused EQU 9876H + EXTRN _main:NEAR + PUBLIC $main, _data_org, _brksize, _sp_limit, _end + EXTRN _stackpt:word, + INCLUDE ..\lib\prologue.h *************** *** 8,15 INCLUDE ..\lib\prologue.h ! @CODE SEGMENT ! assume cs:@code,ds:dgroup $main: jmp short L0 ORG 10h ; kernel uses this area as stack for inital IRET --- 11,18 ----- INCLUDE ..\lib\prologue.h ! _TEXT SEGMENT ! assume cs:_TEXT,ds:dgroup $main: jmp short L0 ORG 10h ; kernel uses this area as stack for inital IRET *************** *** 13,20 $main: jmp short L0 ORG 10h ; kernel uses this area as stack for inital IRET ! L0:mov sp,dgroup:stackpt ! call main L1:jmp L1 ; this will never be executed mov ax,DGROUP ; force relocation for dos2out (never executed) --- 16,23 ----- $main: jmp short L0 ORG 10h ; kernel uses this area as stack for inital IRET ! L0:mov sp,dgroup:_stackpt ! call _main L1:jmp L1 ; this will never be executed mov ax,DGROUP ; force relocation for dos2out (never executed) *************** *** 18,24 L1:jmp L1 ; this will never be executed mov ax,DGROUP ; force relocation for dos2out (never executed) ! @CODE ENDS @DATAB SEGMENT ; fs needs to know where build stuffed table --- 21,27 ----- L1:jmp L1 ; this will never be executed mov ax,DGROUP ; force relocation for dos2out (never executed) ! _TEXT ENDS _DATAB SEGMENT ; fs needs to know where build stuffed table *************** *** 21,28 @CODE ENDS ! @DATAB SEGMENT ; fs needs to know where build stuffed table ! data_org DW 0DADAh ; 0xDADA is magic number for build DW 7 dup(0) ; first 8 words of MM, FS, INIT are for stack brksize DW offset dgroup:@END ; first free memory sp_limit DW 0 --- 24,31 ----- _TEXT ENDS ! _DATAB SEGMENT ; fs needs to know where build stuffed table ! _data_org DW 0DADAh ; 0xDADA is magic number for build DW 7 dup(0) ; first 8 words of MM, FS, INIT are for stack _brksize DW offset dgroup:_END ; first free memory _sp_limit DW 0 *************** *** 24,32 @DATAB SEGMENT ; fs needs to know where build stuffed table data_org DW 0DADAh ; 0xDADA is magic number for build DW 7 dup(0) ; first 8 words of MM, FS, INIT are for stack ! brksize DW offset dgroup:@END ; first free memory ! sp_limit DW 0 ! @DATAB ENDS @DATAV SEGMENT ; DATAV holds nothing. The label in @END label byte ; the segment just tells us where --- 27,35 ----- _DATAB SEGMENT ; fs needs to know where build stuffed table _data_org DW 0DADAh ; 0xDADA is magic number for build DW 7 dup(0) ; first 8 words of MM, FS, INIT are for stack ! _brksize DW offset dgroup:_END ; first free memory ! _sp_limit DW 0 ! _DATAB ENDS _DATAV SEGMENT ; DATAV holds nothing. The label in _END label byte ; the segment just tells us where *************** *** 28,36 sp_limit DW 0 @DATAB ENDS ! @DATAV SEGMENT ; DATAV holds nothing. The label in ! @END label byte ; the segment just tells us where ! @DATAV ENDS ; the data+bss ends. @STACK SEGMENT BYTE STACK 'STACK' @STACK ENDS ; Add stack to satisfy DOS-linker --- 31,39 ----- _sp_limit DW 0 _DATAB ENDS ! _DATAV SEGMENT ; DATAV holds nothing. The label in ! _END label byte ; the segment just tells us where ! _DATAV ENDS ; the data+bss ends. @STACK SEGMENT BYTE STACK 'STACK' @STACK ENDS ; Add stack to satisfy DOS-linker ------------------------------------------------------------ *** message.c Sat Aug 1 13:36:05 1987 --- ../../dos/lib/message.c Sat Aug 1 13:30:10 1987 *************** *** 1,4 #include "../h/const.h" #include "../h/type.h" ! message M; --- 1,4 ----- #include "../h/const.h" #include "../h/type.h" ! message M = {0}; /* dummy init so linker will recognize this symbol */ ------------------------------------------------------------ *** prologue.h Sat Aug 1 13:35:57 1987 --- ../../dos/lib/prologue.h Sat Aug 1 13:29:52 1987 *************** *** 1,6 ; prologue.h ! ; standard prologue for c86 assembly code ; This file defines the correct ordering of segments @CODE SEGMENT BYTE PUBLIC 'CODE' ; text segment --- 1,6 ----- ; prologue.h ! ; standard prologue for MSC assembly code ; This file defines the correct ordering of segments ifdef debug *************** *** 3,22 ; standard prologue for c86 assembly code ; This file defines the correct ordering of segments ! @CODE SEGMENT BYTE PUBLIC 'CODE' ; text segment ! @CODE ENDS ! @DATAB SEGMENT PARA PUBLIC 'DATAB' ; data segment ! @DATAB ENDS ! @DATAC SEGMENT BYTE PUBLIC 'DATAC' ; data segment ! @DATAC ENDS ! @DATAI SEGMENT BYTE PUBLIC 'DATAI' ; data segment ! @DATAI ENDS ! @DATAT SEGMENT BYTE PUBLIC 'DATAT' ; bss segment ! @DATAT ENDS ! @DATAU SEGMENT BYTE PUBLIC 'DATAU' ; bss segment ! @DATAU ENDS ! @DATAV SEGMENT BYTE PUBLIC 'DATAV' ; bss segment ! @DATAV ENDS DGROUP GROUP @DATAB,@DATAC,@DATAI,@DATAT,@DATAU,@DATAV --- 3,13 ----- ; standard prologue for MSC assembly code ; This file defines the correct ordering of segments ! ifdef debug ! if1 ! %out Debug messages enabled ! endif ! endif _TEXT SEGMENT BYTE PUBLIC 'CODE' _TEXT ENDS *************** *** 18,22 @DATAV SEGMENT BYTE PUBLIC 'DATAV' ; bss segment @DATAV ENDS DGROUP GROUP @DATAB,@DATAC,@DATAI,@DATAT,@DATAU,@DATAV --- 9,32 ----- endif endif + _TEXT SEGMENT BYTE PUBLIC 'CODE' + _TEXT ENDS + _DATAB SEGMENT PARA PUBLIC 'DATA' + _DATAB ENDS + _DATA SEGMENT BYTE PUBLIC 'DATA' + _DATA ENDS + CONST SEGMENT BYTE PUBLIC 'CONST' + CONST ENDS + _DATAT SEGMENT BYTE PUBLIC 'CONST' + _DATAT ENDS + _BSS SEGMENT BYTE PUBLIC 'BSS' + _BSS ENDS + C_COMMON SEGMENT BYTE PUBLIC 'BSS' + C_COMMON ENDS + _DATAU SEGMENT BYTE PUBLIC 'BSS' + _DATAU ENDS + _DATAV SEGMENT BYTE PUBLIC 'BSS' + _DATAV ENDS DGROUP GROUP _DATAB, _DATA, CONST, _DATAT, _BSS, C_COMMON, _DATAV *************** *** 19,22 @DATAV ENDS ! DGROUP GROUP @DATAB,@DATAC,@DATAI,@DATAT,@DATAU,@DATAV --- 28,60 ----- _DATAV SEGMENT BYTE PUBLIC 'BSS' _DATAV ENDS ! DGROUP GROUP _DATAB, _DATA, CONST, _DATAT, _BSS, C_COMMON, _DATAV ! ! ASSUME CS: _TEXT, DS: DGROUP, SS: DGROUP, ES: DGROUP ! ! ; ! ; Debugging message macro - JER ! ; ! ! wto macro mesg ! local msgstr ! ! ifdef debug ! ! public msgstr ; DEBUG so we can find it in the linker map ! _data segment ! msgstr db mesg ! db 0dH,0aH,00H ! _data ends ! ! push ax ! push bx ! mov bx,offset msgstr ! mov ax,bx ;DEBUG ! call prtax ;DEBUG ! call near ptr print ! pop bx ! pop ax ! ! endif ! endm ------------------------------------------------------------ *** sendrec.asm Sat Aug 1 13:36:00 1987 --- ../../dos/lib/sendrec.asm Sat Aug 1 13:30:04 1987 *************** *** 3,9 INCLUDE ..\lib\prologue.h ! PUBLIC send, receive, send_rec, sendrec ; The following definitions are from ../h/com.h --- 3,9 ----- INCLUDE ..\lib\prologue.h ! PUBLIC _send, _receive, _send_rec, _sendrec ; The following definitions are from ../h/com.h *************** *** 8,17 ; The following definitions are from ../h/com.h ! _SEND = 1 ! _RECEIVE= 2 ! _BOTH = 3 ! _SYSVEC = 32 @CODE SEGMENT --- 8,17 ----- ; The following definitions are from ../h/com.h ! SEND = 1 ! RECEIVE= 2 ! BOTH = 3 ! SYSVEC = 32 _TEXT SEGMENT *************** *** 14,21 _SYSVEC = 32 ! @CODE SEGMENT ! ASSUME CS:@CODE,DS:DGROUP ;======================================================================== ; send and receive --- 14,21 ----- SYSVEC = 32 ! _TEXT SEGMENT ! ASSUME CS:_TEXT,DS:DGROUP ;======================================================================== ; send and receive *************** *** 22,28 ;======================================================================== ; send(), receive(), send_rec() all save bp, but destroy ax, bx, and cx. ! send: mov cx,_SEND ; send(dest, ptr) jmp L0 receive: --- 22,28 ----- ;======================================================================== ; send(), receive(), send_rec() all save bp, but destroy ax, bx, and cx. ! _send: mov cx,SEND ; send(dest, ptr) jmp L0 _receive: *************** *** 25,32 send: mov cx,_SEND ; send(dest, ptr) jmp L0 ! receive: ! mov cx,_RECEIVE ; receive(src, ptr) jmp L0 sendrec: --- 25,32 ----- _send: mov cx,SEND ; send(dest, ptr) jmp L0 ! _receive: ! mov cx,RECEIVE ; receive(src, ptr) jmp L0 _sendrec: *************** *** 29,37 mov cx,_RECEIVE ; receive(src, ptr) jmp L0 ! sendrec: ! send_rec: ! mov cx,_BOTH ; send_rec(srcdest, ptr) jmp L0 L0: push bp ; save bp --- 29,37 ----- mov cx,RECEIVE ; receive(src, ptr) jmp L0 ! _sendrec: ! _send_rec: ! mov cx,BOTH ; send_rec(srcdest, ptr) jmp L0 L0: push bp ; save bp *************** *** 38,44 mov bp,sp ; can't index off sp mov ax,4[bp] ; ax = dest-src mov bx,6[bp] ; bx = message pointer ! int _SYSVEC ; trap to the kernel pop bp ; restore bp ret ; return --- 38,44 ----- mov bp,sp ; can't index off sp mov ax,4[bp] ; ax = dest-src mov bx,6[bp] ; bx = message pointer ! int SYSVEC ; trap to the kernel pop bp ; restore bp ret ; return *************** *** 42,47 pop bp ; restore bp ret ; return ! @CODE ENDS END ; end of assembly-file --- 42,47 ----- pop bp ; restore bp ret ; return ! _TEXT ENDS END ; end of assembly-file