|
|
1.1 ! root 1: /* netboot ! 2: * ! 3: * asm.h,v ! 4: * Revision 1.1 1993/07/08 16:03:49 brezak ! 5: * Diskless boot prom code from Jim McKim ([email protected]) ! 6: * ! 7: * Revision 1.1.1.1 1993/05/28 11:41:07 mckim ! 8: * Initial version. ! 9: * ! 10: * ! 11: * source in this file came from ! 12: * the 386BSD boot blocks written by Julian Elsicher. ! 13: * ! 14: * Ported to Boot 386BSD by Julian Elsicher ([email protected]) Sept. 1992 ! 15: * ! 16: * Mach Operating System ! 17: * Copyright (c) 1991,1990,1989 Carnegie Mellon University ! 18: * All Rights Reserved. ! 19: * ! 20: * Permission to use, copy, modify and distribute this software and its ! 21: * documentation is hereby granted, provided that both the copyright ! 22: * notice and this permission notice appear in all copies of the ! 23: * software, derivative works or modified versions, and any portions ! 24: * thereof, and that both notices appear in supporting documentation. ! 25: * ! 26: * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" ! 27: * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR ! 28: * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. ! 29: * ! 30: * Carnegie Mellon requests users of this software to return to ! 31: * ! 32: * Software Distribution Coordinator or [email protected] ! 33: * School of Computer Science ! 34: * Carnegie Mellon University ! 35: * Pittsburgh PA 15213-3890 ! 36: * ! 37: * any improvements or extensions that they make and grant Carnegie Mellon ! 38: * the rights to redistribute these changes. ! 39: */ ! 40: ! 41: #define S_ARG0 4(%esp) ! 42: #define S_ARG1 8(%esp) ! 43: #define S_ARG2 12(%esp) ! 44: #define S_ARG3 16(%esp) ! 45: ! 46: #define FRAME pushl %ebp; movl %esp, %ebp ! 47: #define EMARF leave ! 48: ! 49: #define B_ARG0 8(%ebp) ! 50: #define B_ARG1 12(%ebp) ! 51: #define B_ARG2 16(%ebp) ! 52: #define B_ARG3 20(%ebp) ! 53: ! 54: #ifdef wheeze ! 55: ! 56: #define ALIGN 4 ! 57: #define EXT(x) x ! 58: #define LEXT(x) x: ! 59: #define LCL(x) ./**/x ! 60: ! 61: #define LB(x,n) ./**/x ! 62: #define LBb(x,n) ./**/x ! 63: #define LBf(x,n) ./**/x ! 64: ! 65: #define SVC lcall $7,$0 ! 66: ! 67: #define String .string ! 68: #define Value .value ! 69: #define Times(a,b) [a\*b] ! 70: #define Divide(a,b) [a\\b] ! 71: ! 72: #define INB inb (%dx) ! 73: #define OUTB outb (%dx) ! 74: #define INL inl (%dx) ! 75: #define OUTL outl (%dx) ! 76: ! 77: #else wheeze ! 78: /* #define ALIGN */ ! 79: #define ALIGN 4 ! 80: #define LCL(x) x ! 81: ! 82: #define LB(x,n) n ! 83: #ifdef __STDC__ ! 84: #define EXT(x) _ ## x ! 85: #define LEXT(x) _ ## x ## : ! 86: ! 87: #define LBb(x,n) n ## b ! 88: #define LBf(x,n) n ## f ! 89: #else __STDC__ ! 90: #define EXT(x) _/**/x ! 91: #define LEXT(x) _/**/x/**/: ! 92: #define LBb(x,n) n/**/b ! 93: #define LBf(x,n) n/**/f ! 94: #endif __STDC__ ! 95: #define SVC .byte 0x9a; .long 0; .word 0x7 ! 96: ! 97: #define String .ascii ! 98: #define Value .word ! 99: #define Times(a,b) (a*b) ! 100: #define Divide(a,b) (a/b) ! 101: ! 102: #define INB inb %dx, %al ! 103: #define OUTB outb %al, %dx ! 104: #define INL inl %dx, %eax ! 105: #define OUTL outl %eax, %dx ! 106: ! 107: #endif wheeze ! 108: ! 109: #define data32 .byte 0x66 ! 110: #define data16 .byte 0x66 ! 111: #define addr16 .byte 0x67 ! 112: ! 113: ! 114: ! 115: #ifdef GPROF ! 116: #ifdef __STDC__ ! 117: ! 118: #define MCOUNT .data; LB(x, 9); .long 0; .text; lea LBb(x, 9),%edx; call mcount ! 119: #define ENTRY(x) .globl EXT(x); .align ALIGN; LEXT(x) ; \ ! 120: pushl %ebp; movl %esp, %ebp; MCOUNT; popl %ebp; ! 121: #define ENTRY2(x,y) .globl EXT(x); .globl EXT(y); \ ! 122: .align ALIGN; LEXT(x) LEXT(y) ; \ ! 123: pushl %ebp; movl %esp, %ebp; MCOUNT; popl %ebp; ! 124: #define ASENTRY(x) .globl x; .align ALIGN; x ## : ; \ ! 125: pushl %ebp; movl %esp, %ebp; MCOUNT; popl %ebp; ! 126: ! 127: #else __STDC__ ! 128: ! 129: #define MCOUNT .data; LB(x, 9): .long 0; .text; lea LBb(x, 9),%edx; call mcount ! 130: #define ENTRY(x) .globl EXT(x); .align ALIGN; LEXT(x) ; \ ! 131: pushl %ebp; movl %esp, %ebp; MCOUNT; popl %ebp; ! 132: #define ENTRY2(x,y) .globl EXT(x); .globl EXT(y); \ ! 133: .align ALIGN; LEXT(x) LEXT(y) ! 134: #define ASENTRY(x) .globl x; .align ALIGN; x: ; \ ! 135: pushl %ebp; movl %esp, %ebp; MCOUNT; popl %ebp; ! 136: ! 137: #endif __STDC__ ! 138: #else GPROF ! 139: #ifdef __STDC__ ! 140: ! 141: #define MCOUNT ! 142: #define ENTRY(x) .globl EXT(x); .align ALIGN; LEXT(x) ! 143: #define ENTRY2(x,y) .globl EXT(x); .globl EXT(y); \ ! 144: .align ALIGN; LEXT(x) LEXT(y) ! 145: #define ASENTRY(x) .globl x; .align ALIGN; x ## : ! 146: ! 147: #else __STDC__ ! 148: ! 149: #define MCOUNT ! 150: #define ENTRY(x) .globl EXT(x); .align ALIGN; LEXT(x) ! 151: #define ENTRY2(x,y) .globl EXT(x); .globl EXT(y); \ ! 152: .align ALIGN; LEXT(x) LEXT(y) ! 153: #define ASENTRY(x) .globl x; .align ALIGN; x: ! 154: ! 155: #endif __STDC__ ! 156: #endif GPROF ! 157: ! 158: #define Entry(x) .globl EXT(x); .align ALIGN; LEXT(x) ! 159: #define DATA(x) .globl EXT(x); .align ALIGN; LEXT(x) ! 160: ! 161: CR0_PE = 0x00000001 ! 162: ! 163: KERN_CODE_SEG = 0x08 ! 164: KERN_DATA_SEG = 0x10 ! 165: BOOT_16_SEG = 0x18 ! 166: ! 167: #define opsize .byte 0x66 ! 168: #define addrsize .byte 0x67
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.