diff --git a/Dump/Ubix-CLOUDNINE.flp b/Dump/Ubix-CLOUDNINE.flp new file mode 100644 index 0000000..d18d75f --- /dev/null +++ b/Dump/Ubix-CLOUDNINE.flp Binary files differ diff --git a/Dump/UbixOS-080504.flp b/Dump/UbixOS-080504.flp new file mode 100644 index 0000000..2462273 --- /dev/null +++ b/Dump/UbixOS-080504.flp Binary files differ diff --git a/Dump/hybos/Makefile b/Dump/hybos/Makefile new file mode 100644 index 0000000..d90ac30 --- /dev/null +++ b/Dump/hybos/Makefile @@ -0,0 +1,11 @@ +MAKEFILE=Makefile + +all: + make -f $(MAKEFILE) -C src + +install: + make -f $(MAKEFILE) -C src install + +clean: + make -f $(MAKEFILE) -C lib clean + make -f $(MAKEFILE) -C src clean diff --git a/Dump/hybos/README.txt b/Dump/hybos/README.txt new file mode 100644 index 0000000..6f0e2f2 --- /dev/null +++ b/Dump/hybos/README.txt @@ -0,0 +1,210 @@ +OSD demo code - Interim release (January, 2003) + +I am working a new set of kernels, but it's slow going, so here +are the old kernels with some bug fixes and improvements. + +Location of these files: http://www.execpc.com/~geezer/osd/code + +The GRUB bootloader is GPL, all other files are PUBLIC DOMAIN +(no copyright). You may do whatever you want with them. + +================================================================ +QUICK START +================================================================ +1. Make sure you have all the software tools you need. You need NASM: + http://nasm.sourceforge.net + + You need the GNU C compiler (GCC), including binutils, GNU Make, + and sed. Users of DOS and Win9x should get GCC for DOS (DJGPP): + http://www.delorie.com/djgpp + + Find a mirror site near you and download the following + packages (NNN is version number): + compiler v2gnu/gccNNNNb.zip + binutils v2gnu/bnuNNNNb.zip + libraries v2/djdevNNN.zip + Make v2gnu/makNNNNb.zip + sed v2gnu/sedNNb.zip + CWSDPMI v2misc/csdpmiN.zip + + Users of WinNT/Win2000/WinXP should get GCC for Win32 (MinGW): + http://mingw.sourceforge.net + + Users of Linux can use the GNU tools that come with Linux. If + they're not already installed, check the CD-ROMs or FTP site + from where you got Linux. + + DOS and Windows users also need John Fine's Partial Copy (PARTCOPY): + http://www.execpc.com/~geezer/johnfine/#zero + +2. Create a formatted floppy disk with the GRUB bootloader + installed on it. The procedure to do this is described below. + +3. Got your tools? Got your GRUB floppy? Then you're ready to + build and install the demo kernels. + + If you're using DJGPP, type make -f dj.mak install + + If you're using MinGW, type make -f ming.mak install + + If you're using Linux, type make -f linux.mak install + +Hopefully, everything will work properly. If it does, you'll be +left with a bootable GRUB floppy with 7 demo kernels on it +(OSD 3 - OSD 9). + +================================================================ +MAKING A BOOTABLE FLOPPY DISK WITH THE GRUB BOOTLOADER ON IT +================================================================ +GRUB is a GPLed bootloader. + +Home page: http://www.gnu.org/software/grub +Binaries: ftp://alpha.gnu.org/gnu/grub/grub-0.90-i386-pc.tar.gz +Source code: ftp://alpha.gnu.org/gnu/grub/grub-0.90.tar.gz +HOW-TOs: http://www.washingdishes.freeuk.com/grubtut.html + http://www.execpc.com/~geezer/osd/boot/grub-how.txt + +1. You will need + - Two 1.44 meg floppy disks, one of them formatted with a + filesystem that GRUB recognizes (e.g. FAT12 or ext2). + The other floppy (the "unformatted" floppy) may contain + a filesystem, but it will be destroyed. + - The GRUB binaries: files "stage1" and "stage2". These are + in the OSD distribution, in the directory "boot/grub". + - A "menu.lst" configuration file for GRUB. Again, this + is provided with OSD in the "boot/grub" directory. + +2. On the formatted floppy disk, create the subdirectory + "/boot/grub/", and copy the files "stage1", "stage2", and + "menu.lst" into this subdirectory. + +3. Concatenate the binary files "stage1" and "stage2" into a + single binary file named "boot": + (DOS/Windows): copy /b stage1 + stage2 boot + (Linux): cat stage1 stage2 >boot + +4. Write the file "boot" directly to the unformatted floppy. + This is a sector-level write that does not use (and will + destroy) any filesystem present on the disk: + (DOS/Windows): partcopy boot 0 168000 -f0 + (Linux): cat boot >/dev/fd0 + + PARTCOPY will display an error message because "boot" is + much shorter than 0x168000 bytes, but this is OK. + +5. Boot your PC from the unformatted floppy disk. + +6. After GRUB has started, eject the unformatted floppy and + insert the formatted floppy, containing the "stage1", + "stage2", and "menu.lst" files, all in the "/boot/grub/" + subdirectory. Type: + setup (fd0) + +7. The formatted floppy is now bootable. Do not move, modify, + or delete the file "/boot/grub/stage2" on this floppy. + +================================================================ +BUGS/GOTCHAS/"IT DOESN'T WORK!" +================================================================ +- DJGPP crashes under Windows XP + The DJGPP team is working on a way to fix this. If you have + any flavor of WindowsNT (including WindowsXP) use MinGW + instead of DJGPP. + +- Will CygWin work instead of MinGW? + Probably, but I haven't tested it. + +- 'make -f ming.mak clean' doesn't delete .o files in /lib/ + I know, but I can't figure out how to fix it. Make sure + these files get deleted if you switch between MinGW and + DJGPP. The linkers can't distinguish between DJGPP COFF + .o files and Win32 PE COFF .o files, but they ARE different, + and your kernels will crash if you mix the two COFF types. + +- BFD: Dwarf Error: Abbrev offset (1075154) greater than or + equal to .debug_abbrev size (3198). + This is a bug in new versions of DJGPP. It's ugly, but you + can ignore it. + +- Do not use MinGW GCC 2.x with NASM + MinGW based on GCC 2.95.2 stores the BSS size in the wrong + field of the section header. Because of this bug, this + version of MinGW will not interoperate with other toolchains, + including NASM, Microsoft compilers, and Borland compilers. + +- Screen fills with errors when compiling under Linux + There are two possible causes for this: + 1. Linux GCC chokes on DOS-style newlines in the source code. + Run all source code files and makefiles through 'fromdos' + to convert the DOS newlines (CR-LF) to UNIX newlines (LF). + 2. There is no newline at the very end of the file. + +- ld: krnl.x: Not enough room for program headers, try linking with -N + This error occurs if you do not use AT() in the linker script + when making an ELF kernel. + +- Exception 10 (bad TSS) + If the NT bit in the EFLAGS register is set, IRET will attempt + a TSS-based task-switch, instead of a normal IRET. Code was + added to osd9/kstart.asm to prevent this. (GRUB 0.90 leaves + the NT bit set when it jumps to the kernel.) + +- Errors from GRUB: + 'Error: Loading below 1M not supported' + 'Error 28: Selected item won't fit into memory' + These errors are usually caused by improperly-linked ELF + kernels. If your kernel is ELF, try this: + objdump --private-headers -h krnl.x + The vaddr and paddr fields for each program header (segment) + must be at or above 1 meg (00100000h) but smaller than your + RAM size. If you have readelf, you can also do this: + readelf --segments krnl.x + If you find a segment with bad values of VirtAddr or + PhysAddr, look at the section-to-segment mapping to see + which section is causing the problem. + +================================================================ +DEMO CODE OVERVIEW +================================================================ +osd3 mixing C and asm, C calling convention, underscores + (xxx - current code does not demonstrate these very well) + +osd4 putch() and kprintf() + +osd5 C library code moved to separate directory + +osd6 software interrupts, exception handlers in asm and C + +osd7 hardware interrupts, reprogramming the 8259 interrupt + controller chips, simple keyboard driver + +osd8 multitasking preliminaries: multiple (virtual) consoles + backed with video memory, ANSI/VT escapes for moving + the cursor and changing text color. Improved keyboard + driver; can press Ctrl+Alt+Del to reboot. + +osd9 cooperative multitasking with setjmp() and longjump() + (static tasks; linked into the kernel at compile-time) + +================================================================ +WHAT CHANGED? +================================================================ +- Updated GRUB to version 0.90 +- Wrote MinGW makefiles, and fixed code to work with MinGW + based on GCC 3.x (and generate error message for GCC 2.x) +- Fixed definition of MAKEFILE in lib/linux.mak +- BIG changes to linker script + - Unified ELF/DJGPP COFF/Win32 PE COFF linker scripts into one + - Added AT() statements so ELF kernels link properly, and + work properly + - Now handling .rodata section properly, so ELF kernels work + properly (including multiple .rodata sections with GCC 3.x) +- Rewrote setjmp() and longjmp() because they were buggy (though, + strangely enough, the bug did not manifest itself) +- Added code to osd9/kstart.asm to zero NT bit in EFLAGS, + preventing exception 10 +- Now enabling interrupts for each task in function init_tasks() + of osd9/sched.c. In previous code, interrupts were disabled + for all tasks except the idle task, making the blinking + character in the upper left corner of the screen appear to + blink much more slowly than 18 Hz. diff --git a/Dump/hybos/__experimental/README.txt b/Dump/hybos/__experimental/README.txt new file mode 100644 index 0000000..fba9e05 --- /dev/null +++ b/Dump/hybos/__experimental/README.txt @@ -0,0 +1,87 @@ +Sector-level disk I/O code for various OSes + +This code is public domain (no copyright). +You can do whatever you want with it. + +Chris Giese http://www.execpc.com/~geezer + +================================================================ +BUILD +================================================================ +After a successful build, the executable is named 'diskio.exe' + +DOS - Turbo C++ 1.0 or Turbo C++ 3.0: + make + +DOS - Watcom C: + wmake /f watcom16.mak + +32-bit DOS - DJGPP: + make -f djgpp.mak + +32-bit DOS - Watcom C with CauseWay DOS extender: + wmake /f watcom32.mak + +NOTE: 32-bit code built with Watcom C does not yet work. + +Windows NT - MinGW or CygWin: + make -f win-nt.mak + +NOTE: Windows NT version is not tested. + +Linux - GCC: + xxx - to do + +If you have Windows9x, build and run this code as a DOS program, +not a Win32 program. + +================================================================ +API +================================================================ +/* disk_t, open_disk(), read_sector(), write_sector() */ +#include "diskio.h" + +int main(void) { + unsigned long lba_sector_num; + unsigned char buf[512]; + unsigned drive; + disk_t disk; + +/* drive values for floppies: + 0 for A:, 1 for B:, etc. +drive values for hard drives: + 0x80 for first hard drive, 0x81 for second hard drive, etc. */ + drive = 0; +/* read hard drive partition table or floppy boot sector */ + lba_sector_num = 0; + if(open_disk(&disk, drive) == 0) + if(read_sector(&disk, lba_sector_num, buf) == 0) + /* success */; + return 0; } + +================================================================ +TO DO +================================================================ +Test if code writes to disk properly + +Test Windows NT version +- See if the following work with Windows NT: + - 1.44 meg FAT12 floppy (my guess: YES) + - 1.68 meg FAT12 floppy (my guess: YES) + - 1.44 meg non-FAT (e.g. ext2) floppy (my guess: YES) + - 1.68 meg non-FAT floppy (my guess: NO) +- Is there a Windows NT ioctl() to get floppy disk geometry? + Does it work for non-FAT floppy disks? (How do I make NT read + a 1.68 meg non-FAT floppy?) + +Make it work with Linux + +Make it work with 32-bit Watcom C + +Maybe add a disk cache + +Maybe support disks with sector size other than 512 bytes +(e.g. 2048-byte CD-ROM sectors)? + +Any way to access CD-ROM with INT 13h functions? +WITHOUT booting from the CD-ROM? diff --git a/Dump/hybos/__experimental/demo.c b/Dump/hybos/__experimental/demo.c new file mode 100644 index 0000000..4a20581 --- /dev/null +++ b/Dump/hybos/__experimental/demo.c @@ -0,0 +1,94 @@ +/***************************************************************************** +Sector-level disk I/O code for various OSes +This code is public domain (no copyright). +You can do whatever you want with it. +*****************************************************************************/ +#include /* printf(), putchar() */ +#include "diskio.h" +/***************************************************************************** +*****************************************************************************/ +#define BPERL 16 /* byte/line for dump */ + +static void dump(unsigned char *data, unsigned count) +{ + unsigned char byte1, byte2; + + while(count != 0) + { + for(byte1 = 0; byte1 < BPERL; byte1++) + { + if(count == 0) + break; + printf("%02X ", data[byte1]); + count--; + } + printf("\t"); + for(byte2 = 0; byte2 < byte1; byte2++) + { + if(data[byte2] < ' ') + putchar('.'); + else + putchar(data[byte2]); + } + printf("\n"); + data += BPERL; + } +} +/***************************************************************************** +*****************************************************************************/ +int main(void) +{ + unsigned char buf[512], *ptab_rec; + unsigned i = 0; + disk_t disk; + + printf("Looking for FAT (DOS) disk or partition...\n"); +/* check if floppy in A: drive */ + if(open_disk(&disk, 0) == 0) + { +/* read bootsector, check if FAT */ + if(read_sector(&disk, 0, buf) == 0) + { + if(is_fat_bootsector(buf)) + goto OK; + } + } +/* scan hard drives for FAT partition */ + for(i = 0x80; i < 0x82; i++) + { + if(open_disk(&disk, i) != 0) + continue; +/* read MBR */ + if(read_sector(&disk, 0, buf) != 0) + continue; +/* find FAT partition */ + for(i = 0; i < 4; i++) + { + ptab_rec = buf + 446 + 16 * i; +/* make sure it's FAT */ + if(ptab_rec[4] == 0x01 || /* FAT 12 */ + ptab_rec[4] == 0x04 || /* FAT 16 <32meg */ + ptab_rec[4] == 0x06 || /* FAT 16 >=32meg */ + ptab_rec[4] == 0x0E) /* LBA type 0x06 */ + { +/* xxx - note if FAT16 or FAT12 */ + disk.partition_start = LE32(ptab_rec + 8); + goto OK; + } + } + } + printf("No FAT partitions found on any disk\n"); + return 1; +OK: + if(disk.drive_num >= 0x80) + printf("Partition #%u on ", i); + printf("INT 13h disk number 0x%02X:\n", disk.drive_num); + if(read_sector(&disk, 0, buf) != 0) + printf("Error reading bootsector\n"); + else + { + printf("Hex dump of bootsector:\n"); + dump(buf, 64); + } + return 0; +} diff --git a/Dump/hybos/__experimental/diskio.h b/Dump/hybos/__experimental/diskio.h new file mode 100644 index 0000000..71ff36c --- /dev/null +++ b/Dump/hybos/__experimental/diskio.h @@ -0,0 +1,59 @@ +/***************************************************************************** +Sector-level disk I/O code for various OSes +This code is public domain (no copyright). +You can do whatever you want with it. + +EXPORTS (API): +DEBUG(), BPS, LE16(), LE32(), disk_t, +int read_sector(disk_t *disk, unsigned long lba, unsigned char *buf); +int write_sector(disk_t *disk, unsigned long lba, unsigned char *buf); +int is_fat_bootsector(unsigned char *buf); +int open_disk(disk_t *disk, unsigned drive_num); +*****************************************************************************/ +#ifndef __DISKIO_H +#define __DISKIO_H + +#ifdef __cplusplus +extern "C" +{ +#endif + +#if 0 +#define DEBUG(X) X +#else +#define DEBUG(X) /* nothing */ +#endif + +#define BPS 512 /* bytes/sector */ + +/* these assume little endian CPU like x86 */ +#define LE16(X) *(uint16_t *)(X) +#define LE32(X) *(uint32_t *)(X) + +/* STDINT.H +these assume sizeof(short)==2 and sizeof(long)==4 */ +typedef unsigned short uint16_t; +typedef unsigned long uint32_t; + +typedef struct +{ + unsigned char drive_num; +/* CHS disk geometry (heads and sectors are used only if use_lba==0) */ + unsigned use_lba : 1; + unsigned char heads; + unsigned char sectors; +/* LBA sector address of partition start (hard disk only) */ + unsigned long partition_start; +} disk_t; + +/* these are in DISKIO.C */ +int read_sector(disk_t *disk, unsigned long lba, unsigned char *buf); +int write_sector(disk_t *disk, unsigned long lba, unsigned char *buf); +int is_fat_bootsector(unsigned char *buf); +int open_disk(disk_t *disk, unsigned drive_num); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/Dump/hybos/__experimental/djgpp.c b/Dump/hybos/__experimental/djgpp.c new file mode 100644 index 0000000..ee35e57 --- /dev/null +++ b/Dump/hybos/__experimental/djgpp.c @@ -0,0 +1,131 @@ +/***************************************************************************** +Sector-level disk I/O code for DOS, using DJGPP. +This code is public domain (no copyright). +You can do whatever you want with it. + +EXPORTS: +int lba_biosdisk(int cmd, int drive, unsigned long lba, + int nsects, void *buf); +int get_hd_geometry(disk_t *disk); +*****************************************************************************/ +#include /* dosmemget(), dosmemput() */ +#include /* memset() */ +#include /* printf() */ +#include /* _DISK_... */ +#include /* __dpmi_regs, __dpmi_int() */ +#include /* _go32_info_block, __tb */ +#include "diskio.h" +#include "dos.h" /* peekb() */ +/***************************************************************************** +*****************************************************************************/ +int lba_biosdisk(int cmd, int drive, unsigned long lba, int nsects, void *buf) +{ + struct + { + unsigned char pkt_len __attribute__((packed)); + unsigned char res0 __attribute__((packed)); + unsigned char nsects __attribute__((packed)); + unsigned char res1 __attribute__((packed)); + unsigned short buf_off __attribute__((packed)); + unsigned short buf_seg __attribute__((packed)); + unsigned long lba31_0 __attribute__((packed)); + unsigned long lba63_32 __attribute__((packed)); + } lba_cmd_pkt; + unsigned tries, err = 0; + __dpmi_regs regs; + + if(cmd != _DISK_READ && cmd != _DISK_WRITE) + return 0x100; +/* make sure the DJGPP transfer buffer (in conventional memory) +is big enough */ + if(BPS * nsects + sizeof(lba_cmd_pkt) > + _go32_info_block.size_of_transfer_buffer) + return 0x100; +/* make sure drive and BIOS support LBA */ + regs.x.bx = 0x55AA; + regs.h.dl = drive; + regs.h.ah = 0x41; + __dpmi_int(0x13, ®s); + if(regs.x.flags & 0x0001) /* carry bit (CY) is set */ + return 0x100; +/* fill out the INT 13h AH=4xh command packet */ + memset(&lba_cmd_pkt, 0, sizeof(lba_cmd_pkt)); + lba_cmd_pkt.pkt_len = sizeof(lba_cmd_pkt); + lba_cmd_pkt.nsects = nsects; +/* use start of transfer buffer for data transferred by BIOS disk I/O... */ + lba_cmd_pkt.buf_off = 0; + lba_cmd_pkt.buf_seg = __tb >> 4; + lba_cmd_pkt.lba31_0 = lba; +/* ...use end of transfer buffer for the command packet itself */ + dosmemput(&lba_cmd_pkt, sizeof(lba_cmd_pkt), + __tb + BPS * nsects); +/* fill out registers for INT 13h AH=4xh */ + regs.x.ds = (__tb + BPS * nsects) >> 4; + regs.x.si = (__tb + BPS * nsects) & 0x0F; + regs.h.dl = drive; +/* if writing, store the data */ + if(cmd == _DISK_WRITE) + dosmemput(buf, BPS * nsects, __tb); +/* make 3 attempts */ + for(tries = 3; tries != 0; tries--) + { + regs.h.ah = (cmd == _DISK_READ) ? 0x42 : 0x43; + __dpmi_int(0x13, ®s); + err = regs.h.ah; + if((regs.x.flags & 0x0001) == 0) + { +/* if reading, load the data */ + if(cmd == _DISK_READ) + dosmemget(__tb, BPS * nsects, buf); + return 0; + } +/* reset disk */ + regs.h.ah = _DISK_RESET; + __dpmi_int(0x13, ®s); + } + DEBUG(printf("lba_biosdisk(): error 0x%02X\n", err);) + return err; +} +/***************************************************************************** +*****************************************************************************/ +int get_hd_geometry(disk_t *disk) +{ + __dpmi_regs regs; + +/* make sure hard drive exists */ + if(disk->drive_num - 0x80 >= peekb(0x40, 0x75)) + { + printf("get_hd_geometry(): hd 0x%02X does not exist\n", + disk->drive_num); + return -1; + } +/* use LBA if drive and BIOS support it */ + regs.h.ah = 0x41; + regs.x.bx = 0x55AA; + regs.h.dl = disk->drive_num; + __dpmi_int(0x13, ®s); + if((regs.x.flags & 0x0001) == 0 && regs.x.bx == 0xAA55) + { + disk->use_lba = 1; + DEBUG(printf("get_hd_geometry(): using LBA for hd 0x%02X\n", + disk->drive_num);) + return 0; + } +/* get geometry from BIOS */ + regs.h.ah = 0x08; + regs.h.dl = disk->drive_num; + __dpmi_int(0x13, ®s); + if(regs.x.flags & 0x0001) + { + printf("get_hd_geometry(): error getting geometry " + "for hard drive 0x%02X\n", disk->drive_num); + return -1; + } + disk->heads = regs.h.dh + 1; + disk->sectors = regs.h.cl & 0x3F; + DEBUG(printf("get_hd_geometry() for hd 0x%02X: " + "CHS=?:%u:%u (from INT 13h AH=08h)\n", + disk->drive_num, + disk->heads, disk->sectors);) + return 0; +} diff --git a/Dump/hybos/__experimental/djgpp.mak b/Dump/hybos/__experimental/djgpp.mak new file mode 100644 index 0000000..a8e153f --- /dev/null +++ b/Dump/hybos/__experimental/djgpp.mak @@ -0,0 +1,28 @@ +# Makefile for 32-bit DOS - DJGPP + +# defines +# MAKEDEP =makefile +CC =gcc -g -O2 -Wall -W +LD =gcc -g +OBJS =demo.o dos.o djgpp.o + +# targets +all: diskio.exe + +clean: + deltree /y *.exe *.obj *.o *.err + +# implicit rules +.c.o: + $(CC) -c -o$@ $< + +# dependencies +demo.o: demo.c $(MAKEDEP) diskio.h + +dos.o: dos.c $(MAKEDEP) diskio.h dos.h + +djgpp.o: djgpp.c $(MAKEDEP) diskio.h dos.h + +# explicit rules +diskio.exe: $(OBJS) $(MAKEDEP) + $(LD) -o$@ $(OBJS) diff --git a/Dump/hybos/__experimental/dos.c b/Dump/hybos/__experimental/dos.c new file mode 100644 index 0000000..71f1446 --- /dev/null +++ b/Dump/hybos/__experimental/dos.c @@ -0,0 +1,256 @@ +/***************************************************************************** +Sector-level disk I/O code for DOS. +This code is public domain (no copyright). +You can do whatever you want with it. + +EXPORTS: +int read_sector(disk_t *disk, unsigned long lba, unsigned char *buf); +int write_sector(disk_t *disk, unsigned long lba, unsigned char *buf); +int is_fat_bootsector(unsigned char *buf); +int open_disk(disk_t *disk, unsigned drive_num); +*****************************************************************************/ +#include /* printf() */ +/*#include */ /* _DISK_..., diskinfo_t, _bios_disk() */ +#include "diskio.h" +#include "dos.h" /* peekw() */ + +/* IMPORTS +from _16BIT.C, DJGPP, or ??? */ +int lba_biosdisk(int cmd, int drive, unsigned long lba, int nsects, void *buf); +int get_hd_geometry(disk_t *disk); + +/* xxx - I'm not sure of the Turbo C version where these were +introduced. They are present in Turbo C++ 3.0 (__TURBOC__ == 0x401) +but not in Turbo C++ 1.0 (__TURBOC__ == 0x296) */ +#if defined(__TURBOC__) +#if __TURBOC__<0x300 + +struct diskinfo_t +{ + unsigned drive, head, track, sector, nsectors; + void far *buffer; +}; + +unsigned _bios_disk(unsigned cmd, struct diskinfo_t *info) +{ + struct SREGS sregs; + union REGS regs; + +/* biosdisk() returns the 8-bit error code left in register AH by +the call to INT 13h. It does NOT return a combined, 16-bit error +code + number of sectors transferred, as described in the online help. + + return biosdisk(cmd, info->drive, info->head, info->track, + info->sector, info->nsectors, info->buffer); +*/ + regs.h.ah = cmd; + regs.h.al = info->nsectors; + regs.x.bx = FP_OFF(info->buffer); + regs.h.ch = info->track; + regs.h.cl = (info->track / 256) * 64 + (info->sector & 0x3F); + regs.h.dh = info->head; + regs.h.dl = info->drive; + sregs.es = FP_SEG(info->buffer); + int86x(0x13, ®s, ®s, &sregs); + return regs.x.ax; +} +#endif +#endif +/***************************************************************************** +*****************************************************************************/ +int read_sector(disk_t *disk, unsigned long lba, unsigned char *buf) +{ + struct diskinfo_t cmd; + unsigned tries, err; + + lba += disk->partition_start; + cmd.drive = disk->drive_num; +/* use LBA if available */ + if(disk->use_lba) + { + return lba_biosdisk(_DISK_READ, + disk->drive_num, lba, 1, buf); + } +/* use CHS _bios_disk() */ + cmd.sector = (unsigned)(lba % disk->sectors + 1); + cmd.head = (unsigned)((lba / disk->sectors) % disk->heads); + cmd.track = (unsigned)((lba / disk->sectors) / disk->heads); + cmd.nsectors = 1; + cmd.buffer = buf; +/* make 3 attempts */ + for(tries = 3; tries != 0; tries--) + { + err = _bios_disk(_DISK_READ, &cmd); + err >>= 8; +/* 0x11=="CRC/ECC corrected data error" */ + if(err == 0 || err == 0x11) + return 0; +/* reset disk */ + _bios_disk(_DISK_RESET, &cmd); + } + DEBUG(printf("read_sector(): error 0x%02X\n", err);) + return err; +} +/***************************************************************************** +*****************************************************************************/ +int write_sector(disk_t *disk, unsigned long lba, unsigned char *buf) +{ + struct diskinfo_t cmd; + unsigned tries, err; + + lba += disk->partition_start; + cmd.drive = disk->drive_num; +/* use LBA if available */ + if(disk->use_lba) + { + return lba_biosdisk(_DISK_WRITE, + disk->drive_num, lba, 1, buf); + } +/* use CHS _bios_disk() */ + cmd.sector = (unsigned)(lba % disk->sectors + 1); + cmd.head = (unsigned)((lba / disk->sectors) % disk->heads); + cmd.track = (unsigned)((lba / disk->sectors) / disk->heads); + cmd.nsectors = 1; + cmd.buffer = buf; +/* make 3 attempts */ + for(tries = 3; tries != 0; tries--) + { + err = _bios_disk(_DISK_WRITE, &cmd); + err >>= 8; +/* 0x11=="CRC/ECC corrected data error" */ + if(err == 0 || err == 0x11) + return 0; +/* reset disk */ + _bios_disk(_DISK_RESET, &cmd); + } + DEBUG(printf("write_sector(): error 0x%02X\n", err);) + return err; +} +/***************************************************************************** +*****************************************************************************/ +int is_fat_bootsector(unsigned char *buf) +{ + int temp, ok = 1; + + DEBUG(printf("check_if_fat_bootsector:\n");) +/* must start with 16-bit JMP or 8-bit JMP plus NOP */ + if(buf[0] == 0xE9) + /* OK */; + else if(buf[0] == 0xEB && buf[2] == 0x90) + /* OK */; + else + { + DEBUG(printf("\tMissing JMP/NOP\n");) + ok = 0; + } + temp = buf[13]; + if(temp == 0 || ((temp - 1) & temp) != 0) + { + DEBUG(printf("\tSectors per cluster (%u) " + "is not a power of 2\n", temp);) + ok = 0; + } + temp = buf[16]; + temp = LE16(buf + 24); + if(temp == 0 || temp > 63) + { + DEBUG(printf("\tInvalid number of sectors (%u)\n", temp);) + ok = 0; + } + temp = LE16(buf + 26); + if(temp == 0 || temp > 255) + { + DEBUG(printf("\tInvalid number of heads (%u)\n", temp);) + ok = 0; + } + return ok; +} +/***************************************************************************** +*****************************************************************************/ +static void probe_floppy_geometry(disk_t *disk) +{ + unsigned sectors, heads; + unsigned char buf[BPS]; + +/* scan upwards for sector number where read fails */ + disk->sectors = 64 + 1; + for(sectors = 1; sectors <= 64; sectors++) + { + if(read_sector(disk, sectors - 1, buf) != 0) + break; + } + disk->sectors = sectors - 1; +#if 1 +disk->heads = 2; +#else +/* scan upwards for head number where read fails +xxx - this probing for number of heads doesn't work */ + disk->heads = 16 + 1; + for(heads = 1; heads < 16; heads++) + { + if(read_sector(disk, heads * disk->sectors, buf) != 0) + break; + } + disk->heads = heads; +#endif +/* reset drive by reading sector 0 */ + (void)read_sector(disk, 0, buf); + DEBUG(printf("probe_floppy_geometry() for fd 0x%02X: " + "CHS=?:%u:%u\n", disk->drive_num, + disk->heads, disk->sectors);) +} +/***************************************************************************** +*****************************************************************************/ +int open_disk(disk_t *disk, unsigned drive_num) +{ + unsigned char buf[BPS]; + unsigned num_fds; + int err; + + disk->drive_num = drive_num; + disk->partition_start = 0; /* assume floppy */ + disk->use_lba = 0; /* assume CHS */ +/* hard disk */ + if(disk->drive_num >= 0x80) + return get_hd_geometry(disk); +/* make sure floppy drive exists */ + num_fds = peekw(0x40, 0x10); + if(num_fds & 0x0001) + num_fds = ((num_fds / 64) & 3) + 1; + else + num_fds = 0; + if(disk->drive_num >= num_fds) + { + printf("open_disk(): fd 0x%02X does not exist\n", + disk->drive_num); + return -1; + } +/* temporary values to make read_sector(0) work */ + disk->heads = disk->sectors = 1; + err = read_sector(disk, 0, buf); + if(err != 0) + return err; +/* if it's a FAT (DOS) disk, we get can reliable geometry info +from the BIOS parameter block (BPB) in the bootsector */ + if(is_fat_bootsector(buf)) + { + disk->heads = LE16(buf + 26); + disk->sectors = LE16(buf + 24); + DEBUG(printf("open_disk() for fd 0x%02X: " + "CHS=?:%u:%u (from BPB)\n", + disk->drive_num, + disk->heads, disk->sectors);) + return 0; + } +#if 0 +/* ...otherwise, do slow probe */ + probe_floppy_geometry(disk); +#else +/* ...or just assume some values */ + disk->heads = 2; + disk->sectors = 18; + DEBUG(printf("open_disk() for fd 0x%02X: " + "assuming CHS=?:2:18\n", disk->drive_num);) +#endif + return 0; +} diff --git a/Dump/hybos/__experimental/dos.c~ b/Dump/hybos/__experimental/dos.c~ new file mode 100644 index 0000000..8b0703a --- /dev/null +++ b/Dump/hybos/__experimental/dos.c~ @@ -0,0 +1,256 @@ +/***************************************************************************** +Sector-level disk I/O code for DOS. +This code is public domain (no copyright). +You can do whatever you want with it. + +EXPORTS: +int read_sector(disk_t *disk, unsigned long lba, unsigned char *buf); +int write_sector(disk_t *disk, unsigned long lba, unsigned char *buf); +int is_fat_bootsector(unsigned char *buf); +int open_disk(disk_t *disk, unsigned drive_num); +*****************************************************************************/ +#include /* printf() */ +#include /* _DISK_..., diskinfo_t, _bios_disk() */ +#include "diskio.h" +#include "dos.h" /* peekw() */ + +/* IMPORTS +from _16BIT.C, DJGPP, or ??? */ +int lba_biosdisk(int cmd, int drive, unsigned long lba, int nsects, void *buf); +int get_hd_geometry(disk_t *disk); + +/* xxx - I'm not sure of the Turbo C version where these were +introduced. They are present in Turbo C++ 3.0 (__TURBOC__ == 0x401) +but not in Turbo C++ 1.0 (__TURBOC__ == 0x296) */ +#if defined(__TURBOC__) +#if __TURBOC__<0x300 + +struct diskinfo_t +{ + unsigned drive, head, track, sector, nsectors; + void far *buffer; +}; + +unsigned _bios_disk(unsigned cmd, struct diskinfo_t *info) +{ + struct SREGS sregs; + union REGS regs; + +/* biosdisk() returns the 8-bit error code left in register AH by +the call to INT 13h. It does NOT return a combined, 16-bit error +code + number of sectors transferred, as described in the online help. + + return biosdisk(cmd, info->drive, info->head, info->track, + info->sector, info->nsectors, info->buffer); +*/ + regs.h.ah = cmd; + regs.h.al = info->nsectors; + regs.x.bx = FP_OFF(info->buffer); + regs.h.ch = info->track; + regs.h.cl = (info->track / 256) * 64 + (info->sector & 0x3F); + regs.h.dh = info->head; + regs.h.dl = info->drive; + sregs.es = FP_SEG(info->buffer); + int86x(0x13, ®s, ®s, &sregs); + return regs.x.ax; +} +#endif +#endif +/***************************************************************************** +*****************************************************************************/ +int read_sector(disk_t *disk, unsigned long lba, unsigned char *buf) +{ + struct diskinfo_t cmd; + unsigned tries, err; + + lba += disk->partition_start; + cmd.drive = disk->drive_num; +/* use LBA if available */ + if(disk->use_lba) + { + return lba_biosdisk(_DISK_READ, + disk->drive_num, lba, 1, buf); + } +/* use CHS _bios_disk() */ + cmd.sector = (unsigned)(lba % disk->sectors + 1); + cmd.head = (unsigned)((lba / disk->sectors) % disk->heads); + cmd.track = (unsigned)((lba / disk->sectors) / disk->heads); + cmd.nsectors = 1; + cmd.buffer = buf; +/* make 3 attempts */ + for(tries = 3; tries != 0; tries--) + { + err = _bios_disk(_DISK_READ, &cmd); + err >>= 8; +/* 0x11=="CRC/ECC corrected data error" */ + if(err == 0 || err == 0x11) + return 0; +/* reset disk */ + _bios_disk(_DISK_RESET, &cmd); + } + DEBUG(printf("read_sector(): error 0x%02X\n", err);) + return err; +} +/***************************************************************************** +*****************************************************************************/ +int write_sector(disk_t *disk, unsigned long lba, unsigned char *buf) +{ + struct diskinfo_t cmd; + unsigned tries, err; + + lba += disk->partition_start; + cmd.drive = disk->drive_num; +/* use LBA if available */ + if(disk->use_lba) + { + return lba_biosdisk(_DISK_WRITE, + disk->drive_num, lba, 1, buf); + } +/* use CHS _bios_disk() */ + cmd.sector = (unsigned)(lba % disk->sectors + 1); + cmd.head = (unsigned)((lba / disk->sectors) % disk->heads); + cmd.track = (unsigned)((lba / disk->sectors) / disk->heads); + cmd.nsectors = 1; + cmd.buffer = buf; +/* make 3 attempts */ + for(tries = 3; tries != 0; tries--) + { + err = _bios_disk(_DISK_WRITE, &cmd); + err >>= 8; +/* 0x11=="CRC/ECC corrected data error" */ + if(err == 0 || err == 0x11) + return 0; +/* reset disk */ + _bios_disk(_DISK_RESET, &cmd); + } + DEBUG(printf("write_sector(): error 0x%02X\n", err);) + return err; +} +/***************************************************************************** +*****************************************************************************/ +int is_fat_bootsector(unsigned char *buf) +{ + int temp, ok = 1; + + DEBUG(printf("check_if_fat_bootsector:\n");) +/* must start with 16-bit JMP or 8-bit JMP plus NOP */ + if(buf[0] == 0xE9) + /* OK */; + else if(buf[0] == 0xEB && buf[2] == 0x90) + /* OK */; + else + { + DEBUG(printf("\tMissing JMP/NOP\n");) + ok = 0; + } + temp = buf[13]; + if(temp == 0 || ((temp - 1) & temp) != 0) + { + DEBUG(printf("\tSectors per cluster (%u) " + "is not a power of 2\n", temp);) + ok = 0; + } + temp = buf[16]; + temp = LE16(buf + 24); + if(temp == 0 || temp > 63) + { + DEBUG(printf("\tInvalid number of sectors (%u)\n", temp);) + ok = 0; + } + temp = LE16(buf + 26); + if(temp == 0 || temp > 255) + { + DEBUG(printf("\tInvalid number of heads (%u)\n", temp);) + ok = 0; + } + return ok; +} +/***************************************************************************** +*****************************************************************************/ +static void probe_floppy_geometry(disk_t *disk) +{ + unsigned sectors, heads; + unsigned char buf[BPS]; + +/* scan upwards for sector number where read fails */ + disk->sectors = 64 + 1; + for(sectors = 1; sectors <= 64; sectors++) + { + if(read_sector(disk, sectors - 1, buf) != 0) + break; + } + disk->sectors = sectors - 1; +#if 1 +disk->heads = 2; +#else +/* scan upwards for head number where read fails +xxx - this probing for number of heads doesn't work */ + disk->heads = 16 + 1; + for(heads = 1; heads < 16; heads++) + { + if(read_sector(disk, heads * disk->sectors, buf) != 0) + break; + } + disk->heads = heads; +#endif +/* reset drive by reading sector 0 */ + (void)read_sector(disk, 0, buf); + DEBUG(printf("probe_floppy_geometry() for fd 0x%02X: " + "CHS=?:%u:%u\n", disk->drive_num, + disk->heads, disk->sectors);) +} +/***************************************************************************** +*****************************************************************************/ +int open_disk(disk_t *disk, unsigned drive_num) +{ + unsigned char buf[BPS]; + unsigned num_fds; + int err; + + disk->drive_num = drive_num; + disk->partition_start = 0; /* assume floppy */ + disk->use_lba = 0; /* assume CHS */ +/* hard disk */ + if(disk->drive_num >= 0x80) + return get_hd_geometry(disk); +/* make sure floppy drive exists */ + num_fds = peekw(0x40, 0x10); + if(num_fds & 0x0001) + num_fds = ((num_fds / 64) & 3) + 1; + else + num_fds = 0; + if(disk->drive_num >= num_fds) + { + printf("open_disk(): fd 0x%02X does not exist\n", + disk->drive_num); + return -1; + } +/* temporary values to make read_sector(0) work */ + disk->heads = disk->sectors = 1; + err = read_sector(disk, 0, buf); + if(err != 0) + return err; +/* if it's a FAT (DOS) disk, we get can reliable geometry info +from the BIOS parameter block (BPB) in the bootsector */ + if(is_fat_bootsector(buf)) + { + disk->heads = LE16(buf + 26); + disk->sectors = LE16(buf + 24); + DEBUG(printf("open_disk() for fd 0x%02X: " + "CHS=?:%u:%u (from BPB)\n", + disk->drive_num, + disk->heads, disk->sectors);) + return 0; + } +#if 0 +/* ...otherwise, do slow probe */ + probe_floppy_geometry(disk); +#else +/* ...or just assume some values */ + disk->heads = 2; + disk->sectors = 18; + DEBUG(printf("open_disk() for fd 0x%02X: " + "assuming CHS=?:2:18\n", disk->drive_num);) +#endif + return 0; +} diff --git a/Dump/hybos/__experimental/dos.h b/Dump/hybos/__experimental/dos.h new file mode 100644 index 0000000..d604379 --- /dev/null +++ b/Dump/hybos/__experimental/dos.h @@ -0,0 +1,65 @@ +/***************************************************************************** +Sector-level disk I/O code for DOS. +This code is public domain (no copyright). +You can do whatever you want with it. + +EXPORTS: +peekb(), peekw() +*****************************************************************************/ +#ifndef __DISKIO_DOS_H +#define __DISKIO_DOS_H + +#ifdef __cplusplus +extern "C" +{ +#endif + +/********************************* TURBO C **********************************/ +#if defined(__TURBOC__) +#include /* peekb(), peek() */ + +#define peekw(S,O) peek(S,O) + +/* xxx - I'm not sure of the Turbo C version where these were +introduced. They are present in Turbo C++ 3.0 (__TURBOC__ == 0x401) +but not in Turbo C++ 1.0 (__TURBOC__ == 0x296) */ +#if __TURBOC__<0x300 +#define _DISK_RESET 0 /* controller hard reset */ +#define _DISK_STATUS 1 /* status of last operation */ +#define _DISK_READ 2 /* read sectors */ +#define _DISK_WRITE 3 /* write sectors */ +#define _DISK_VERIFY 4 /* verify sectors */ +#define _DISK_FORMAT 5 /* format track */ +#endif + +/********************************* DJGPP ************************************/ +#elif defined(__DJGPP__) +#include /* _farpeek[b|w]() */ +#include /* _dos_ds */ + +#define peekb(S,O) _farpeekb(_dos_ds, 16uL * (S) + (O)) +#define peekw(S,O) _farpeekw(_dos_ds, 16uL * (S) + (O)) + +/******************************** WATCOM C **********************************/ +#elif defined(__WATCOMC__) + +#if defined(__386__) +/* CauseWay DOS extender only */ +#define peekb(S,O) *(unsigned char *)(16uL * (S) + (O)) +#define peekw(S,O) *(unsigned short *)(16uL * (S) + (O)) +#else +#include /* MK_FP() */ +#define peekb(S,O) *(unsigned char far *)MK_FP(S,O) +#define peekw(S,O) *(unsigned short far *)MK_FP(S,O) +#endif + +/****************************************************************************/ +#else +#error Not Turbo C, not DJGPP, not Watcom C. Sorry. +#endif + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/Dump/hybos/__experimental/dos16.c b/Dump/hybos/__experimental/dos16.c new file mode 100644 index 0000000..d849321 --- /dev/null +++ b/Dump/hybos/__experimental/dos16.c @@ -0,0 +1,114 @@ +/***************************************************************************** +Sector-level disk I/O code for DOS, using 16-bit compiler. +This code is public domain (no copyright). +You can do whatever you want with it. + +EXPORTS: +int lba_biosdisk(int cmd, int drive, unsigned long lba, + int nsects, void *buf); +int get_hd_geometry(disk_t *disk); +*****************************************************************************/ +#include /* memset() */ +#include /* printf() */ +#include /* _DISK_... */ +/* union REGS, struct SREGS, int86(), int86x() */ +#include /* FP_SEG(), FP_OFF() */ +#include "diskio.h" +#include "dos.h" /* peekb() */ +/***************************************************************************** +*****************************************************************************/ +int lba_biosdisk(int cmd, int drive, unsigned long lba, int nsects, void *buf) +{ + struct + { + unsigned char pkt_len; + unsigned char res0; + unsigned char nsects; + unsigned char res1; + unsigned short buf_off; + unsigned short buf_seg; + unsigned long lba31_0; + unsigned long lba63_32; + } lba_cmd_pkt; + unsigned tries, err = 0; + struct SREGS sregs; + union REGS regs; + + if(cmd != _DISK_READ && cmd != _DISK_WRITE) + return 0x100; +/* make sure drive and BIOS support LBA */ + regs.x.bx = 0x55AA; + regs.h.dl = drive; + regs.h.ah = 0x41; + int86x(0x13, ®s, ®s, &sregs); + if(regs.x.cflag) + return 0x100; +/* fill out the INT 13h AH=4xh command packet */ + memset(&lba_cmd_pkt, 0, sizeof(lba_cmd_pkt)); + lba_cmd_pkt.pkt_len = sizeof(lba_cmd_pkt); + lba_cmd_pkt.nsects = nsects; + lba_cmd_pkt.buf_off = FP_OFF(buf); + lba_cmd_pkt.buf_seg = FP_SEG(buf); + lba_cmd_pkt.lba31_0 = lba; +/* fill out registers for INT 13h AH=4xh */ + sregs.ds = FP_SEG(&lba_cmd_pkt); + regs.x.si = FP_OFF(&lba_cmd_pkt); + regs.h.dl = drive; +/* make 3 attempts */ + for(tries = 3; tries != 0; tries--) + { + regs.h.ah = (cmd == _DISK_READ) ? 0x42 : 0x43; + int86x(0x13, ®s, ®s, &sregs); + err = regs.h.ah; + if(!regs.x.cflag) + return 0; +/* reset disk */ + regs.h.ah = _DISK_RESET; + int86x(0x13, ®s, ®s, &sregs); + } + DEBUG(printf("lba_biosdisk(): error 0x%02X\n", err);) + return err; +} +/***************************************************************************** +*****************************************************************************/ +int get_hd_geometry(disk_t *disk) +{ + union REGS regs; + +/* make sure hard drive exists */ + if(disk->drive_num - 0x80 >= peekb(0x40, 0x75)) + { + printf("get_hd_geometry(): hd 0x%02X does not exist\n", + disk->drive_num); + return -1; + } +/* use LBA if drive and BIOS support it */ + regs.h.ah = 0x41; + regs.x.bx = 0x55AA; + regs.h.dl = disk->drive_num; + int86(0x13, ®s, ®s); + if(!regs.x.cflag && regs.x.bx == 0xAA55) + { + disk->use_lba = 1; + DEBUG(printf("get_hd_geometry(): using LBA for hd 0x%02X\n", + disk->drive_num);) + return 0; + } +/* get geometry from BIOS */ + regs.h.ah = 0x08; + regs.h.dl = disk->drive_num; + int86(0x13, ®s, ®s); + if(regs.x.cflag) + { + printf("get_hd_geometry(): error getting geometry " + "for hard drive 0x%02X\n", disk->drive_num); + return -1; + } + disk->heads = regs.h.dh + 1; + disk->sectors = regs.h.cl & 0x3F; + DEBUG(printf("get_hd_geometry() for hd 0x%02X: " + "CHS=?:%u:%u (from INT 13h AH=08h)\n", + disk->drive_num, + disk->heads, disk->sectors);) + return 0; +} diff --git a/Dump/hybos/__experimental/makefile b/Dump/hybos/__experimental/makefile new file mode 100644 index 0000000..97c6819 --- /dev/null +++ b/Dump/hybos/__experimental/makefile @@ -0,0 +1,32 @@ +# Makefile for Turbo C++ 1.0 +# For old Turbo MAKE 3.0, this file MUST be named 'makefile' + +# defines +# MAKEDEP =makefile +MODEL =s +CC =tcc -v -m$(MODEL) -w -O2 -d -Z -vi -1 +LIBDIR =c:\tc\lib +LD =tlink /v /x +OBJS =demo.obj dos.obj dos16.obj + +# targets +all: diskio.exe + +clean: + deltree /y *.exe *.obj *.o *.err + +# implicit rules +.c.obj: + $(CC) -c -o$*.obj $< + +# dependencies +demo.o: demo.c $(MAKEDEP) diskio.h + +dos.o: dos.c $(MAKEDEP) diskio.h dos.h + +dos16.o: dos16.c $(MAKEDEP) diskio.h dos.h + +# explicit rules +diskio.exe: $(OBJS) $(MAKEDEP) + $(LD) $(LIBDIR)\c0$(MODEL).obj $(OBJS),$.,,$(LIBDIR)\c$(MODEL).lib + diff --git a/Dump/hybos/__experimental/watcom16.mak b/Dump/hybos/__experimental/watcom16.mak new file mode 100644 index 0000000..0c61cc3 --- /dev/null +++ b/Dump/hybos/__experimental/watcom16.mak @@ -0,0 +1,28 @@ +# Makefile for DOS - Watcom C + +# defines +# MAKEDEP =watcom16.mak +CC =wcc -3 -s -d2 -hw -ox -w=9 -zc -ms +OBJS =demo.obj dos.obj dos16.obj + +# targets +all: diskio.exe + +clean: + deltree /y *.exe *.obj *.o *.err + +# implicit rules +.c.obj: + $(CC) -fo=$@ $[. + +# dependencies +demo.o: demo.c $(MAKEDEP) diskio.h + +dos.o: dos.c $(MAKEDEP) diskio.h dos.h + +dos16.o: dos16.c $(MAKEDEP) diskio.h dos.h + +# explicit rules +diskio.exe: $(OBJS) $(MAKEDEP) + wlink D W A SYSTEM dos NAME $@ FILE demo.obj FILE dos.obj FILE dos16.obj + diff --git a/Dump/hybos/__experimental/watcom32.c b/Dump/hybos/__experimental/watcom32.c new file mode 100644 index 0000000..978b34e --- /dev/null +++ b/Dump/hybos/__experimental/watcom32.c @@ -0,0 +1,117 @@ +/***************************************************************************** +Sector-level disk I/O code for DOS, using 32-bit Watcom C +with CauseWay DOS extender. +This code is public domain (no copyright). +You can do whatever you want with it. + +xxx - This code doesn't work + +EXPORTS: +int lba_biosdisk(int cmd, int drive, unsigned long lba, + int nsects, void *buf); +int get_hd_geometry(disk_t *disk); +*****************************************************************************/ +#include /* memset() */ +#include /* printf() */ +#include /* _DISK_... */ +/* union REGS, struct SREGS, int386(), int386x() */ +#include /* FP_SEG(), FP_OFF() */ +#include "diskio.h" +#include "dos.h" /* peekb() */ +/***************************************************************************** +*****************************************************************************/ +int lba_biosdisk(int cmd, int drive, unsigned long lba, int nsects, void *buf) +{ + struct + { + unsigned char pkt_len; + unsigned char res0; + unsigned char nsects; + unsigned char res1; + unsigned short buf_off; + unsigned short buf_seg; + unsigned long lba31_0; + unsigned long lba63_32; + } lba_cmd_pkt; + unsigned tries, err = 0; + struct SREGS sregs; + union REGS regs; + + if(cmd != _DISK_READ && cmd != _DISK_WRITE) + return 0x100; +/* make sure drive and BIOS support LBA */ + regs.w.bx = 0x55AA; + regs.h.dl = drive; + regs.h.ah = 0x41; + int386x(0x13, ®s, ®s, &sregs); + if(regs.w.cflag) + return 0x100; +/* fill out the INT 13h AH=4xh command packet */ + memset(&lba_cmd_pkt, 0, sizeof(lba_cmd_pkt)); + lba_cmd_pkt.pkt_len = sizeof(lba_cmd_pkt); + lba_cmd_pkt.nsects = nsects; + lba_cmd_pkt.buf_off = FP_OFF(buf); + lba_cmd_pkt.buf_seg = FP_SEG(buf); + lba_cmd_pkt.lba31_0 = lba; +/* fill out registers for INT 13h AH=4xh */ + sregs.ds = FP_SEG(&lba_cmd_pkt); + regs.w.si = FP_OFF(&lba_cmd_pkt); + regs.h.dl = drive; +/* make 3 attempts */ + for(tries = 3; tries != 0; tries--) + { + regs.h.ah = (cmd == _DISK_READ) ? 0x42 : 0x43; + int386x(0x13, ®s, ®s, &sregs); + err = regs.h.ah; + if(!regs.w.cflag) + return 0; +/* reset disk */ + regs.h.ah = _DISK_RESET; + int386x(0x13, ®s, ®s, &sregs); + } + DEBUG(printf("lba_biosdisk(): error 0x%02X\n", err);) + return err; +} +/***************************************************************************** +*****************************************************************************/ +int get_hd_geometry(disk_t *disk) +{ + union REGS regs; + +/* make sure hard drive exists */ + if(disk->drive_num - 0x80 >= peekb(0x40, 0x75)) + { + printf("get_hd_geometry(): hd 0x%02X does not exist\n", + disk->drive_num); + return -1; + } +/* use LBA if drive and BIOS support it */ + regs.h.ah = 0x41; + regs.w.bx = 0x55AA; + regs.h.dl = disk->drive_num; + int386(0x13, ®s, ®s); + if(!regs.w.cflag && regs.w.bx == 0xAA55) + { + disk->use_lba = 1; + DEBUG(printf("get_hd_geometry(): using LBA for hd 0x%02X\n", + disk->drive_num);) + return 0; + } +/* get geometry from BIOS */ + regs.h.ah = 0x08; + regs.h.dl = disk->drive_num; + int386(0x13, ®s, ®s); + if(!regs.w.cflag) + { + printf("get_hd_geometry(): error getting geometry " + "for hard drive 0x%02X\n", disk->drive_num); + return -1; + } + disk->heads = regs.h.dh + 1; + disk->sectors = regs.h.cl & 0x3F; + DEBUG(printf("get_hd_geometry() for hd 0x%02X: " + "CHS=?:%u:%u (from INT 13h AH=08h)\n", + disk->drive_num, + disk->heads, disk->sectors);) + return 0; +} diff --git a/Dump/hybos/__experimental/watcom32.mak b/Dump/hybos/__experimental/watcom32.mak new file mode 100644 index 0000000..f5164c6 --- /dev/null +++ b/Dump/hybos/__experimental/watcom32.mak @@ -0,0 +1,30 @@ +# Makefile for 32-bit DOS - Watcom C +# (using CauseWay DOS extender) +# xxx - the resulting DISKIO.EXE doesn't work (!) + +# defines +# MAKEDEP =watcom32.mak +CC =wcc386 -3 -s -d2 -hw -ox -w=9 -zc -mf +OBJS =demo.obj dos.obj watcom32.obj + +# targets +all: diskio.exe + +clean: + deltree /y *.exe *.obj *.o *.err + +# implicit rules +.c.obj: + $(CC) -fo=$@ $[. + +# dependencies +demo.o: demo.c $(MAKEDEP) diskio.h + +dos.o: dos.c $(MAKEDEP) diskio.h dos.h + +watcom32.o: watcom32.c $(MAKEDEP) diskio.h dos.h + +# explicit rules +diskio.exe: $(OBJS) $(MAKEDEP) + wlink D W A SYSTEM causeway NAME $@ FILE demo.obj FILE dos.obj FILE watcom32.obj + diff --git a/Dump/hybos/__experimental/win-nt.c b/Dump/hybos/__experimental/win-nt.c new file mode 100644 index 0000000..6d97a0c --- /dev/null +++ b/Dump/hybos/__experimental/win-nt.c @@ -0,0 +1,125 @@ +/***************************************************************************** +Sector-level disk I/O code for Windows NT. +This code is public domain (no copyright). +You can do whatever you want with it. + +EXPORTS: +int read_sector(disk_t *disk, unsigned long lba, unsigned char *buf); +int open_disk(disk_t *disk, unsigned drive_num); +int is_fat_bootsector(unsigned char *buf); + +Tim Robinson helped with this code. +(Bugs are due to Giese :) +*****************************************************************************/ +#include +/* FILE, fopen(), setvbuf(), fseek(), fread(), fclose(), printf(), sprintf() */ +#include +#include "diskio.h" +/***************************************************************************** +*****************************************************************************/ +static FILE *do_open(unsigned drive_num) +{ + char dev_name[64]; + FILE *f; + +/* form internal drive name */ + if(drive_num < 0x80) + sprintf(dev_name, "\\\\.\\%c:", drive_num + 'A'); + else + sprintf(dev_name, "\\\\.\\PhysicalDrive%u", + drive_num - 0x80); +/* open the drive */ + f = fopen(dev_name, "r+b"); + if(f == NULL) + printf("do_open(): drive 0x%02X (%s) does not exist\n", + drive_num, dev_name); + return f; +} +/***************************************************************************** +*****************************************************************************/ +int read_sector(disk_t *disk, unsigned long lba, unsigned char *buf) +{ + unsigned err; + FILE *f; + + lba += disk->partition_start; + f = do_open(disk->drive_num); + if(f == NULL) + return -1; +/* seek, read, close */ + setvbuf(f, NULL, _IOFBF, BPS); + fseek(f, lba * BPS, SEEK_SET); + err = fread(buf, 1, BPS, f); + fclose(f); + return (err == BPS) ? 0 : -1; +} +/***************************************************************************** +*****************************************************************************/ +int open_disk(disk_t *disk, unsigned drive_num) +{ + OSVERSIONINFO win_version; + unsigned char buf[BPS]; + unsigned err = 0; + FILE *f; + +/* check for NT */ + win_version.dwOSVersionInfoSize = sizeof(win_version); + GetVersionEx(&win_version); + if(win_version.dwPlatformId != VER_PLATFORM_WIN32_NT) + { + printf("Sorry, Windows NT required\n" + "Windows 9x users should use the " + "DOS version of this program\n\n"); + return -1; + } + disk->drive_num = drive_num; + disk->partition_start = 0; /* assume floppy */ + disk->use_lba = 0; /* assume CHS */ +/* open the drive, to make sure it exists */ + f = do_open(disk->drive_num); + if(f == NULL) + return -1; + fclose(f); +/* no CHS geometry - NT uses LBA for everything */ + return 0; +} +/***************************************************************************** +is_fat_bootsector() is not used in this file, but still used in DEMO.C +*****************************************************************************/ +int is_fat_bootsector(unsigned char *buf) +{ + int temp, ok = 1; + + DEBUG(printf("check_if_fat_bootsector:\n");) +/* must start with 16-bit JMP or 8-bit JMP plus NOP */ + if(buf[0] == 0xE9) + /* OK */; + else if(buf[0] == 0xEB && buf[2] == 0x90) + /* OK */; + else + { + DEBUG(printf("\tMissing JMP/NOP\n");) + ok = 0; + } + temp = buf[13]; + if(temp == 0 || ((temp - 1) & temp) != 0) + { + DEBUG(printf("\tSectors per cluster (%u) " + "is not a power of 2\n", temp);) + ok = 0; + } + temp = buf[16]; + temp = LE16(buf + 24); + if(temp == 0 || temp > 63) + { + DEBUG(printf("\tInvalid number of sectors (%u)\n", temp);) + ok = 0; + } + temp = LE16(buf + 26); + if(temp == 0 || temp > 255) + { + DEBUG(printf("\tInvalid number of heads (%u)\n", temp);) + ok = 0; + } + return ok; +} diff --git a/Dump/hybos/__experimental/win-nt.mak b/Dump/hybos/__experimental/win-nt.mak new file mode 100644 index 0000000..c43eb97 --- /dev/null +++ b/Dump/hybos/__experimental/win-nt.mak @@ -0,0 +1,26 @@ +# Makefile for Windows NT - MinGW/CygWin + +# defines +# MAKEDEP =makefile +CC =gcc -g -O2 -Wall -W +LD =gcc -g +OBJS =demo.o win-nt.o + +# targets +all: diskio.exe + +clean: + deltree /y *.exe *.obj *.o *.err + +# implicit rules +.c.o: + $(CC) -c -o$@ $< + +# dependencies +demo.o: demo.c $(MAKEDEP) diskio.h + +win-nt.o: win-nt.c $(MAKEDEP) diskio.h + +# explicit rules +diskio.exe: $(OBJS) $(MAKEDEP) + $(LD) -o$@ $(OBJS) diff --git a/Dump/hybos/boot/grub/mbchk.c b/Dump/hybos/boot/grub/mbchk.c new file mode 100644 index 0000000..fcb2485 --- /dev/null +++ b/Dump/hybos/boot/grub/mbchk.c @@ -0,0 +1,166 @@ +/***************************************************************************** +This was lifted from the GRUB source code. +GRUB is available under the GNU general public license from + http://www.gnu.org/software/grub + ftp://alpha.gnu.org/gnu/grub +*****************************************************************************/ +#include "mltiboot.h" +#include + +static int quiet; +/***************************************************************************** +*****************************************************************************/ +static int +check_multiboot (const char *filename, FILE *fp) +{ + multiboot_header_t *mbh = 0; + int i; + char buf[8192]; + + if (fread (buf, 1, 8192, fp) < 0) + { + fprintf (stderr, "%s: Read error.\n", filename); + return 0; + } + + for (i = 0; i < 8192 - sizeof (multiboot_header_t); i++) + { + unsigned long magic = *((unsigned long *) (buf + i)); + + if (magic == MULTIBOOT_HEADER_MAGIC) + { + mbh = (multiboot_header_t *) (buf + i); + break; + } + } + + if (! mbh) + { + fprintf (stderr, "%s: No Multiboot header.\n", filename); + return 0; + } + + if (! quiet) + printf ("%s: The Multiboot header is found at the offset %d.\n", + filename, i); + + /* Check for the checksum. */ + if (mbh->magic + mbh->flags + mbh->checksum != 0) + { + fprintf (stderr, + "%s: Bad checksum (0x%lx).\n", + filename, mbh->checksum); + return 0; + } + + /* Reserved flags must be zero. */ + if (mbh->flags & ~0x00010003) + { + fprintf (stderr, + "%s: Non-zero is found in reserved flags (0x%lx).\n", + filename, mbh->flags); + return 0; + } + + if (! quiet) + { + printf ("%s: Page alignment is turned %s.\n", + filename, (mbh->flags & 0x1)? "on" : "off"); + printf ("%s: Memory information is turned %s.\n", + filename, (mbh->flags & 0x2)? "on" : "off"); + printf ("%s: Address fields is turned %s.\n", + filename, (mbh->flags & 0x10000)? "on" : "off"); + } + + /* Check for the address fields. */ + if (mbh->flags & 0x10000) + { + +printf("header_addr = 0x%lX\n", mbh->header_addr); +printf("load_addr = 0x%lX\n", mbh->load_addr); +printf("load_end_addr = 0x%lX\n", mbh->load_end_addr); +printf("bss_end_addr = 0x%lX\n", mbh->bss_end_addr); +printf("entry_addr = 0x%lX\n", mbh->entry_addr); + + if (mbh->header_addr < mbh->load_addr) + { + fprintf (stderr, + "%s: header_addr is less than " + "load_addr (0x%lx > 0x%lx).\n", + filename, mbh->header_addr, mbh->load_addr); + return 0; + } + + if (mbh->load_addr >= mbh->load_end_addr) + { + fprintf (stderr, + "%s: load_addr is not less than load_end_addr" + " (0x%lx >= 0x%lx).\n", + filename, mbh->load_addr, mbh->load_end_addr); + return 0; + } + + if (mbh->load_end_addr > mbh->bss_end_addr) + { + fprintf (stderr, + "%s: load_end_addr is greater than bss_end_addr" + " (0x%lx > 0x%lx).\n", + filename, mbh->load_end_addr, mbh->bss_end_addr); + return 0; + } + + if (mbh->load_addr > mbh->entry_addr) + { + fprintf (stderr, + "%s: load_addr is greater than entry_addr" + " (0x%lx > 0x%lx).\n", + filename, mbh->load_addr, mbh->entry_addr); + return 0; + } + + if (mbh->load_end_addr <= mbh->entry_addr) + { + fprintf (stderr, + "%s: load_end_addr is not less than entry_addr" + " (0x%lx <= 0x%lx).\n", + filename, mbh->load_end_addr, mbh->entry_addr); + return 0; + } + + /* This is a GRUB-specific limitation. */ + if (mbh->load_addr < 0x100000) + { + fprintf (stderr, + "%s: Cannot be loaded at less than 1MB by GRUB" + " (0x%lx).\n", + filename, mbh->load_addr); + return 0; + } + } + + if (! quiet) + printf ("%s: All checks passed.\n", filename); + + return 1; +} +/***************************************************************************** +*****************************************************************************/ +int main(unsigned arg_c, char *arg_v[]) +{ + FILE *file; + + if(arg_c < 2) + { + printf("Checks if file is Multiboot compatible\n"); + return 1; + } + file = fopen(arg_v[1], "rb"); + if(file == NULL) + { + printf("Can't open file '%s'\n", arg_v[1]); + return 2; + } + check_multiboot(arg_v[1], file); + fclose(file); + return 0; +} diff --git a/Dump/hybos/boot/grub/menu.lst b/Dump/hybos/boot/grub/menu.lst new file mode 100644 index 0000000..3f86aa1 --- /dev/null +++ b/Dump/hybos/boot/grub/menu.lst @@ -0,0 +1,39 @@ +# boot the first entry by default +# default 0 +# if there's a problem booting the default entry, boot the second entry +# fallback 1 +# boot default after 30 sec +# timeout 30 + +title OSD 3 + root (fd0) + kernel /osd3.x + +title OSD 4 + root (fd0) + kernel /osd4.x + +title OSD 5 + root (fd0) + kernel /osd5.x + +title OSD 6 + root (fd0) + kernel /osd6.x + +title OSD 7 + root (fd0) + kernel /osd7.x + +title OSD 8 + root (fd0) + kernel /osd8.x + +title OSD 9 + root (fd0) + kernel /osd9.x + +title Boot from C: drive + root (hd0,1) + makeactive + chainloader +1 diff --git a/Dump/hybos/boot/grub/mltiboot.h b/Dump/hybos/boot/grub/mltiboot.h new file mode 100644 index 0000000..6c2efdb --- /dev/null +++ b/Dump/hybos/boot/grub/mltiboot.h @@ -0,0 +1,115 @@ +/* multiboot.h - the header for Multiboot */ +/* Copyright (C) 1999 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ + +/* Macros. */ + +/* The magic number for the Multiboot header. */ +#define MULTIBOOT_HEADER_MAGIC 0x1BADB002 + +/* The flags for the Multiboot header. */ +#define MULTIBOOT_HEADER_FLAGS 0x00010003 + +/* The magic number passed by a Multiboot-compliant boot loader. */ +#define MULTIBOOT_BOOTLOADER_MAGIC 0x2BADB002 + +/* The size of our stack (16KB). */ +#define STACK_SIZE 0x4000 + +/* C symbol format. HAVE_ASM_USCORE is defined by configure. */ +#ifdef HAVE_ASM_USCORE +# define EXT_C(sym) _ ## sym +#else +# define EXT_C(sym) sym +#endif + +#ifndef ASM +/* Do not include here in boot.S. */ + +/* Types. */ + +/* The Multiboot header. */ +typedef struct multiboot_header +{ + unsigned long magic; + unsigned long flags; + unsigned long checksum; + unsigned long header_addr; + unsigned long load_addr; + unsigned long load_end_addr; + unsigned long bss_end_addr; + unsigned long entry_addr; +} multiboot_header_t; + +/* The symbol table for a.out. */ +typedef struct aout_symbol_table +{ + unsigned long tabsize; + unsigned long strsize; + unsigned long addr; + unsigned long reserved; +} aout_symbol_table_t; + +/* The section header table for ELF. */ +typedef struct elf_section_header_table +{ + unsigned long num; + unsigned long size; + unsigned long addr; + unsigned long shndx; +} elf_section_header_table_t; + +/* The Multiboot information. */ +typedef struct multiboot_info +{ + unsigned long flags; + unsigned long mem_lower; + unsigned long mem_upper; + unsigned long boot_device; + unsigned long cmdline; + unsigned long mods_count; + unsigned long mods_addr; + union + { + aout_symbol_table_t aout_sym; + elf_section_header_table_t elf_sec; + } u; + unsigned long mmap_length; + unsigned long mmap_addr; +} multiboot_info_t; + +/* The module structure. */ +typedef struct module +{ + unsigned long mod_start; + unsigned long mod_end; + unsigned long string; + unsigned long reserved; +} module_t; + +/* The memory map. Be careful that the offset 0 is base_addr_low + but no size. */ +typedef struct memory_map +{ + unsigned long size; + unsigned long base_addr_low; + unsigned long base_addr_high; + unsigned long length_low; + unsigned long length_high; + unsigned long type; +} memory_map_t; + +#endif /* ! ASM */ diff --git a/Dump/hybos/boot/grub/stage1 b/Dump/hybos/boot/grub/stage1 new file mode 100644 index 0000000..1cd1292 --- /dev/null +++ b/Dump/hybos/boot/grub/stage1 Binary files differ diff --git a/Dump/hybos/boot/grub/stage2 b/Dump/hybos/boot/grub/stage2 new file mode 100644 index 0000000..25094fe --- /dev/null +++ b/Dump/hybos/boot/grub/stage2 Binary files differ diff --git a/Dump/hybos/boot/kernel.bin b/Dump/hybos/boot/kernel.bin new file mode 100644 index 0000000..3ff90a0 --- /dev/null +++ b/Dump/hybos/boot/kernel.bin Binary files differ diff --git a/Dump/hybos/include/._malloc.h.swp b/Dump/hybos/include/._malloc.h.swp new file mode 100644 index 0000000..3a93866 --- /dev/null +++ b/Dump/hybos/include/._malloc.h.swp Binary files differ diff --git a/Dump/hybos/include/.ctype.h.swp b/Dump/hybos/include/.ctype.h.swp new file mode 100644 index 0000000..3191f8d --- /dev/null +++ b/Dump/hybos/include/.ctype.h.swp Binary files differ diff --git a/Dump/hybos/include/.fat.h.swp b/Dump/hybos/include/.fat.h.swp new file mode 100644 index 0000000..ab6de14 --- /dev/null +++ b/Dump/hybos/include/.fat.h.swp Binary files differ diff --git a/Dump/hybos/include/.keyboard.h.swp b/Dump/hybos/include/.keyboard.h.swp new file mode 100644 index 0000000..b1505f1 --- /dev/null +++ b/Dump/hybos/include/.keyboard.h.swp Binary files differ diff --git a/Dump/hybos/include/.stdarg.h.swp b/Dump/hybos/include/.stdarg.h.swp new file mode 100644 index 0000000..3c895d7 --- /dev/null +++ b/Dump/hybos/include/.stdarg.h.swp Binary files differ diff --git a/Dump/hybos/include/.x86.h.swp b/Dump/hybos/include/.x86.h.swp new file mode 100644 index 0000000..4a4a828 --- /dev/null +++ b/Dump/hybos/include/.x86.h.swp Binary files differ diff --git a/Dump/hybos/include/__nocompile_fcntl.h b/Dump/hybos/include/__nocompile_fcntl.h new file mode 100644 index 0000000..48de3c3 --- /dev/null +++ b/Dump/hybos/include/__nocompile_fcntl.h @@ -0,0 +1,79 @@ +/** + * fcntl.h + * + * access constants for _open. Note that this file is not complete + * and should not be used (yet) + */ + +#ifndef __STRICT_ANSI__ +#ifndef _FCNTL_H + +#define _FCNTL_H + +/** + * File access modes + */ +#define _O_RDONLY 0 /* read only */ +#define _O_WRONLY 1 /* write only */ +#define _O_RDWR 2 /* read and write */ + +/** + * Mask for access mode bits in the _open flags + */ +#define _O_ACCMODE (_O_RDONLY|_O_WRONLY|_O_RDWR) +#define _O_APPEND 0x0008 /* append output to end of file */ +#define _O_RANDOM 0x0010 +#define _O_SEQUENTIAL 0x0020 +#define _O_TEMPORARY 0x0040 /* make the file dissappear after closing */ +#define _O_NOINHERIT 0x0080 +#define _O_CREAT 0x0100 /* create file if it doesn't exist */ +#define _O_TRUNC 0x0200 /* truncate file to zero bytes if it exists */ +#define _O_EXCL 0x0400 /* open only if the file does not exist */ + +#define _O_SHORT_LIVED 0x1000 + +#define _O_TEXT 0x4000 /* crlf in file == lf in memory (\r\n == \n) */ +#define _O_BINARY 0x8000 /* input and output is not translated */ +#define _O_RAW _O_BINARY /* compatability */ + +/** + * XXX + * The following special mode(s) are only available to the + * kernel. Modules (even kernel-level modules) and other + * binaries will never be allowed to use these special modes. + * + * Modules which are compiled into the kernel may use these + * special modes (mainly at boot). + */ +#define _O_DEV 0x9000 /* XXX: special device links (files) */ +#define _O_SWAP 0x9100 /* swap */ + +#ifndef _NO_OLDNAMES + +/** + * POSIX/Non-ANSI names for increased portability + */ +#define O_RDONLY _O_RDONLY +#define O_WRONLY _O_WRONLY +#define O_RDWR _O_RDWR +#define O_ACCMODE _O_ACCMODE +#define O_APPEND _O_APPEND +#define O_CREAT _O_CREAT +#define O_TRUNC _O_TRUNC +#define O_EXCL _O_EXCL +#define O_TEXT _O_TEXT +#define O_BINARY _O_BINARY +#define O_TEMPORARY _O_TEMPORARY +#define O_NOINHERIT _O_NOINHERIT +#define O_SEQUENTIAL _O_SEQUENTIAL +#define O_RANDOM _O_RANDOM + +#define O_DEV _O_DEV +#define O_SWAP _O_SWAP + +#endif /* ! _NO_OLDNAMES */ + +#endif /* ! _FCNTL_H */ + +#endif /* ! __STRICT_ANSI__ */ + diff --git a/Dump/hybos/include/__nocompile_signal.h b/Dump/hybos/include/__nocompile_signal.h new file mode 100644 index 0000000..5aef646 --- /dev/null +++ b/Dump/hybos/include/__nocompile_signal.h @@ -0,0 +1,83 @@ +/** + * fcntl.h + * + * access constants for _open. Note that this file is not complete + * and should not be used (yet) + */ + +#ifndef _SIGNAL_H +#define _SIGNAL_H + +/** + * The actual signal values. Using other values with signal + * produces a SIG_ERR return value. + * + * NOTE: SIGINT is produced when the user presses Ctrl-C + * SIGILL has not been tested + * SIGFPE + * SIGSEGV + * SIGTERM comes from what kind of termination request exactly? + * SIGBREAK is produced by pressing Ctrl-Break + * SIGABRT is produced by calling abort + */ +#define SIGINT 2 /* Interactive attention */ +#define SIGILL 4 /* Illegal instruction */ +#define SIGFPE 8 /* Floating point error */ +#define SIGSEGV 11 /* Segmentation violation */ +#define SIGTERM 15 /* Termination request */ +#define SIGBREAK 21 /* Ctrl-Break */ +#define SIGABRT 22 /* Abnormal termination (abort) */ + +#define NSIG 23 /* maximum signal number + 1 */ + +#ifndef RC_INVOKED +#ifndef _SIG_ATOMIC_T_DEFINED +typedef int sig_atomic_t; +#define _SIG_ATOMIC_T_DEFINED +#endif /* ! _SIG_ATOMIC_T_DEFINED */ + +/** + * The prototypes (below) are the easy part. The hard part is figuring + * out what signals are available and what numbers they are assigned + * along with appropriate values of SIG_DFL and SIG_IGN. + */ + +/** + * A pointer to a signal handler function. A signal handler takes a + * single int, which is the signal it handles. + */ +typedef void (*__p_sig_fn_t)(int); + +/** + * These are special values of signal handler pointers which are + * used to send a signal to the default handler (SIG_DFL), ignore + * the signal (SIG_IGN), or indicate an error return (SIG_ERR). + */ +#define SIG_DFL ((__p_sig_fn_t) 0) +#define SIG_IGN ((__p_sig_fn_t) 1) +#define SIG_ERR ((__p_sig_fn_t) -1) + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * Call signal to set the signal handler for signal sig to the + * function pointed to by handler. Returns a pointer to the + * previous handler, or SIG_ERR if an error occurs. Initially + * unhandled signals defined above will return SIG_DFL. + */ +_CRTIMP __p_sig_fn_t __cdecl signal(int, __p_sig_fn_t); + +/** + * Raise the signal indicated by sig. Returns non-zero on success. + */ +_CRTIMP int __cdecl raise (int); + +#ifdef __cplusplus +} +#endif + +#endif /* ! RC_INVOKED */ +#endif /* ! _SIGNAL_H */ + diff --git a/Dump/hybos/include/_malloc.h b/Dump/hybos/include/_malloc.h new file mode 100644 index 0000000..b8c68da --- /dev/null +++ b/Dump/hybos/include/_malloc.h @@ -0,0 +1,37 @@ +#ifndef __TL__MALLOC_H +#define __TL__MALLOC_H + +#ifdef __cplusplus +extern "C" +{ +#endif + +/* 500K */ +#define HEAP_SIZE 500000uL + +#include <_size_t.h> +/*#include <_null.h>*/ + +#define MALLOC_MAGIC 0x6D92 /* must be < 0x8000 */ + +typedef struct _malloc /* Turbo C DJGPP */ +{ + size_t size; /* 2 bytes 4 bytes */ + struct _malloc *next; /* 2 bytes 4 bytes */ + unsigned magic : 15; /* 2 bytes total 4 bytes total */ + unsigned used : 1; +} malloc_t; /* total 6 bytes 12 bytes */ + +extern malloc_t *_heap_bot, *_heap_top; + +static void dump_heap(void); +static void *kbrk(int *delta); +void *kmalloc(size_t size); +void kfree(void *blk); +void *krealloc(void *blk, size_t size); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/Dump/hybos/include/_null.h_ b/Dump/hybos/include/_null.h_ new file mode 100644 index 0000000..6207940 --- /dev/null +++ b/Dump/hybos/include/_null.h_ @@ -0,0 +1,18 @@ +#ifndef __TL__NULL_H +#define __TL__NULL_H + +#ifdef __cplusplus +extern "C" +{ +#endif + +#ifndef _NULL +#define _NULL +#define NULL 0 +#endif + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/Dump/hybos/include/_printf.h b/Dump/hybos/include/_printf.h new file mode 100644 index 0000000..c967f10 --- /dev/null +++ b/Dump/hybos/include/_printf.h @@ -0,0 +1,19 @@ +#ifndef __TL__PRINTF_H +#define __TL__PRINTF_H + +#ifdef __cplusplus +extern "C" +{ +#endif + +#include <_va_list.h> + +typedef int (*fnptr_t)(unsigned c, void **helper); + +int do_printf(const char *fmt, va_list args, fnptr_t fn, void *ptr); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/Dump/hybos/include/_size_t.h b/Dump/hybos/include/_size_t.h new file mode 100644 index 0000000..bebd416 --- /dev/null +++ b/Dump/hybos/include/_size_t.h @@ -0,0 +1,18 @@ +#ifndef __TL__SIZE_T_H +#define __TL__SIZE_T_H + +#ifdef __cplusplus +extern "C" +{ +#endif + +#ifndef _SIZE_T +#define _SIZE_T +typedef unsigned size_t; +#endif + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/Dump/hybos/include/_va_list.h b/Dump/hybos/include/_va_list.h new file mode 100644 index 0000000..fe5b164 --- /dev/null +++ b/Dump/hybos/include/_va_list.h @@ -0,0 +1,15 @@ +#ifndef __TL__VA_LIST_H +#define __TL__VA_LIST_H + +#ifdef __cplusplus +extern "C" +{ +#endif + +typedef unsigned char *va_list; + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/Dump/hybos/include/asm.inc b/Dump/hybos/include/asm.inc new file mode 100644 index 0000000..3ba45fc --- /dev/null +++ b/Dump/hybos/include/asm.inc @@ -0,0 +1,30 @@ +%ifndef __TL_ASM_INC +%define __TL_ASM_INC 1 + +; macros to handle leading underscores added by DOS/Windows compilers +%macro IMP 1 +%ifdef UNDERBARS + EXTERN _%1 + %define %1 _%1 +%else + EXTERN %1 +%endif +%endmacro + +%macro EXP 1 + GLOBAL $_%1 + $_%1: + GLOBAL $%1 + $%1: +%endmacro + +DS_MAGIC equ 3544DA2Ah + +MULTIBOOT_PAGE_ALIGN equ 1<<0 +MULTIBOOT_MEMORY_INFO equ 1<<1 +MULTIBOOT_AOUT_KLUDGE equ 1<<16 +MULTIBOOT_HEADER_MAGIC equ 0x1BADB002 +MULTIBOOT_HEADER_FLAGS equ MULTIBOOT_PAGE_ALIGN | MULTIBOOT_MEMORY_INFO | MULTIBOOT_AOUT_KLUDGE +MULTIBOOT_CHECKSUM equ -(MULTIBOOT_HEADER_MAGIC + MULTIBOOT_HEADER_FLAGS) + +%endif diff --git a/Dump/hybos/include/char.h b/Dump/hybos/include/char.h new file mode 100644 index 0000000..9ae9311 --- /dev/null +++ b/Dump/hybos/include/char.h @@ -0,0 +1,24 @@ +#ifndef _CHAR_H +#define _CHAR_H + +#include + +long atoi(const char *nptr); +bool isalnum(const char c); +bool isalpha(const char c); +bool isascii(const unsigned char c); +bool iscsym(const char c); +bool iscsymf(const char c); +bool isctrl(const char c); +bool isdigit(const char c); +bool isgraph(const unsigned char c); +bool islowwer(const char c); +bool isprint(const char c); +bool ispunct(const char c); +bool isspace(const char c); +bool isupper(const char c); +bool isxdigit(const char c); +int tolower(int c); +int toupper(int c); + +#endif /* !defined(_CHAR_H) */ diff --git a/Dump/hybos/include/conio.h b/Dump/hybos/include/conio.h new file mode 100644 index 0000000..abc6575 --- /dev/null +++ b/Dump/hybos/include/conio.h @@ -0,0 +1,60 @@ +#ifndef __TL_CONIO_H +#define __TL_CONIO_H + +#ifdef __cplusplus +extern "C" +{ +#endif + +/* "bucky bits" +0x0100 is reserved for non-ASCII keys, so start with 0x200 */ +#define KBD_META_ALT 0x0200 /* Alt is pressed */ +#define KBD_META_CTRL 0x0400 /* Ctrl is pressed */ +#define KBD_META_SHIFT 0x0800 /* Shift is pressed */ +#define KBD_META_ANY (KBD_META_ALT | KBD_META_CTRL | KBD_META_SHIFT) +#define KBD_META_CAPS 0x1000 /* CapsLock is on */ +#define KBD_META_NUM 0x2000 /* NumLock is on */ +#define KBD_META_SCRL 0x4000 /* ScrollLock is on */ + +/* "ASCII" values for non-ASCII keys. All of these are user-defined. + +Hrrm. Unicode defines code pages for pseudographics (e.g. box-drawing +characters). I wonder it defines anything for keys like these? + +function keys: */ +#define KEY_F1 0x80 +#define KEY_F2 (KEY_F1 + 1) +#define KEY_F3 (KEY_F2 + 1) +#define KEY_F4 (KEY_F3 + 1) +#define KEY_F5 (KEY_F4 + 1) +#define KEY_F6 (KEY_F5 + 1) +#define KEY_F7 (KEY_F6 + 1) +#define KEY_F8 (KEY_F7 + 1) +#define KEY_F9 (KEY_F8 + 1) +#define KEY_F10 (KEY_F9 + 1) +#define KEY_F11 (KEY_F10 + 1) +#define KEY_F12 (KEY_F11 + 1) +/* cursor keys */ +#define KEY_INS 0x90 +#define KEY_DEL (KEY_INS + 1) +#define KEY_HOME (KEY_DEL + 1) +#define KEY_END (KEY_HOME + 1) +#define KEY_PGUP (KEY_END + 1) +#define KEY_PGDN (KEY_PGUP + 1) +#define KEY_LFT (KEY_PGDN + 1) +#define KEY_UP (KEY_LFT + 1) +#define KEY_DN (KEY_UP + 1) +#define KEY_RT (KEY_DN + 1) +/* print screen/sys rq and pause/break */ +#define KEY_PRNT (KEY_RT + 1) +#define KEY_PAUSE (KEY_PRNT + 1) +/* these return a value but they could also act as additional bucky keys */ +#define KEY_LWIN (KEY_PAUSE + 1) +#define KEY_RWIN (KEY_LWIN + 1) +#define KEY_MENU (KEY_RWIN + 1) + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/Dump/hybos/include/ctype.h b/Dump/hybos/include/ctype.h new file mode 100644 index 0000000..ac9d411 --- /dev/null +++ b/Dump/hybos/include/ctype.h @@ -0,0 +1,44 @@ +#ifndef __TL_CTYPE_H +#define __TL_CTYPE_H + +#ifdef __cplusplus +extern "C" +{ +#endif + +extern char _ctype[]; + +typedef enum {false = 0, true = !0} bool; + +#define CT_UP 0x01 /* upper case */ +#define CT_LOW 0x02 /* lower case */ +#define CT_DIG 0x04 /* digit */ +#define CT_CTL 0x08 /* control */ +#define CT_PUN 0x10 /* punctuation */ +#define CT_WHT 0x20 /* white space (space/cr/lf/tab) */ +#define CT_HEX 0x40 /* hex digit */ +#define CT_SP 0x80 /* hard space (0x20) */ + +/* without the cast to unsigned, DJGPP complains (using -Wall) */ +#define isalnum(c) ((_ctype + 1)[(unsigned)(c)] & (CT_UP | CT_LOW | CT_DIG)) +#define isalpha(c) ((_ctype + 1)[(unsigned)(c)] & (CT_UP | CT_LOW)) +#define iscntrl(c) ((_ctype + 1)[(unsigned)(c)] & (CT_CTL)) +#define isdigit(c) ((_ctype + 1)[(unsigned)(c)] & (CT_DIG)) +#define isgraph(c) ((_ctype + 1)[(unsigned)(c)] & (CT_PUN | CT_UP | CT_LOW | CT_DIG)) +#define islower(c) ((_ctype + 1)[(unsigned)(c)] & (CT_LOW)) +#define isprint(c) ((_ctype + 1)[(unsigned)(c)] & (CT_PUN | CT_UP | CT_LOW | CT_DIG | CT_SP)) +#define ispunct(c) ((_ctype + 1)[(unsigned)(c)] & (CT_PUN)) +#define isspace(c) ((_ctype + 1)[(unsigned)(c)] & (CT_WHT)) +#define isupper(c) ((_ctype + 1)[(unsigned)(c)] & (CT_UP)) +#define isxdigit(c) ((_ctype + 1)[(unsigned)(c)] & (CT_DIG | CT_HEX)) +#define isascii(c) ((unsigned)(c) <= 0x7F) +#define toascii(c) ((unsigned)(c) & 0x7F) + +#define tolower(c) (isupper(c) ? c + 'a' - 'A' : c) +#define toupper(c) (islower(c) ? c + 'A' - 'a' : c) + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/Dump/hybos/include/e2fs.h b/Dump/hybos/include/e2fs.h new file mode 100644 index 0000000..edf72f3 --- /dev/null +++ b/Dump/hybos/include/e2fs.h @@ -0,0 +1,290 @@ +/* e2fs.h */ +#ifndef E2FS_H +#define E2FS_H + +/* + * This code is a complete rewrite of the read-only part of E2FS + * library, done to reduce code size and memory requirements, and + * also increase speed in my particular conditions. + * + * So I need to include this for the common structure description: + * + * Copyright (C) 1992, 1993, 1994, 1995 + * Remy Card (card@masi.ibp.fr) + * Laboratoire MASI - Institut Blaise Pascal + * Universite Pierre et Marie Curie (Paris VI) + * + * from + * + * linux/include/linux/minix_fs.h + * + * Copyright (C) 1991, 1992 Linus Torvalds + * + * And I also have to point to the complete e2fsprogs suite + * at: http://sourceforge.net/projects/e2fsprogs/ + * or: http://e2fsprogs.sourceforge.net + * by Theodore Ts'o (http://thunk.org/tytso/) (tytso@mit.edu). + * + * This rewrite is based on the structure found in e2fsprogs-1.26. + * + * Note that some parts of e2fsprogs may be available under LGPL, + * my added work is only available under the GPL - not LGPL. + */ + +/* Gujin is a bootloader, it loads a Linux kernel from cold boot or DOS. + * Copyright (C) 1999-2003 Etienne Lorrain, fingerprint (2D3AF3EA): + * 2471 DF64 9DEE 41D4 C8DB 9667 E448 FF8C 2D3A F3EA + * E-Mail: etienne.lorrain@masroudeau.com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ +typedef unsigned char __u8; +typedef short __s16; +typedef unsigned short __u16; +typedef int __s32; +typedef unsigned int __u32; + +/* + * Where the master copy of the superblock is located, and how big + * superblocks are supposed to be. We define SUPERBLOCK_SIZE because + * the size of the superblock structure is not necessarily trustworthy + * (some versions have the padding set up so that the superblock is + * 1032 bytes long). + */ +#define SUPERBLOCK_OFFSET 1024 +#define SUPERBLOCK_SIZE 1024 +#define EXT2_MIN_BLOCK_SIZE 1024 +#define EXT2_MAX_BLOCK_SIZE 4096 + +/* + * Special inodes numbers + */ +#define EXT2_BAD_INO 1 /* Bad blocks inode */ +#define EXT2_ROOT_INO 2 /* Root inode */ +#define EXT2_ACL_IDX_INO 3 /* ACL inode */ +#define EXT2_ACL_DATA_INO 4 /* ACL inode */ +#define EXT2_BOOT_LOADER_INO 5 /* Boot loader inode */ +#define EXT2_UNDEL_DIR_INO 6 /* Undelete directory inode */ +#define EXT2_RESIZE_INO 7 /* Reserved group descriptors inode */ +#define EXT2_JOURNAL_INO 8 /* Journal inode */ + +/* + * First non-reserved inode for old ext2 filesystems + */ +#define EXT2_GOOD_OLD_FIRST_INO 11 + +/* + * The second extended file system magic number + */ +#define EXT2_SUPER_MAGIC 0xEF53 + +/* + * Revision levels + */ +#define EXT2_GOOD_OLD_REV 0 /* The good old (original) format */ +#define EXT2_DYNAMIC_REV 1 /* V2 format w/ dynamic inode sizes */ + +#define EXT2_CURRENT_REV EXT2_GOOD_OLD_REV +#define EXT2_MAX_SUPP_REV EXT2_DYNAMIC_REV + +#define EXT2_GOOD_OLD_INODE_SIZE 128 + +#define EXT2_NAME_LEN 255 + +/* + * Structure of the super block + */ +typedef struct { + __u32 s_inodes_count; /* Inodes count */ + __u32 s_blocks_count; /* Blocks count */ + __u32 s_r_blocks_count; /* Reserved blocks count */ + __u32 s_free_blocks_count; /* Free blocks count */ + __u32 s_free_inodes_count; /* Free inodes count */ + __u32 s_first_data_block; /* First Data Block */ + __u32 s_log_block_size; /* Block size */ + __s32 s_log_frag_size; /* Fragment size */ + __u32 s_blocks_per_group; /* # Blocks per group */ + __u32 s_frags_per_group; /* # Fragments per group */ + __u32 s_inodes_per_group; /* # Inodes per group */ + __u32 s_mtime; /* Mount time */ + __u32 s_wtime; /* Write time */ + __u16 s_mnt_count; /* Mount count */ + __s16 s_max_mnt_count; /* Maximal mount count */ + __u16 s_magic; /* Magic signature */ + __u16 s_state; /* File system state */ + __u16 s_errors; /* Behaviour when detecting errors */ + __u16 s_minor_rev_level; /* minor revision level */ + __u32 s_lastcheck; /* time of last check */ + __u32 s_checkinterval; /* max. time between checks */ + __u32 s_creator_os; /* OS */ + __u32 s_rev_level; /* Revision level */ + __u16 s_def_resuid; /* Default uid for reserved blocks */ + __u16 s_def_resgid; /* Default gid for reserved blocks */ + /* + * These fields are for EXT2_DYNAMIC_REV superblocks only. + * + * Note: the difference between the compatible feature set and + * the incompatible feature set is that if there is a bit set + * in the incompatible feature set that the kernel doesn't + * know about, it should refuse to mount the filesystem. + * + * e2fsck's requirements are more strict; if it doesn't know + * about a feature in either the compatible or incompatible + * feature set, it must abort and not try to meddle with + * things it doesn't understand... + */ + __u32 s_first_ino; /* First non-reserved inode */ + __u16 s_inode_size; /* size of inode structure */ + __u16 s_block_group_nr; /* block group # of this superblock */ + struct feature_compat_str { + unsigned dir_prealloc : 1; + unsigned imagic_inode : 1; + unsigned has_journal : 1; + unsigned ext_attr : 1; + unsigned resize_inode : 1; + unsigned dir_index : 1; + unsigned reserved : 26; + } __attribute__ ((packed)) s_feature_compat; /* compatible feature set */ + struct feature_incompat_str { + unsigned compression : 1; + unsigned filetype : 1; + unsigned recover : 1; + unsigned journal_dev : 1; + unsigned reserved : 28; + } __attribute__ ((packed)) s_feature_incompat; /* incompatible feature set */ + struct feature_ro_compat_str { + unsigned sparse_super : 1; + unsigned large_file : 1; + unsigned btree_dir : 1; + unsigned reserved : 27; + } __attribute__ ((packed)) s_feature_ro_compat; /* readonly-compatible feature set */ + __u8 s_uuid[16]; /* 128-bit uuid for volume */ + char s_volume_name[16]; /* volume name */ + char s_last_mounted[64]; /* directory where last mounted */ + __u32 s_algorithm_usage_bitmap; /* For compression */ + /* + * Performance hints. Directory preallocation should only + * happen if the EXT2_FEATURE_COMPAT_DIR_PREALLOC flag is on. + */ + __u8 s_prealloc_blocks; /* Nr of blocks to try to preallocate*/ + __u8 s_prealloc_dir_blocks; /* Nr to preallocate for dirs */ + __u16 s_padding1; + /* + * Journaling support valid if EXT2_FEATURE_COMPAT_HAS_JOURNAL set. + */ + __u8 s_journal_uuid[16]; /* uuid of journal superblock */ + __u32 s_journal_inum; /* inode number of journal file */ + __u32 s_journal_dev; /* device number of journal file */ + __u32 s_last_orphan; /* start of list of inodes to delete */ + + __u32 s_reserved[197]; /* Padding to the end of the block */ + } E2FS_super_block; + +/* + * Structure of an inode on the disk + */ +typedef struct { + struct i_mode_str { +#if 0 + struct { + unsigned short execute : 1; + unsigned short write : 1; + unsigned short read : 1; + } __attribute__ ((packed)) other, group, user; +#else + unsigned short execute_other : 1; + unsigned short write_other : 1; + unsigned short read_other : 1; + unsigned short execute_group : 1; + unsigned short write_group : 1; + unsigned short read_group : 1; + unsigned short execute_user : 1; + unsigned short write_user : 1; + unsigned short read_user : 1; +#endif + unsigned short vtx : 1; + unsigned short gid : 1; + unsigned short uid : 1; + enum { + fmt_fifo = 1, + fmt_chr = 2, + fmt_dir = 4, + fmt_blk = 6, + fmt_reg = 8, + fmt_lnk = 10, + fmt_sock = 12 + } fmt : 4; + } __attribute__ ((packed)) i_mode; /* File mode */ + __u16 i_uid; /* Low 16 bits of Owner Uid */ + __u32 i_size; /* Size in bytes */ + __u32 i_atime; /* Access time */ + __u32 i_ctime; /* Creation time */ + __u32 i_mtime; /* Modification time */ + __u32 i_dtime; /* Deletion Time */ + __u16 i_gid; /* Low 16 bits of Group Id */ + __u16 i_links_count; /* Links count */ + __u32 i_blocks; /* Blocks count */ + __u32 i_flags; /* File flags */ + /* OS dependent 1: */ + __u32 i_translator; /* Only HURD, else reserved */ + /* end OS dependent 1 */ + __u32 i_direct_block[12]; + __u32 i_simple_indirect_block; + __u32 i_double_indirect_block; + __u32 i_triple_indirect_block; + __u32 i_generation; /* File version (for NFS) */ + __u32 i_file_acl; /* File ACL */ + __u32 i_size_high; /* was i_dir_acl, i.e. Directory ACL */ + __u32 i_faddr; /* Fragment address */ + /* OS dependent 2: */ + __u8 i_frag; /* Fragment number */ + __u8 i_fsize; /* Fragment size */ + __u16 i_mode_high; /* Only HURD, else padding */ + /* Following is reserved for masix: */ + __u16 i_uid_high; + __u16 i_gid_high; + __u32 i_author; /* Only HURD, else reserved */ + /* end OS dependent 2 */ + } __attribute__ ((packed)) E2FS_inode; + +typedef struct { + __u32 bg_block_bitmap; /* Blocks bitmap block */ + __u32 bg_inode_bitmap; /* Inodes bitmap block */ + __u32 bg_inode_table; /* Inodes table block */ + __u16 bg_free_blocks_count; /* Free blocks count */ + __u16 bg_free_inodes_count; /* Free inodes count */ + __u16 bg_used_dirs_count; /* Directories count */ + __u16 bg_pad; + __u32 bg_reserved[3]; + } E2FS_group_desc; + +typedef struct { + __u32 inode; /* Inode number */ + __u16 rec_len; /* Directory entry length */ + __u8 name_len; /* Name length */ + enum E2FS_file_type { + e2fs_ft_unknown = 0, + e2fs_ft_reg_file = 1, + e2fs_ft_dir = 2, + e2fs_ft_chrdev = 3, + e2fs_ft_blkdev = 4, + e2fs_ft_fifo = 5, + e2fs_ft_sock = 6, + e2fs_ft_symlink = 7 + } file_type : 8; + char name[EXT2_NAME_LEN]; /* File name (variable array) */ + } E2FS_dir_entry; + +#endif /* E2FS_H */ + diff --git a/Dump/hybos/include/esh/esh.h b/Dump/hybos/include/esh/esh.h new file mode 100644 index 0000000..298da0c --- /dev/null +++ b/Dump/hybos/include/esh/esh.h @@ -0,0 +1,33 @@ +/** + * esh.h + */ + +#ifndef _ESH_H +#define _ESH_H + +#define MAX_LEN 512 /* maximum length of a command */ +#define MAX_PARAMS 20 /* maximum ammount of parameters a command may have */ +#define COMMAND_COUNT 6 /* number of commands supported */ + +typedef struct ESHELL_COMMANDS +{ + int minparams; /* number of required parameters */ + int maxparams; /* number of maximum parameters supported */ + char command[MAX_LEN]; /* command entry */ + char params[MAX_PARAMS][MAX_LEN]; /* parameters for command [index]["entry"] */ + char description[MAX_LEN]; +} ESHCOMMANDS; + +typedef struct ESHELL_CURR_COMMAND +{ + int count; + char param[MAX_PARAMS][MAX_LEN]; + char value[MAX_PARAMS][MAX_LEN]; +} ESHCURRCOMMAND; + +void keyDown(unsigned key); +void keyUp(unsigned key); +void processCommand(char *line, int count); + +#endif /* _ESH_H */ + diff --git a/Dump/hybos/include/esh/esh.h~ b/Dump/hybos/include/esh/esh.h~ new file mode 100644 index 0000000..134afeb --- /dev/null +++ b/Dump/hybos/include/esh/esh.h~ @@ -0,0 +1,32 @@ +/** + * esh.h + */ + +#ifndef _ESH_H +#define _ESH_H + +#define MAX_LEN 512 /* maximum length of a command */ +#define MAX_PARAMS 20 /* maximum ammount of parameters a command may have */ +#define COMMAND_COUNT 6 /* number of commands supported */ + +typedef struct ESHELL_COMMANDS +{ + int minparams; /* number of required parameters */ + int maxparams; /* number of maximum parameters supported */ + char command[MAX_LEN]; /* command entry */ + char params[MAX_PARAMS][MAX_LEN]; /* parameters for command [index]["entry"] */ +} ESHCOMMANDS; + +typedef struct ESHELL_CURR_COMMAND +{ + int count; + char param[MAX_PARAMS][MAX_LEN]; + char value[MAX_PARAMS][MAX_LEN]; +} ESHCURRCOMMAND; + +void keyDown(unsigned key); +void keyUp(unsigned key); +void processCommand(char *line, int count); + +#endif /* _ESH_H */ + diff --git a/Dump/hybos/include/fat.h b/Dump/hybos/include/fat.h new file mode 100644 index 0000000..af93578 --- /dev/null +++ b/Dump/hybos/include/fat.h @@ -0,0 +1,84 @@ +#ifndef _FAT_H +#define _FAT_H + +typedef unsigned char uint8_t; +typedef unsigned short uint16_t; +typedef unsigned long uint32_t; + +/** + * FAT12 and FAT16 bootsector + */ +typedef struct __FAT_BOOTSECTOR /* MUST be packed */ +{ + uint8_t jump[3]; /* 16-bit JMP to boot code, or 8-bit JMP + NOP */ + uint8_t oem_id[8]; /* e.g., 'MSWIN4.0' */ + uint16_t bytes_per_sector; /* typically 512 */ + uint8_t sectors_per_cluster; + uint16_t num_boot_sectors; /* typically 1 */ + uint8_t num_fats; /* typically 2 */ + uint16_t num_root_dir_ents; + uint16_t total_sectors; /* 16-bit; 0 if num sectors > 65535 */ + uint8_t media_ID_byte; /* typically 0F0h */ + uint16_t sectors_per_fat; + uint16_t sectors_per_track; + uint16_t heads; + uint32_t hidden_sectors; /* LBA partition start */ + uint32_t total_sectors_large; /* 32-bit; 0 if num sectors < 65536 */ + uint8_t boot_code[474]; + uint8_t magic[2]; /* 55h, 0AAh */ +} FAT_BOOTSECTOR; /* 512 bytes total */ + +/** + * FAT directory entries + * + * As far as I know, this should be valid for FAT12/16/32 + * Entries are 32 bytes long + */ +typedef struct __FAT_DIRSTRUCT /* MUST be packed */ +{ + uint8_t name[8]; /* all caps, pad right with spaces */ + uint8_t ext[3]; /* all caps, pad right with spaces */ + uint8_t attrib; /* attribute byte */ + uint8_t reserved; /* 0 */ + uint8_t ctime_ms; /* file creation time, 10ms units */ + uint16_t ctime; /* file creation time, in DOS format */ + uint16_t cdate; /* file creation date, in DOS format */ + uint16_t adate; /* DOS date of last file access */ + uint16_t st_clust_msw; /* high 16 bits of starting cluster (FAT32) */ + uint16_t mtime; /* DOS time of last file modification */ + uint16_t mdate; /* DOS date of last file modification */ + uint16_t st_clust; /* starting cluster */ + uint32_t file_size; /* in bytes */ +} FAT_DIRSTRUCT; /* 32 bytes total */ + +/** + * DOS time and date structs + */ +typedef struct __DOS_TIME /* MUST be packed */ +{ + unsigned two_secs : 5; /* low 5 bits: 2-second increments */ + unsigned minutes : 6; /* middle 6 bits: minutes */ + unsigned hours : 5; /* high 5 bits: hours (0-23) */ +} DOS_TIME; /* 2 bytes total */ + +typedef struct __DOS_DATE /* MUST be packed */ +{ + unsigned date : 5; /* low 5 bits: date (1-31) */ + unsigned month : 4; /* middle 4 bits: month (1-12) */ + unsigned year : 7; /* high 7 bits: year - 1980 */ +} DOS_DATE; /* 2 bytes total */ + +/** + * DOS File attributes + */ +typedef struct __DOS_ATTRIB /* MUST be packed */ +{ + int read_only : 1; /* b0 */ + int hidden : 1; + int system : 1; + int volume_label : 1; + int directory : 1; + int reserved : 2; /* b6, b7 */ +} DOS_ATTRIB; /* 1 byte total */ + +#endif /* ! _FAT_H */ diff --git a/Dump/hybos/include/keyboard.h b/Dump/hybos/include/keyboard.h new file mode 100644 index 0000000..403422c --- /dev/null +++ b/Dump/hybos/include/keyboard.h @@ -0,0 +1,415 @@ +#ifndef _KEYBOARD_H +#define _KEYBOARD_H + +/** + * For now we will default to __KB_IBM_PC_XT + */ +#define __KB_IBM_PC_XT + + +/** + * Just in case we were defined someplace else + */ +#ifdef __KB_IBM_PC_XT +#undef __KB_IBM_PC_AT +#undef __KB_IBM_PS2 +#elif defined(__KB_IBM_PC_AT) +#undef __KB_IBM_PC_XT +#undef __KB_IBM_PS2 +#else +#undef __KB_IBM_PC_AT +#undef __KB_IBM_PC_XT +#define __KB_IBM_PC_XT +#endif + + +#ifdef __KB_IBM_PC_XT +/** + * Set 1 Scancodes + * + * IBM PC XT + * + * __KB_IBM_PC_XT must be defined to use these + */ +#define KEY_ESC 0x01 +#define KEY_F1 0x3B +#define KEY_F2 0x3C +#define KEY_F3 0x3D +#define KEY_F4 0x3E +#define KEY_F5 0x3F +#define KEY_F6 0x40 +#define KEY_F7 0x41 +#define KEY_F8 0x42 +#define KEY_F9 0x43 +#define KEY_F10 0x44 +#define KEY_F11 0x57 +#define KEY_F12 0x58 +#define KEY_TILDA 0x29 +#define KEY_1 0x02 +#define KEY_2 0x03 +#define KEY_3 0x04 +#define KEY_4 0x05 +#define KEY_5 0x06 +#define KEY_6 0x07 +#define KEY_7 0x08 +#define KEY_8 0x09 +#define KEY_9 0x0A +#define KEY_0 0x0B +#define KEY_MINUS 0x0C +#define KEY_PLUS 0x0D +#define KEY_BKSLASH 0x2B +#define KEY_BKSPACE 0x0E +#define KEY_TAB 0x0F +#define KEY_Q 0x10 +#define KEY_W 0x11 +#define KEY_E 0x12 +#define KEY_R 0x13 +#define KEY_T 0x14 +#define KEY_Y 0x15 +#define KEY_U 0x16 +#define KEY_I 0x17 +#define KEY_O 0x18 +#define KEY_P 0x19 +#define KEY_LBRACKET 0x1A +#define KEY_RBRACKET 0x1B +#define KEY_ENTER 0x1C +#define KEY_CAPS 0x3A +#define KEY_A 0x1E +#define KEY_S 0x1F +#define KEY_D 0x20 +#define KEY_F 0x21 +#define KEY_G 0x22 +#define KEY_H 0x23 +#define KEY_J 0x24 +#define KEY_K 0x25 +#define KEY_L 0x26 +#define KEY_SEMICOLON 0x27 +#define KEY_QUOTE 0x28 +#define KEY_LSHIFT 0x2A +#define KEY_Z 0x2C +#define KEY_X 0x2D +#define KEY_C 0x2E +#define KEY_V 0x2F +#define KEY_B 0x30 +#define KEY_N 0x31 +#define KEY_M 0x32 +#define KEY_COMMA 0x33 +#define KEY_PERIOD 0x34 +#define KEY_SLASH 0x35 +#define KEY_RSHIFT 0x36 +#define KEY_LCTRL 0x1D +#define KEY_LWIN 0x5B +#define KEY_LALT 0x38 +#define KEY_SPACE 0x39 +#define KEY_RALT 0x38 +#define KEY_RWIN 0x5C +#define KEY_MENU 0x5D +#define KEY_RCTRL 0x1D +#define KEY_SCRLCK 0x46 /* scroll lock */ + +/** + * Keypad + */ +#define KEYP_NUMLCK 0x45 +#define KEYP_SLASH 0x35 +#define KEYP_ASTERISK 0x37 +#define KEYP_MINUS 0x4A +#define KEYP_7 0x47 +#define KEYP_8 0x48 +#define KEYP_9 0x49 +#define KEYP_PLUS 0x4E +#define KEYP_4 0x4B +#define KEYP_5 0x4C +#define KEYP_6 0x4D +#define KEYP_1 0x4F +#define KEYP_2 0x50 +#define KEYP_3 0x51 +#define KEYP_ENTER 0x1C +#define KEYP_0 0x52 +#define KEYP_PERIOD 0x53 + +/** + * Insert, Home, Page Up cluster + */ +#define KEY_INSERT 0x52 +#define KEY_HOME 0x47 +#define KEY_PGUP 0x49 +#define KEY_DEL 0x53 +#define KEY_END 0x4F +#define KEY_PGDOWN 0x51 + +/** + * Arrow key cluster + */ +#define KEY_UP 0x48 +#define KEY_LEFT 0x4B +#define KEY_DOWN 0x50 +#define KEY_RIGHT 0x4D + +/** + * FIXME: Experimental + */ +//#define KEY_PRTSCR 0xE02AE037 /* print screen */ +//#define KEY_PAUSE 0xE11D45E19DC5 /* pause/break */ + +#endif /* defined(__KB_IBM_PC_XT) */ + +#ifdef __KB_IBM_PC_AT +/** + * Set 2 Scancodes + * + * IBM PC AT + * + * __KB_IBM_PC_AT must be defined to use these + */ +#define KEY_ESC 0x76 +#define KEY_F1 0x05 +#define KEY_F2 0x06 +#define KEY_F3 0x04 +#define KEY_F4 0x0C +#define KEY_F5 0x03 +#define KEY_F6 0x0B +#define KEY_F7 0x83 +#define KEY_F8 0x0A +#define KEY_F9 0x01 +#define KEY_F10 0x09 +#define KEY_F11 0x78 +#define KEY_F12 0x07 +#define KEY_TILDA 0x0E +#define KEY_1 0x16 +#define KEY_2 0x1E +#define KEY_3 0x26 +#define KEY_4 0x25 +#define KEY_5 0x2E +#define KEY_6 0x36 +#define KEY_7 0x3D +#define KEY_8 0x3E +#define KEY_9 0x46 +#define KEY_0 0x45 +#define KEY_MINUS 0x4E +#define KEY_PLUS 0x55 +#define KEY_BKSLASH 0x5D +#define KEY_BKSPACE 0x66 +#define KEY_TAB 0x0D +#define KEY_Q 0x15 +#define KEY_W 0x1D +#define KEY_E 0x24 +#define KEY_R 0x2D +#define KEY_T 0x2C +#define KEY_Y 0x35 +#define KEY_U 0x3C +#define KEY_I 0x43 +#define KEY_O 0x44 +#define KEY_P 0x4D +#define KEY_LBRACKET 0x54 +#define KEY_RBRACKET 0x5B +#define KEY_ENTER 0x5A +#define KEY_CAPS 0x58 +#define KEY_A 0x1C +#define KEY_S 0x1B +#define KEY_D 0x23 +#define KEY_F 0x2B +#define KEY_G 0x34 +#define KEY_H 0x33 +#define KEY_J 0x3B +#define KEY_K 0x42 +#define KEY_L 0x4B +#define KEY_SEMICOLON 0x4C +#define KEY_QUOTE 0x52 +#define KEY_LSHIFT 0x12 +#define KEY_Z 0x1A +#define KEY_X 0x22 +#define KEY_C 0x21 +#define KEY_V 0x2A +#define KEY_B 0x32 +#define KEY_N 0x31 +#define KEY_M 0x3A +#define KEY_COMMA 0x41 +#define KEY_PERIOD 0x49 +#define KEY_SLASH 0x4A +#define KEY_RSHIFT 0x59 +#define KEY_LCTRL 0x14 +#define KEY_LWIN 0xE01F +#define KEY_LALT 0x11 +#define KEY_SPACE 0x29 +#define KEY_RALT 0xE011 +#define KEY_RWIN 0xE027 +#define KEY_MENU 0xE02F +#define KEY_RCTRL 0xE014 +#define KEY_SCRLCK 0x7E /* scroll lock */ + +/** + * Keypad + */ +#define KEYP_NUMLCK 0x77 +#define KEYP_SLASH 0xE04A +#define KEYP_ASTERISK 0x7C +#define KEYP_MINUS 0x7B +#define KEYP_7 0x6C +#define KEYP_8 0x75 +#define KEYP_9 0x7D +#define KEYP_PLUS 0x79 +#define KEYP_4 0x6B +#define KEYP_5 0x73 +#define KEYP_6 0x74 +#define KEYP_1 0x69 +#define KEYP_2 0x72 +#define KEYP_3 0x7A +#define KEYP_ENTER 0xE05A +#define KEYP_0 0x70 +#define KEYP_PERIOD 0x71 + +/** + * Insert, Home, Page Up cluster + */ +#define KEY_INSERT 0xE070 +#define KEY_HOME 0xE06C +#define KEY_PGUP 0xE07D +#define KEY_DEL 0xE071 +#define KEY_END 0xE069 +#define KEY_PGDOWN 0xE07A + +/** + * Arrow key cluster + */ +#define KEY_UP 0xE075 +#define KEY_LEFT 0xE06B +#define KEY_DOWN 0xE072 +#define KEY_RIGHT 0xE074 + +/** + * FIXME: Experimental + */ +#define KEY_PRTSCR 0xE012E07C /* print screen */ +#define KEY_PAUSE 0xE11477E1F014F077 /* pause/break */ + +#endif /* defined(__KB_IBM_PC_AT) */ + +#ifdef __KB_IBM_PS2 +/** + * Set 1 Scancodes + * + * IBM PC XT + * + * __KB_IBM_PS2 must be defined to use these + */ +#define KEY_ESC 0x08 +#define KEY_F1 0x07 +#define KEY_F2 0x0F +#define KEY_F3 0x17 +#define KEY_F4 0x1F +#define KEY_F5 0x27 +#define KEY_F6 0x2F +#define KEY_F7 0x37 +#define KEY_F8 0x3F +#define KEY_F9 0x47 +#define KEY_F10 0x4F +#define KEY_F11 0x56 +#define KEY_F12 0x5E +#define KEY_TILDA 0x0E +#define KEY_1 0x16 +#define KEY_2 0x1E +#define KEY_3 0x26 +#define KEY_4 0x25 +#define KEY_5 0x2E +#define KEY_6 0x36 +#define KEY_7 0x3D +#define KEY_8 0x3E +#define KEY_9 0x46 +#define KEY_0 0x45 +#define KEY_MINUS 0x4E +#define KEY_PLUS 0x55 +#define KEY_BKSLASH 0x5C +#define KEY_BKSPACE 0x66 +#define KEY_TAB 0x0D +#define KEY_Q 0x15 +#define KEY_W 0x1D +#define KEY_E 0x24 +#define KEY_R 0x2D +#define KEY_T 0x2C +#define KEY_Y 0x35 +#define KEY_U 0x3C +#define KEY_I 0x43 +#define KEY_O 0x44 +#define KEY_P 0x4D +#define KEY_LBRACKET 0x54 +#define KEY_RBRACKET 0x5B +#define KEY_ENTER 0x5A +#define KEY_CAPS 0x14 +#define KEY_A 0x1C +#define KEY_S 0x1B +#define KEY_D 0x23 +#define KEY_F 0x2B +#define KEY_G 0x34 +#define KEY_H 0x33 +#define KEY_J 0x3B +#define KEY_K 0x42 +#define KEY_L 0x4B +#define KEY_SEMICOLON 0x4C +#define KEY_QUOTE 0x52 +#define KEY_LSHIFT 0x12 +#define KEY_Z 0x1A +#define KEY_X 0x22 +#define KEY_C 0x21 +#define KEY_V 0x2A +#define KEY_B 0x32 +#define KEY_N 0x31 +#define KEY_M 0x3A +#define KEY_COMMA 0x41 +#define KEY_PERIOD 0x49 +#define KEY_SLASH 0x4A +#define KEY_RSHIFT 0x59 +#define KEY_LCTRL 0x11 +#define KEY_LWIN 0x8B +#define KEY_LALT 0x19 +#define KEY_SPACE 0x29 +#define KEY_RALT 0x39 +#define KEY_RWIN 0x8C +#define KEY_MENU 0x8D +#define KEY_RCTRL 0x58 +#define KEY_SCRLCK 0x5F /* scroll lock */ +#define KEY_PRTSCR 0x57 /* print screen */ +#define KEY_PAUSE 0x62 /* pause/break */ + +/** + * Keypad + */ +#define KEYP_NUMLCK 0x76 +#define KEYP_SLASH 0x77 +#define KEYP_ASTERISK 0x7E +#define KEYP_MINUS 0x84 +#define KEYP_7 0x6C +#define KEYP_8 0x75 +#define KEYP_9 0x7D +#define KEYP_PLUS 0x7C +#define KEYP_4 0x6B +#define KEYP_5 0x73 +#define KEYP_6 0x74 +#define KEYP_1 0x69 +#define KEYP_2 0x72 +#define KEYP_3 0x7A +#define KEYP_ENTER 0x79 +#define KEYP_0 0x70 +#define KEYP_PERIOD 0x71 + +/** + * Insert, Home, Page Up cluster + */ +#define KEY_INSERT 0x67 +#define KEY_HOME 0x6E +#define KEY_PGUP 0x6F +#define KEY_DEL 0x64 +#define KEY_END 0x65 +#define KEY_PGDOWN 0x6D + +/** + * Arrow key cluster + */ +#define KEY_UP 0x63 +#define KEY_LEFT 0x61 +#define KEY_DOWN 0x60 +#define KEY_RIGHT 0x6A + +#endif /* defined(__KB_IBM_PS2) */ + +#endif /* ! _KEYBOARD_H */ diff --git a/Dump/hybos/include/keymap.h b/Dump/hybos/include/keymap.h new file mode 100644 index 0000000..ae39ba0 --- /dev/null +++ b/Dump/hybos/include/keymap.h @@ -0,0 +1,142 @@ +/* keymap.h - defines for keymapping Author: Marcus Hampel + */ +#ifndef _SYS__KEYMAP_H +#define _SYS__KEYMAP_H + +#define C(c) ((c) & 0x1F) /* Map to control code */ +#define A(c) ((c) | 0x80) /* Set eight bit (ALT) */ +#define CA(c) A(C(c)) /* Control-Alt */ +#define L(c) ((c) | HASCAPS) /* Add "Caps Lock has effect" attribute */ + +#define EXT 0x0100 /* Normal function keys */ +#define CTRL 0x0200 /* Control key */ +#define SHIFT 0x0400 /* Shift key */ +#define ALT 0x0800 /* Alternate key */ +#define EXTKEY 0x1000 /* extended keycode */ +#define HASCAPS 0x8000 /* Caps Lock has effect */ + +/* Numeric keypad */ +#define HOME (0x01 + EXT) +#define END (0x02 + EXT) +#define UP (0x03 + EXT) +#define DOWN (0x04 + EXT) +#define LEFT (0x05 + EXT) +#define RIGHT (0x06 + EXT) +#define PGUP (0x07 + EXT) +#define PGDN (0x08 + EXT) +#define MID (0x09 + EXT) +#define NMIN (0x0A + EXT) +#define PLUS (0x0B + EXT) +#define INSRT (0x0C + EXT) + +/* Alt + Numeric keypad */ +#define AHOME (0x01 + ALT) +#define AEND (0x02 + ALT) +#define AUP (0x03 + ALT) +#define ADOWN (0x04 + ALT) +#define ALEFT (0x05 + ALT) +#define ARIGHT (0x06 + ALT) +#define APGUP (0x07 + ALT) +#define APGDN (0x08 + ALT) +#define AMID (0x09 + ALT) +#define ANMIN (0x0A + ALT) +#define APLUS (0x0B + ALT) +#define AINSRT (0x0C + ALT) + +/* Ctrl + Numeric keypad */ +#define CHOME (0x01 + CTRL) +#define CEND (0x02 + CTRL) +#define CUP (0x03 + CTRL) +#define CDOWN (0x04 + CTRL) +#define CLEFT (0x05 + CTRL) +#define CRIGHT (0x06 + CTRL) +#define CPGUP (0x07 + CTRL) +#define CPGDN (0x08 + CTRL) +#define CMID (0x09 + CTRL) +#define CNMIN (0x0A + CTRL) +#define CPLUS (0x0B + CTRL) +#define CINSRT (0x0C + CTRL) + +/* Lock keys */ +#define CALOCK (0x0D + EXT) /* caps lock */ +#define NLOCK (0x0E + EXT) /* number lock */ +#define SLOCK (0x0F + EXT) /* scroll lock */ + +/* Function keys */ +#define F1 (0x10 + EXT) +#define F2 (0x11 + EXT) +#define F3 (0x12 + EXT) +#define F4 (0x13 + EXT) +#define F5 (0x14 + EXT) +#define F6 (0x15 + EXT) +#define F7 (0x16 + EXT) +#define F8 (0x17 + EXT) +#define F9 (0x18 + EXT) +#define F10 (0x19 + EXT) +#define F11 (0x1A + EXT) +#define F12 (0x1B + EXT) + +/* Alt+Fn */ +#define AF1 (0x10 + ALT) +#define AF2 (0x11 + ALT) +#define AF3 (0x12 + ALT) +#define AF4 (0x13 + ALT) +#define AF5 (0x14 + ALT) +#define AF6 (0x15 + ALT) +#define AF7 (0x16 + ALT) +#define AF8 (0x17 + ALT) +#define AF9 (0x18 + ALT) +#define AF10 (0x19 + ALT) +#define AF11 (0x1A + ALT) +#define AF12 (0x1B + ALT) + +/* Ctrl+Fn */ +#define CF1 (0x10 + CTRL) +#define CF2 (0x11 + CTRL) +#define CF3 (0x12 + CTRL) +#define CF4 (0x13 + CTRL) +#define CF5 (0x14 + CTRL) +#define CF6 (0x15 + CTRL) +#define CF7 (0x16 + CTRL) +#define CF8 (0x17 + CTRL) +#define CF9 (0x18 + CTRL) +#define CF10 (0x19 + CTRL) +#define CF11 (0x1A + CTRL) +#define CF12 (0x1B + CTRL) + +/* Shift+Fn */ +#define SF1 (0x10 + SHIFT) +#define SF2 (0x11 + SHIFT) +#define SF3 (0x12 + SHIFT) +#define SF4 (0x13 + SHIFT) +#define SF5 (0x14 + SHIFT) +#define SF6 (0x15 + SHIFT) +#define SF7 (0x16 + SHIFT) +#define SF8 (0x17 + SHIFT) +#define SF9 (0x18 + SHIFT) +#define SF10 (0x19 + SHIFT) +#define SF11 (0x1A + SHIFT) +#define SF12 (0x1B + SHIFT) + +/* Alt+Shift+Fn */ +#define ASF1 (0x10 + ALT + SHIFT) +#define ASF2 (0x11 + ALT + SHIFT) +#define ASF3 (0x12 + ALT + SHIFT) +#define ASF4 (0x13 + ALT + SHIFT) +#define ASF5 (0x14 + ALT + SHIFT) +#define ASF6 (0x15 + ALT + SHIFT) +#define ASF7 (0x16 + ALT + SHIFT) +#define ASF8 (0x17 + ALT + SHIFT) +#define ASF9 (0x18 + ALT + SHIFT) +#define ASF10 (0x19 + ALT + SHIFT) +#define ASF11 (0x1A + ALT + SHIFT) +#define ASF12 (0x1B + ALT + SHIFT) + +#define MAP_COLS 6 /* Number of columns in keymap */ +#define NR_SCAN_CODES 0x80 /* Number of scan codes (rows in keymap) */ + +typedef unsigned short keymap_t[NR_SCAN_CODES * MAP_COLS]; + +#define KEY_MAGIC "KMAZ" /* Magic number of keymap file */ + +#endif /* _SYS__KEYMAP_H */ diff --git a/Dump/hybos/include/mmzone.h b/Dump/hybos/include/mmzone.h new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Dump/hybos/include/mmzone.h diff --git a/Dump/hybos/include/setjmp.h b/Dump/hybos/include/setjmp.h new file mode 100644 index 0000000..b9dda41 --- /dev/null +++ b/Dump/hybos/include/setjmp.h @@ -0,0 +1,24 @@ +#ifndef __TL_SETJMP_H +#define __TL_SETJMP_H + +#ifdef __cplusplus +extern "C" +{ +#endif + +typedef struct +{ +/* setjmp() and longjmp() rely on the order of these registers, +so do not re-arrange them */ + unsigned edi, esi, ebp, esp, ebx, edx, ecx, eax; + unsigned eip, eflags; +} jmp_buf[1]; + +int setjmp(jmp_buf b); +void longjmp(jmp_buf b, int ret_val); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/Dump/hybos/include/signal.h b/Dump/hybos/include/signal.h new file mode 100644 index 0000000..6344bb5 --- /dev/null +++ b/Dump/hybos/include/signal.h @@ -0,0 +1,52 @@ +/** + * signal.h + */ + +#ifndef _SIGNAL_H +#define _SIGNAL_H + +typedef int sig_atomic_t; + +#define SIGHUP 1 /* hangup */ +#define SIGINT 2 /* interrupt (DEL) */ +#define SIGQUIT 3 /* quit (ASCII FS) */ +#define SIGILL 4 /* illegal instruction */ +#define SIGTRAP 5 /* trace trap (not reset when caught) */ +#define SIGABRT 6 /* IOT instruction */ +#define SIGBUS 7 +#define SIGEMT 7 +#define SIGFPE 8 /* floating point exception */ +#define SIGKILL 9 /* kill (cannot be caught or ignored) */ +#define SIGUSR1 10 /* user defined signal 1 */ +#define SIGSEGV 11 /* segmentation violation */ +#define SIGUSR2 12 /* user defined signal 2 */ +#define SIGPIPE 13 /* write on a pipe with no one to read it */ +#define SIGALRM 14 /* alarm clock */ +#define SIGTERM 15 /* software termination signal from kill */ + +/** + * For POSIX compliance + */ +#define SIGCHLD 17 /* child process terminated or stopped */ +#define SIGCONT 18 /* continue if stopped */ +#define SIGSTOP 19 /* stop signal */ +#define SIGTSTP 20 /* interactive stop signal */ +#define SIGTTIN 21 /* background process requesting read */ +#define SIGTTOU 22 /* background process requesting write */ + +#if 0 +#define SIG_ERR ((__sighandler_t) -1) /* error return */ +#define SIG_DFL ((__sighandler_t) 0) /* default signal handling */ +#define SIG_IGN ((__sighandler_t) 1) /* ignore signal */ +#endif /* 0 */ + +#define _NSIG 23 + +#if 0 +int raise(int sig); +__sighandler_t signal(int sig, __sighandler_t func); +int kill(pid_t pid, int sig); +#endif /* 0 */ + +#endif /* _SIGNAL_H */ + diff --git a/Dump/hybos/include/signal.h~ b/Dump/hybos/include/signal.h~ new file mode 100644 index 0000000..56e3ab5 --- /dev/null +++ b/Dump/hybos/include/signal.h~ @@ -0,0 +1,50 @@ +/** + * signal.h + */ + +#ifndef _SIGNAL_H +#define _SIGNAL_H + +typedef int sig_atomic_t; + +#define SIGHUP 1 /* hangup */ +#define SIGINT 2 /* interrupt (DEL) */ +#define SIGQUIT 3 /* quit (ASCII FS) */ +#define SIGILL 4 /* illegal instruction */ +#define SIGTRAP 5 /* trace trap (not reset when caught) */ +#define SIGABRT 6 /* IOT instruction */ +#define SIGBUS 7 +#define SIGEMT 7 +#define SIGFPE 8 /* floating point exception */ +#define SIGKILL 9 /* kill (cannot be caught or ignored) */ +#define SIGUSR1 10 /* user defined signal 1 */ +#define SIGSEGV 11 /* segmentation violation */ +#define SIGUSR2 12 /* user defined signal 2 */ +#define SIGPIPE 13 /* write on a pipe with no one to read it */ +#define SIGALRM 14 /* alarm clock */ +#define SIGTERM 15 /* software termination signal from kill */ + +/** + * For POSIX compliance + */ +#define SIGCHLD 17 /* child process terminated or stopped */ +#define SIGCONT 18 /* continue if stopped */ +#define SIGSTOP 19 /* stop signal */ +#define SIGTSTP 20 /* interactive stop signal */ +#define SIGTTIN 21 /* background process requesting read */ +#define SIGTTOU 22 /* background process requesting write */ + +#if 0 +#define SIG_ERR ((__sighandler_t) -1) /* error return */ +#define SIG_DFL ((__sighandler_t) 0) /* default signal handling */ +#define SIG_IGN ((__sighandler_t) 1) /* ignore signal */ +#endif /* 0 */ + +#define _NSIG 23 + +int raise(int sig); +__sighandler_t signal(int sig, __sighandler_t func); +int kill(pid_t pid, int sig); + +#endif /* _SIGNAL_H */ + diff --git a/Dump/hybos/include/stdarg.h b/Dump/hybos/include/stdarg.h new file mode 100644 index 0000000..ea527d4 --- /dev/null +++ b/Dump/hybos/include/stdarg.h @@ -0,0 +1,35 @@ +#ifndef __TL_STDARG_H +#define __TL_STDARG_H + +#ifdef __cplusplus +extern "C" +{ +#endif + +#include <_va_list.h> + +/* width of stack == width of int */ +#define STACKITEM int + +/* round up width of objects pushed on stack. The expression before the +& ensures that we get 0 for objects of size 0. */ +#define VA_SIZE(TYPE) \ + ((sizeof(TYPE) + sizeof(STACKITEM) - 1) \ + & ~(sizeof(STACKITEM) - 1)) + +/* &(LASTARG) points to the LEFTMOST argument of the function call +(before the ...) */ +#define va_start(AP, LASTARG) \ + (AP=((va_list)&(LASTARG) + VA_SIZE(LASTARG))) + +#define va_end(AP) /* nothing */ + +#define va_arg(AP, TYPE) \ + (AP += VA_SIZE(TYPE), *((TYPE *)(AP - VA_SIZE(TYPE)))) + +#ifdef __cplusplus +} +#endif + +#endif + diff --git a/Dump/hybos/include/stdbool.h b/Dump/hybos/include/stdbool.h new file mode 100644 index 0000000..e3f2b22 --- /dev/null +++ b/Dump/hybos/include/stdbool.h @@ -0,0 +1,6 @@ +#ifndef _STDBOOL_H +#define _STDBOOL_H + +typedef enum {false = 0, true = !0} bool; + +#endif /* !defined(_STDBOOL_H) */ diff --git a/Dump/hybos/include/stddef.h b/Dump/hybos/include/stddef.h new file mode 100644 index 0000000..f1a5135 --- /dev/null +++ b/Dump/hybos/include/stddef.h @@ -0,0 +1,11 @@ +#ifndef _STDDEF_H +#define _STDDEF_H + +#define NULL ((void *)0) + +#ifndef _SIZE_T +#define _SIZE_T +typedef unsigned int size_t; +#endif + +#endif /* _STDDEF_H */ diff --git a/Dump/hybos/include/stdint.h b/Dump/hybos/include/stdint.h new file mode 100644 index 0000000..744183f --- /dev/null +++ b/Dump/hybos/include/stdint.h @@ -0,0 +1,166 @@ +#ifndef _STDINT_H +#define _STDINT_H + +/* 7.18.1.1 Exact-width integer types */ +typedef signed char int8_t; +typedef unsigned char uint8_t; +typedef short int16_t; +typedef unsigned short uint16_t; +typedef int int32_t; +typedef unsigned uint32_t; +typedef long long int64_t; +typedef unsigned long long uint64_t; + +/* 7.18.1.2 Minimum-width integer types */ +typedef signed char int_least8_t; +typedef unsigned char uint_least8_t; +typedef short int_least16_t; +typedef unsigned short uint_least16_t; +typedef int int_least32_t; +typedef unsigned uint_least32_t; +typedef long long int_least64_t; +typedef unsigned long long uint_least64_t; + +/* 7.18.1.3 Fastest minimum-width integer types + * Not actually guaranteed to be fastest for all purposes + * Here we use the exact-width types for 8 and 16-bit ints. + */ +typedef char int_fast8_t; +typedef unsigned char uint_fast8_t; +typedef short int_fast16_t; +typedef unsigned short uint_fast16_t; +typedef int int_fast32_t; +typedef unsigned int uint_fast32_t; +typedef long long int_fast64_t; +typedef unsigned long long uint_fast64_t; + +/* 7.18.1.4 Integer types capable of holding object pointers */ +typedef int intptr_t; +typedef unsigned uintptr_t; + +/* 7.18.1.5 Greatest-width integer types */ +typedef long long intmax_t; +typedef unsigned long long uintmax_t; + +/* 7.18.2 Limits of specified-width integer types */ +#if !defined ( __cplusplus) || defined (__STDC_LIMIT_MACROS) + +/* 7.18.2.1 Limits of exact-width integer types */ +#define INT8_MIN (-128) +#define INT16_MIN (-32768) +#define INT32_MIN (-2147483647 - 1) +#define INT64_MIN (-9223372036854775807LL - 1) + +#define INT8_MAX 127 +#define INT16_MAX 32767 +#define INT32_MAX 2147483647 +#define INT64_MAX 9223372036854775807LL + +#define UINT8_MAX 0xff /* 255U */ +#define UINT16_MAX 0xffff /* 65535U */ +#define UINT32_MAX 0xffffffff /* 4294967295U */ +#define UINT64_MAX 0xffffffffffffffffULL /* 18446744073709551615ULL */ + +/* 7.18.2.2 Limits of minimum-width integer types */ +#define INT_LEAST8_MIN INT8_MIN +#define INT_LEAST16_MIN INT16_MIN +#define INT_LEAST32_MIN INT32_MIN +#define INT_LEAST64_MIN INT64_MIN + +#define INT_LEAST8_MAX INT8_MAX +#define INT_LEAST16_MAX INT16_MAX +#define INT_LEAST32_MAX INT32_MAX +#define INT_LEAST64_MAX INT64_MAX + +#define UINT_LEAST8_MAX UINT8_MAX +#define UINT_LEAST16_MAX UINT16_MAX +#define UINT_LEAST32_MAX UINT32_MAX +#define UINT_LEAST64_MAX UINT64_MAX + +/* 7.18.2.3 Limits of fastest minimum-width integer types */ +#define INT_FAST8_MIN INT8_MIN +#define INT_FAST16_MIN INT16_MIN +#define INT_FAST32_MIN INT32_MIN +#define INT_FAST64_MIN INT64_MIN + +#define INT_FAST8_MAX INT8_MAX +#define INT_FAST16_MAX INT16_MAX +#define INT_FAST32_MAX INT32_MAX +#define INT_FAST64_MAX INT64_MAX + +#define UINT_FAST8_MAX UINT8_MAX +#define UINT_FAST16_MAX UINT16_MAX +#define UINT_FAST32_MAX UINT32_MAX +#define UINT_FAST64_MAX UINT64_MAX + +/* 7.18.2.4 Limits of integer types capable of holding + object pointers */ +#define INTPTR_MIN INT32_MIN +#define INTPTR_MAX INT32_MAX +#define UINTPTR_MAX UINT32_MAX + +/* 7.18.2.5 Limits of greatest-width integer types */ +#define INTMAX_MIN INT64_MIN +#define INTMAX_MAX INT64_MAX +#define UINTMAX_MAX UINT64_MAX + +/* 7.18.3 Limits of other integer types */ +#define PTRDIFF_MIN INT32_MIN +#define PTRDIFF_MAX INT32_MAX + +#define SIG_ATOMIC_MIN INT32_MIN +#define SIG_ATOMIC_MAX INT32_MAX + +#define SIZE_MAX UINT32_MAX + +#ifndef WCHAR_MIN /* also in wchar.h */ +#define WCHAR_MIN 0 +#define WCHAR_MAX ((wchar_t)-1) /* UINT16_MAX */ +#endif + +/* + * wint_t is unsigned short for compatibility with MS runtime + */ +#define WINT_MIN 0 +#define WINT_MAX ((wint_t)-1) /* UINT16_MAX */ + +#endif /* !defined ( __cplusplus) || defined __STDC_LIMIT_MACROS */ + + +/* 7.18.4 Macros for integer constants */ +#if !defined ( __cplusplus) || defined (__STDC_CONSTANT_MACROS) + +/* 7.18.4.1 Macros for minimum-width integer constants + + Accoding to Douglas Gwyn : + "This spec was changed in ISO/IEC 9899:1999 TC1; in ISO/IEC + 9899:1999 as initially published, the expansion was required + to be an integer constant of precisely matching type, which + is impossible to accomplish for the shorter types on most + platforms, because C99 provides no standard way to designate + an integer constant with width less than that of type int. + TC1 changed this to require just an integer constant + *expression* with *promoted* type." + + The trick used here is from Clive D W Feather. +*/ + +#define INT8_C(val) (INT_LEAST8_MAX-INT_LEAST8_MAX+(val)) +#define INT16_C(val) (INT_LEAST16_MAX-INT_LEAST16_MAX+(val)) +#define INT32_C(val) (INT_LEAST32_MAX-INT_LEAST32_MAX+(val)) +/* The 'trick' doesn't work in C89 for long long because, without + suffix, (val) will be evaluated as int, not intmax_t */ +#define INT64_C(val) val##LL + +#define UINT8_C(val) (UINT_LEAST8_MAX-UINT_LEAST8_MAX+(val)) +#define UINT16_C(val) (UINT_LEAST16_MAX-UINT_LEAST16_MAX+(val)) +#define UINT32_C(val) (UINT_LEAST32_MAX-UINT_LEAST32_MAX+(val)) +#define UINT64_C(val) val##ULL + +/* 7.18.4.2 Macros for greatest-width integer constants */ +#define INTMAX_C(val) val##LL +#define UINTMAX_C(val) val##ULL + +#endif /* !defined ( __cplusplus) || defined __STDC_CONSTANT_MACROS */ + +#endif /* !defined(_STDINT_H) */ diff --git a/Dump/hybos/include/stdio.h b/Dump/hybos/include/stdio.h new file mode 100644 index 0000000..12bbb89 --- /dev/null +++ b/Dump/hybos/include/stdio.h @@ -0,0 +1,79 @@ +/** + * stdio.h + * + * Input/output functions + */ + +#ifndef _STDIO_H +#define _STDIO_H + +#define SEEK_SET 0 +#define SEEK_CUR 1 +#define SEEK_END 2 + +#ifndef _NULL +#define NULL ((void *)0) +#endif +#define EOF (-1) + +#define FOPEN_MAX 20 +#define FILENAME_MAX 14 +#define TMP_MAX 999 + +typedef long int fpos_t; + +#ifndef _SIZE_T +#define _SIZE_T +typedef unsigned int size_t; +#endif + +/*int remove(const char *_filename);*/ +/*int rename(const char *_old, const char *_new);*/ +/*FILE *tmpfile(void);*/ +/*char *tmpnam(char *_s);*/ +/*int fclose(FILE *_stream);*/ +/*int fflush(FILE *_stream);*/ +/*FILE *fopen(const char *_filename, const char *_mode);*/ +/*FILE *freopen(const char *_filename, const char *_mode, FILE *_stream);*/ +/*void setbuf(FILE *_stream, char *_buf);*/ +/*int setvbuf(FILE *_stream, char *_buf, int _mode, size_t _size);*/ +/*int fprintf(FILE *_stream, const char *_format, ...);*/ +/*int printf(const char *fmt, ...);*/ +void printf(const char *format, ...); +int sprintf(char *s, const char *format, ...); +/*int vfprintf(FILE *_stream, const char *_format, char *_arg);*/ +/*int vprintf(const char *_format, char *_arg);*/ +int vsprintf(char *s, const char *format, ...); +/*int fscanf(FILE *_stream, const char *_format, ...);*/ +/*int scanf(const char *_format, ...);*/ +/*int sscanf(const char *_s, const char *_format, ...);*/ +/*#define vfscanf _doscan*/ +/*int vfscanf(FILE *_stream, const char *_format, char *_arg);*/ +/*int vscanf(const char *_format, char *_arg);*/ +/*int vsscanf(const char *_s, const char *_format, char *_arg);*/ +/*int fgetc(FILE *_stream);*/ +/*char *fgets(char *_s, int _n, FILE *_stream);*/ +/*int fputc(int _c, FILE *_stream);*/ +/*int fputs(const char *_s, FILE *_stream);*/ +/*int getc(FILE *_stream);*/ +/*int getchar(void);*/ +/*char *gets(char *_s);*/ +/*int putc(int _c, FILE *_stream);*/ +/*int putchar(int _c);*/ +/*int puts(const char *_s);*/ +/*int ungetc(int _c, FILE *_stream);*/ +/*size_t fread(void *_ptr, size_t _size, size_t _nmemb, FILE *_stream);*/ +/*size_t fwrite(const void *_ptr, size_t _size, size_t _nmemb, FILE *_stream);*/ +/*int fgetpos(FILE *_stream, fpos_t *_pos);*/ +/*int fseek(FILE *_stream, long _offset, int _whence);*/ +/*int fsetpos(FILE *_stream, fpos_t *_pos);*/ +/*long ftell(FILE *_stream);*/ +/*void rewind(FILE *_stream);*/ +/*void clearerr(FILE *_stream);*/ +/*int feof(FILE *_stream);*/ +/*int ferror(FILE *_stream);*/ +/*void perror(const char *_s);*/ +/*int __fillbuf(FILE *_stream);*/ +/*int __flushbuf(int _c, FILE *_stream);*/ + +#endif /* _STDIO_H */ diff --git a/Dump/hybos/include/stdlib.h b/Dump/hybos/include/stdlib.h new file mode 100644 index 0000000..477873e --- /dev/null +++ b/Dump/hybos/include/stdlib.h @@ -0,0 +1,58 @@ +/** + * stdlib.h + * + * Defines certain common macros, types, and functions + */ + +#ifndef _STDLIB_H +#define _STDLIB_H + +#ifndef _NULL +#define NULL ((void *)0) +#endif + +#define EXIT_FAILURE 1 /* standard error returned from exit() */ +#define EXIT_SUCCESS 0 /* successfull return from exit() */ +#define RAND_MAX 32767 /* largest value generated by rand() */ +#define MB_CUR_MAX 1 /* maximum value of multibyte character */ + +#ifndef _SIZE_T +#define _SIZE_T +typedef unsigned int size_t; +#endif + +#ifndef _WCHAR_T +#define _WCHAR_T +typedef char wchar_t; +#endif + +/*void abort(void);*/ +int abs(int number); +/*int atexit(void (*_func)(void));*/ +/*double atof(const char *_nptr);*/ +int atoi(const char *nptr); +/*long atol(const char *_nptr);*/ +/*void *calloc(size_t _nmemb, size_t _size);*/ +/*div_t div(int _numer, int _denom);*/ +/*void exit(int _status);*/ +void free(void *blk); +/*char *getenv(const char *_name);*/ +/*long labs(long _j);*/ +/*ldiv_t ldiv(long _numer, long _denom);*/ +void *malloc(size_t _size); +/*int mblen(const char *_s, size_t _n);*/ +/*size_t mbstowcs(wchar_t *_pwcs, const char *_s, size_t _n);*/ +/*int mbtowc(wchar_t *_pwc, const char *_s, size_t _n);*/ +void *realloc(void *blk, size_t size); +/*double strtod(const char *_nptr, char **_endptr);*/ +/*long strtol(const char *_nptr, char **_endptr, int _base);*/ +/*int system(const char *_string);*/ +/*size_t wcstombs(char *_s, const wchar_t *_pwcs, size_t _n);*/ +/*int wctomb(char *_s, wchar_t _wchar);*/ +/*void *bsearch(const void *_key, const void *_base, size_t _nmemb, size_t _size, int (*compar) (const void *, const void *));*/ +/*void qsort(void *_base, size_t _nmemb, size_t _size, int (*compar) (const void *, const void *));*/ +int rand(void); +void srand(unsigned int seed); +/*unsigned long int strtoul(const char *_nptr, char **_endptr, int _base);*/ + +#endif /* _STDLIB_H */ diff --git a/Dump/hybos/include/string.h b/Dump/hybos/include/string.h new file mode 100644 index 0000000..8fa2767 --- /dev/null +++ b/Dump/hybos/include/string.h @@ -0,0 +1,26 @@ +#ifndef __TL_STRING_H +#define __TL_STRING_H + +#ifdef __cplusplus +extern "C" +{ +#endif + +/*#include <_size_t.h>*/ +/*#include <_null.h>*/ +#include + +void *memcpy(void *dst_ptr, const void *src_ptr, size_t count); +void *memsetw(void *dst, int val, size_t count); +size_t strlen(const char *str); +int strcmp(const char * src, const char * dst); +int strncmp(const char * first, const char * last, size_t count); +char *strcpy(char *s, const char *t); +char *strncpy(char * dest, const char * source, size_t count); + +#ifdef __cplusplus +} +#endif + +#endif + diff --git a/Dump/hybos/include/sys/dir.h b/Dump/hybos/include/sys/dir.h new file mode 100644 index 0000000..114d2bf --- /dev/null +++ b/Dump/hybos/include/sys/dir.h @@ -0,0 +1,19 @@ +#ifndef _DIR_H +#define _DIR_H + +/** + * Size of directory block + */ +#define DIRBLKSIZE 512 + +#ifndef DIRSIZ +#define DIRSIZ 14 +#endif + +typedef struct __DIR__DIRECT_ +{ + unsigned int d_ino; /* defined as __kernel_ino_t in posix_types.h */ + char d_name[DIRSIZ]; +} direct; + +#endif /* _DIR_H */ diff --git a/Dump/hybos/include/time.h b/Dump/hybos/include/time.h new file mode 100644 index 0000000..96b5c37 --- /dev/null +++ b/Dump/hybos/include/time.h @@ -0,0 +1,52 @@ +/** + * time.h + */ + +#ifndef _TIME_H +#define _TIME_H + +#define CLOCKS_PER_SEC 60 /* 60 Hz */ + +#ifndef NULL +#define NULL ((void *) 0) +#endif + +#ifndef _SIZE_T +#define _SIZE_T +typedef unsigned int size_t; +#endif + +#ifndef _TIME_T +#define _TIME_T +typedef long time_t; /* time in seconds since January 1, 1970 0000 GMT */ +#endif + +#ifndef _CLOCK_T +#define _CLOCK_T +typedef long clock_t; /* time in ticks since process started */ +#endif + +typedef struct __TIME_H_TIME +{ + int tm_sec; /* seconds after the minute [0, 59] */ + int tm_min; /* minutes after the hour [0, 59] */ + int tm_hour; /* hours since midnight [0, 23] */ + int tm_mday; /* day of the month [1, 31] */ + int tm_mon; /* months since January [0, 11] */ + int tm_year; /* years since 1900 */ + int tm_wday; /* days since Sunday [0, 6] */ + int tm_yday; /* days since January 1 [0, 365] */ + int tm_isdst; /* Daylight Saving Time flag */ +} dm, TIME; + +clock_t clock(void); +double difftime(time_t time1, time_t time0); +time_t mktime(struct tm *pTime); +time_t time(time_t *pTime); +char *asctime(const struct tm *pTime); +char *ctime(const time_t *pTimer); +struct tm *gmtime(const time_t *pTimer); +size_t strftime(char *s, size_t max, const char *format, const struct tm *pTime); + +#endif /* _TIME_H */ + diff --git a/Dump/hybos/include/x86.h b/Dump/hybos/include/x86.h new file mode 100644 index 0000000..bb68769 --- /dev/null +++ b/Dump/hybos/include/x86.h @@ -0,0 +1,26 @@ +#ifndef __TL_X86_H +#define __TL_X86_H + +#ifdef __cplusplus +extern "C" +{ +#endif + +/** + * 16 bit MSB: segment, 16 bit LSB: offset + */ +//typedef unsigned farptr; + +unsigned inportb(unsigned short port); +void outportb(unsigned port, unsigned val); +unsigned inportw(unsigned short port); +void outportw(unsigned port, unsigned val); +unsigned disable(void); +void enable(void); + +#ifdef __cplusplus +} +#endif + +#endif + diff --git a/Dump/hybos/lib/Makefile b/Dump/hybos/lib/Makefile new file mode 100644 index 0000000..0b91a38 --- /dev/null +++ b/Dump/hybos/lib/Makefile @@ -0,0 +1,33 @@ +#MAKEFILE=ming.mak +MAKEFILE =Makefile + +OBJS =objects/*.o + +all: + make -f $(MAKEFILE) -C char + make -f $(MAKEFILE) -C config + make -f $(MAKEFILE) -C convert + make -f $(MAKEFILE) -C ctype + make -f $(MAKEFILE) -C math + make -f $(MAKEFILE) -C mem + make -f $(MAKEFILE) -C setjmp + make -f $(MAKEFILE) -C stdio + make -f $(MAKEFILE) -C string + make -f $(MAKEFILE) -C util + make -f $(MAKEFILE) -C x86 + ar rcs libc.a $(OBJS) + +clean: + make -f $(MAKEFILE) -C char clean + make -f $(MAKEFILE) -C config clean + make -f $(MAKEFILE) -C convert clean + make -f $(MAKEFILE) -C ctype clean + make -f $(MAKEFILE) -C math clean + make -f $(MAKEFILE) -C mem clean + make -f $(MAKEFILE) -C setjmp clean + make -f $(MAKEFILE) -C stdio clean + make -f $(MAKEFILE) -C string clean + make -f $(MAKEFILE) -C util clean + make -f $(MAKEFILE) -C x86 clean + del libc.a + diff --git a/Dump/hybos/lib/char/Makefile b/Dump/hybos/lib/char/Makefile new file mode 100644 index 0000000..654c46f --- /dev/null +++ b/Dump/hybos/lib/char/Makefile @@ -0,0 +1,71 @@ +.SUFFIXES: .asm + +# defines +MAKEFILE =Makefile +MAKEDEP =$(MAKEFILE) +INCDIR =../../include +NASM =nasm -f win32 -dUNDERBARS=1 -i$(INCDIR)/ +CC =gcc -g -Wall -W -O2 -nostdinc -fno-builtin -I$(INCDIR) + +CHAR =isalnum.o \ + isalpha.o \ + isascii.o \ + iscsym.o \ + iscsymf.o \ + isctrl.o \ + isdigit.o \ + isgraph.o \ + islower.o \ + isprint.o \ + ispunct.o \ + isspace.o \ + isupper.o \ + isxdigit.o + +# This will be one level above where we are now +OBJ_DIR =objects + +OBJS =$(CHAR) + +# targets +all: $(OBJS) $(MAKEDEP) + +clean: + del ..\$(OBJ_DIR)\isalnum.o + del ..\$(OBJ_DIR)\isalpha.o + del ..\$(OBJ_DIR)\isascii.o + del ..\$(OBJ_DIR)\iscsym.o + del ..\$(OBJ_DIR)\iscsymf.o + del ..\$(OBJ_DIR)\isctrl.o + del ..\$(OBJ_DIR)\isdigit.o + del ..\$(OBJ_DIR)\isgraph.o + del ..\$(OBJ_DIR)\islower.o + del ..\$(OBJ_DIR)\isprint.o + del ..\$(OBJ_DIR)\ispunct.o + del ..\$(OBJ_DIR)\isspace.o + del ..\$(OBJ_DIR)\isupper.o + del ..\$(OBJ_DIR)\isxdigit.o + +# implicit rules +.asm.o: + $(NASM) -o../$(OBJ_DIR)/$@ $< + +.c.o: + $(CC) -c -o../$(OBJ_DIR)/$@ $< + +# dependencies +isalnum.o: isalnum.c $(MAKEDEP) +isalpha.o: isalpha.c $(MAKEDEP) +isascii.o: isascii.c $(MAKEDEP) +iscsym.o: iscsym.c $(MAKEDEP) +iscsymf.o: iscsymf.c $(MAKEDEP) +isctrl.o: isctrl.c $(MAKEDEP) +isdigit.o: isdigit.c $(MAKEDEP) +isgraph.o: isgraph.c $(MAKEDEP) +islower.o: islower.c $(MAKEDEP) +isprint.o: isprint.c $(MAKEDEP) +ispunct.o: ispunct.c $(MAKEDEP) +isspace.o: isspace.c $(MAKEDEP) +isupper.o: isupper.c $(MAKEDEP) +isxdigit.o: isxdigit.c $(MAKEDEP) + diff --git a/Dump/hybos/lib/char/isalnum.c b/Dump/hybos/lib/char/isalnum.c new file mode 100644 index 0000000..26b2a3a --- /dev/null +++ b/Dump/hybos/lib/char/isalnum.c @@ -0,0 +1,6 @@ +#include + +bool isalnum(const char c) +{ + return ((c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z') || (c >= '1' && c <= '9')); +} diff --git a/Dump/hybos/lib/char/isalpha.c b/Dump/hybos/lib/char/isalpha.c new file mode 100644 index 0000000..6392de1 --- /dev/null +++ b/Dump/hybos/lib/char/isalpha.c @@ -0,0 +1,6 @@ +#include + +bool isalpha(const char c) +{ + return ((c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z')); +} diff --git a/Dump/hybos/lib/char/isascii.c b/Dump/hybos/lib/char/isascii.c new file mode 100644 index 0000000..4ddcaee --- /dev/null +++ b/Dump/hybos/lib/char/isascii.c @@ -0,0 +1,6 @@ +#include + +bool isascii(const unsigned char c) +{ + return (c >= 0x00 && c <= 0x7F); +} diff --git a/Dump/hybos/lib/char/iscsym.c b/Dump/hybos/lib/char/iscsym.c new file mode 100644 index 0000000..575bb19 --- /dev/null +++ b/Dump/hybos/lib/char/iscsym.c @@ -0,0 +1,6 @@ +#include + +bool iscsym(const char c) +{ + return ((c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z') || (c >= '0' && c <= '9') || (c == '_')); +} diff --git a/Dump/hybos/lib/char/iscsymf.c b/Dump/hybos/lib/char/iscsymf.c new file mode 100644 index 0000000..c735f71 --- /dev/null +++ b/Dump/hybos/lib/char/iscsymf.c @@ -0,0 +1,6 @@ +#include + +bool iscsymf(const char c) +{ + return ((c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z') || (c == '_')); +} diff --git a/Dump/hybos/lib/char/isctrl.c b/Dump/hybos/lib/char/isctrl.c new file mode 100644 index 0000000..894df6d --- /dev/null +++ b/Dump/hybos/lib/char/isctrl.c @@ -0,0 +1,6 @@ +#include + +bool isctrl(const char c) +{ + return (!(c >= ' ' && c <= '~')); +} diff --git a/Dump/hybos/lib/char/isdigit.c b/Dump/hybos/lib/char/isdigit.c new file mode 100644 index 0000000..6eebe23 --- /dev/null +++ b/Dump/hybos/lib/char/isdigit.c @@ -0,0 +1,6 @@ +#include + +bool isdigit(const char c) +{ + return (c >= '0' && c <= '9'); +} diff --git a/Dump/hybos/lib/char/isgraph.c b/Dump/hybos/lib/char/isgraph.c new file mode 100644 index 0000000..f8103ca --- /dev/null +++ b/Dump/hybos/lib/char/isgraph.c @@ -0,0 +1,6 @@ +#include + +bool isgraph(const unsigned char c) +{ + return (!(c >= 0x00 && c <= 0x7F)); +} diff --git a/Dump/hybos/lib/char/islower.c b/Dump/hybos/lib/char/islower.c new file mode 100644 index 0000000..5e60bfc --- /dev/null +++ b/Dump/hybos/lib/char/islower.c @@ -0,0 +1,6 @@ +#include + +bool islowwer(const char c) +{ + return (c >= 'a' && c <= 'z'); +} diff --git a/Dump/hybos/lib/char/isprint.c b/Dump/hybos/lib/char/isprint.c new file mode 100644 index 0000000..96f5caf --- /dev/null +++ b/Dump/hybos/lib/char/isprint.c @@ -0,0 +1,6 @@ +#include + +bool isprint(const char c) +{ + return (c >= ' ' && c <= '~'); +} diff --git a/Dump/hybos/lib/char/ispunct.c b/Dump/hybos/lib/char/ispunct.c new file mode 100644 index 0000000..72b4d4d --- /dev/null +++ b/Dump/hybos/lib/char/ispunct.c @@ -0,0 +1,6 @@ +#include + +bool ispunct(const char c) +{ + return ((c >= '!' && c<= '/') || (c >= ':' && c<= '@') || (c >= '[' && c<= '`') || (c >= '{' && c<= '~')); +} diff --git a/Dump/hybos/lib/char/isspace.c b/Dump/hybos/lib/char/isspace.c new file mode 100644 index 0000000..29c6139 --- /dev/null +++ b/Dump/hybos/lib/char/isspace.c @@ -0,0 +1,6 @@ +#include + +bool isspace(const char c) +{ + return (c == ' ' || (c >= 0x09 && c <= 0x0D)); +} diff --git a/Dump/hybos/lib/char/isupper.c b/Dump/hybos/lib/char/isupper.c new file mode 100644 index 0000000..e54a05c --- /dev/null +++ b/Dump/hybos/lib/char/isupper.c @@ -0,0 +1,6 @@ +#include + +bool isupper(const char c) +{ + return (c >= 'A' && c <= 'Z'); +} diff --git a/Dump/hybos/lib/char/isxdigit.c b/Dump/hybos/lib/char/isxdigit.c new file mode 100644 index 0000000..b67e005 --- /dev/null +++ b/Dump/hybos/lib/char/isxdigit.c @@ -0,0 +1,6 @@ +#include + +bool isxdigit(const char c) +{ + return ((c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F')); +} diff --git a/Dump/hybos/lib/config/Makefile b/Dump/hybos/lib/config/Makefile new file mode 100644 index 0000000..2bd4b3d --- /dev/null +++ b/Dump/hybos/lib/config/Makefile @@ -0,0 +1,32 @@ +.SUFFIXES: .asm + +# defines +MAKEFILE =Makefile +MAKEDEP =$(MAKEFILE) +INCDIR =../../include +NASM =nasm -f win32 -dUNDERBARS=1 -i$(INCDIR)/ +CC =gcc -g -Wall -W -O2 -nostdinc -fno-builtin -I$(INCDIR) + +CONFIG =config.o + +# This will be one level above where we are now +OBJ_DIR =objects + +OBJS =$(CONFIG) + +# targets +all: $(OBJS) $(MAKEDEP) + +clean: + del ..\$(OBJ_DIR)\config.o + +# implicit rules +.asm.o: + $(NASM) -o../$(OBJ_DIR)/$@ $< + +.c.o: + $(CC) -c -o../$(OBJ_DIR)/$@ $< + +# dependencies +config.o: config.c $(MAKEDEP) + diff --git a/Dump/hybos/lib/config/config.c b/Dump/hybos/lib/config/config.c new file mode 100644 index 0000000..3a46d5b --- /dev/null +++ b/Dump/hybos/lib/config/config.c @@ -0,0 +1,36 @@ +/** + * Compiler configuration + */ + +#ifdef __GNUC__ +#define COMPILER "GNU C Compiler " __VERSION__ +typedef enum {false = 0, true = !0} bool; +typedef unsigned size_t; +typedef signed char __int8; +typedef signed short int __int16; +typedef signed int __int32; +typedef signed long long int __int64; + +#define int8 __int8 +#define int16 __int16 +#define int32 __int32 +#define int64 __int64 + +typedef unsigned char uint8; +typedef unsigned short int uint16; +typedef unsigned int uint32; +typedef unsigned long long int uint64; + +#define uint8 __uint8 +#define uint16 __uint16 +#define uint32 __uint32 +#define uint64 __uint64 + +/*typedef void* pointer;*/ +/*typedef unsigned char string;*/ + +#define discardable +#else +#error "Compiler not supported" +#endif /* __GNUC__ */ + diff --git a/Dump/hybos/lib/convert/Makefile b/Dump/hybos/lib/convert/Makefile new file mode 100644 index 0000000..a2a4409 --- /dev/null +++ b/Dump/hybos/lib/convert/Makefile @@ -0,0 +1,56 @@ +.SUFFIXES: .asm + +# defines +MAKEFILE =Makefile +MAKEDEP =$(MAKEFILE) +INCDIR =../../include +NASM =nasm -f win32 -dUNDERBARS=1 -i$(INCDIR)/ +CC =gcc -g -Wall -W -O2 -nostdinc -fno-builtin -I$(INCDIR) + +CONVERT =atoi16.o \ + atoi32.o \ + atoi64.o \ + atoi.o \ + i16toa.o \ + i32toa.o \ + i64toa.o \ + itoa.o + +# This will be one level above where we are now +OBJ_DIR =objects + +OBJS =$(CONVERT) + +# targets +all: $(OBJS) $(MAKEDEP) + +clean: + del ..\$(OBJ_DIR)\atoi16.o + del ..\$(OBJ_DIR)\atoi32.o + del ..\$(OBJ_DIR)\atoi64.o + del ..\$(OBJ_DIR)\atoi.o + del ..\$(OBJ_DIR)\i16toa.o + del ..\$(OBJ_DIR)\i32toa.o + del ..\$(OBJ_DIR)\i64toa.o + del ..\$(OBJ_DIR)\itoa.o + +# implicit rules +.asm.o: + $(NASM) -o../$(OBJ_DIR)/$@ $< + +.c.o: + $(CC) -c -o../$(OBJ_DIR)/$@ $< + +# dependencies +atoi.o: atoi.c $(MAKEDEP) +itoa.o: itoa.c $(MAKEDEP) +atoi16.o: atoi16.c $(MAKEDEP) +atoi32.o: atoi32.c $(MAKEDEP) +atoi64.o: atoi64.c $(MAKEDEP) +i16toa.o: i16toa.c $(MAKEDEP) +i32toa.o: i32toa.c $(MAKEDEP) +i64toa.o: i64toa.c $(MAKEDEP) +u16toa.o: u16toa.c $(MAKEDEP) +u32toa.o: u32toa.c $(MAKEDEP) +u64toa.o: u64toa.c $(MAKEDEP) + diff --git a/Dump/hybos/lib/convert/atoi.c b/Dump/hybos/lib/convert/atoi.c new file mode 100644 index 0000000..5a0ae8f --- /dev/null +++ b/Dump/hybos/lib/convert/atoi.c @@ -0,0 +1,33 @@ +#include + +long atoi(const char *nptr) +{ + int c; /* current char */ + long total; /* current total */ + int sign; /* if '-', then negative, otherwise positive */ + + /* skip whitespace */ + while(isspace((int)(unsigned char)*nptr)) + ++nptr; + + c = (int)(unsigned char)*nptr++; + sign = c; /* save sign indication */ + + /* skip sign */ + if(c == '-' || c == '+') + c = (int)(unsigned char)*nptr++; + + total = 0; + + while(isdigit(c)) + { + total = 10 * total + (c - '0'); /* accumulate digit */ + c = (int)(unsigned char)*nptr++; /* get next char */ + } + + /* return result, negated if necessary */ + if(sign == '-') + return -total; + else + return total; +} diff --git a/Dump/hybos/lib/convert/atoi16.c b/Dump/hybos/lib/convert/atoi16.c new file mode 100644 index 0000000..d3f5a12 --- /dev/null +++ b/Dump/hybos/lib/convert/atoi16.c @@ -0,0 +1 @@ + diff --git a/Dump/hybos/lib/convert/atoi32.c b/Dump/hybos/lib/convert/atoi32.c new file mode 100644 index 0000000..d3f5a12 --- /dev/null +++ b/Dump/hybos/lib/convert/atoi32.c @@ -0,0 +1 @@ + diff --git a/Dump/hybos/lib/convert/atoi64.c b/Dump/hybos/lib/convert/atoi64.c new file mode 100644 index 0000000..d3f5a12 --- /dev/null +++ b/Dump/hybos/lib/convert/atoi64.c @@ -0,0 +1 @@ + diff --git a/Dump/hybos/lib/convert/i16toa.c b/Dump/hybos/lib/convert/i16toa.c new file mode 100644 index 0000000..ed88e45 --- /dev/null +++ b/Dump/hybos/lib/convert/i16toa.c @@ -0,0 +1,39 @@ +#include + +void i16toa(int16_t value, char *string, uint8_t radix) +{ + char *i, *s, t, d; + + i = string; + + if(value < 0) + { + *i++ = '-'; + value = -value; + } + + s = i; + + do + { + d = value % radix; + value /= radix; + + if(d > 9) + *i++ = d + 'A' - 10; + else + *i++ = d + '0'; + } while (value > 0); + + *i-- = '\0'; + + do + { + t = *i; + *i = *s; + *s = t; + + --i; + ++s; + } while (s < i); +} diff --git a/Dump/hybos/lib/convert/i32toa.c b/Dump/hybos/lib/convert/i32toa.c new file mode 100644 index 0000000..c8115ea --- /dev/null +++ b/Dump/hybos/lib/convert/i32toa.c @@ -0,0 +1,39 @@ +#include + +void i32toa(int32_t value, char *string, uint8_t radix) +{ + char *i, *s, t, d; + + i = string; + + if(value < 0) + { + *i++ = '-'; + value = -value; + } + + s = i; + + do + { + d = value % radix; + value /= radix; + + if (d > 9) + *i++ = d + 'A' - 10; + else + *i++ = d + '0'; + } while (value > 0); + + *i-- = '\0'; + + do + { + t = *i; + *i = *s; + *s = t; + + --i; + ++s; + } while (s < i); +} diff --git a/Dump/hybos/lib/convert/i64toa.c b/Dump/hybos/lib/convert/i64toa.c new file mode 100644 index 0000000..e75aa87 --- /dev/null +++ b/Dump/hybos/lib/convert/i64toa.c @@ -0,0 +1,39 @@ +#include + +void i64toa(int64_t value, char *string, uint8_t radix) +{ + char *i, *s, t, d; + + i = string; + + if(value < 0) + { + *i++ = '-'; + value = -value; + } + + s = i; + + do + { + d = value % radix; + value /= radix; + + if(d > 9) + *i++ = d + 'A' - 10; + else + *i++ = d + '0'; + } while (value > 0); + + *i-- = '\0'; + + do + { + t = *i; + *i = *s; + *s = t; + + --i; + ++s; + } while (s < i); +} diff --git a/Dump/hybos/lib/convert/itoa.c b/Dump/hybos/lib/convert/itoa.c new file mode 100644 index 0000000..3fc6ce7 --- /dev/null +++ b/Dump/hybos/lib/convert/itoa.c @@ -0,0 +1,104 @@ +/*** +*xtoa.c - convert integers/longs to ASCII string +* +* Copyright (c) 1989-1997, Microsoft Corporation. All rights reserved. +* +*Purpose: +* The module has code to convert integers/longs to ASCII strings. See +* +*******************************************************************************/ + + +/*** +*char *_itoa, *_ltoa, *_ultoa(val, buf, radix) - convert binary int to ASCII +* string +* +*Purpose: +* Converts an int to a character string. +* +*Entry: +* val - number to be converted (int, long or unsigned long) +* int radix - base to convert into +* char *buf - ptr to buffer to place result +* +*Exit: +* fills in space pointed to by buf with string result +* returns a pointer to this buffer +* +*Exceptions: +* +*******************************************************************************/ + +/* helper routine that does the main job. */ + +static void xtoa(unsigned long val, char *buf, unsigned radix, int is_neg) +{ + char *p; /* pointer to traverse string */ + char *firstdig; /* pointer to first digit */ + char temp; /* temp char */ + unsigned digval; /* value of digit */ + + p = buf; + + if(is_neg) + { + /* negative, so output '-' and negate */ + *p++ = '-'; + val = (unsigned long)(-(long)val); + } + + firstdig = p; /* save pointer to first digit */ + + do + { + digval = (unsigned) (val % radix); + val /= radix; /* get next digit */ + + /* convert to ascii and store */ + if (digval > 9) + *p++ = (char) (digval - 10 + 'a'); /* a letter */ + else + *p++ = (char) (digval + '0'); /* a digit */ + } while (val > 0); + + /** + * We now have the digit of the number in the buffer, but in reverse + * order. Thus we reverse them now. + */ + + *p-- = '\0'; /* terminate string; p points to last digit */ + + do + { + temp = *p; + *p = *firstdig; + *firstdig = temp; /* swap *p and *firstdig */ + --p; + ++firstdig; /* advance to next two digits */ + } while (firstdig < p); /* repeat until halfway */ +} + +/** + * Actual functions just call conversion helper with neg flag set correctly, + * and return pointer to buffer. + */ +char * _itoa(int val, char *buf, int radix) +{ + if(radix == 10 && val < 0) + xtoa((unsigned long)val, buf, radix, 1); + else + xtoa((unsigned long)(unsigned int)val, buf, radix, 0); + return buf; +} + +char * _ltoa(long val, char *buf, int radix) +{ + xtoa((unsigned long)val, buf, radix, (radix == 10 && val < 0)); + return buf; +} + +char * _ultoa(unsigned long val, char *buf, int radix) +{ + xtoa(val, buf, radix, 0); + return buf; +} diff --git a/Dump/hybos/lib/convert/u16toa.c b/Dump/hybos/lib/convert/u16toa.c new file mode 100644 index 0000000..4998340 --- /dev/null +++ b/Dump/hybos/lib/convert/u16toa.c @@ -0,0 +1,29 @@ +void u16toa(unt16 value, char *string, unt8 radix) +{ + char *i, *s, t, d; + + s = i = string; + + do + { + d = value % radix; + value /= radix; + + if(d > 9) + *i++ = d + 'A' - 10; + else + *i++ = d + '0'; + } while (value > 0); + + *i-- = '\0'; + + do + { + t = *i; + *i = *s; + *s = t; + + --i; + ++s; + } while (s < i); +} diff --git a/Dump/hybos/lib/convert/u32toa.c b/Dump/hybos/lib/convert/u32toa.c new file mode 100644 index 0000000..3145cd8 --- /dev/null +++ b/Dump/hybos/lib/convert/u32toa.c @@ -0,0 +1,29 @@ +void u32toa(unt32 value, char *string, unt8 radix) +{ + char *i, *s, t, d; + + s = i = string; + + do + { + d = value % radix; + value /= radix; + + if(d > 9) + *i++ = d + 'A' - 10; + else + *i++ = d + '0'; + } while (value > 0); + + *i-- = '\0'; + + do + { + t = *i; + *i = *s; + *s = t; + + --i; + ++s; + } while (s < i); +} diff --git a/Dump/hybos/lib/convert/u64toa.c b/Dump/hybos/lib/convert/u64toa.c new file mode 100644 index 0000000..9ec5fa1 --- /dev/null +++ b/Dump/hybos/lib/convert/u64toa.c @@ -0,0 +1,29 @@ +void u64toa(unt64 value, char *string, unt8 radix) +{ + char *i, *s, t, d; + + s = i = string; + + do + { + d = value % radix; + value /= radix; + + if(d > 9) + *i++ = d + 'A' - 10; + else + *i++ = d + '0'; + } while (value > 0); + + *i-- = '\0'; + + do + { + t = *i; + *i = *s; + *s = t; + + --i; + ++s; + } while (s < i); +} diff --git a/Dump/hybos/lib/ctype/Makefile b/Dump/hybos/lib/ctype/Makefile new file mode 100644 index 0000000..5f7fddd --- /dev/null +++ b/Dump/hybos/lib/ctype/Makefile @@ -0,0 +1,32 @@ +.SUFFIXES: .asm + +# defines +MAKEFILE =Makefile +MAKEDEP =$(MAKEFILE) +INCDIR =../../include +NASM =nasm -f win32 -dUNDERBARS=1 -i$(INCDIR)/ +CC =gcc -g -Wall -W -O2 -nostdinc -fno-builtin -I$(INCDIR) + +CTYPE =ctype.o + +# This will be one level above where we are now +OBJ_DIR =objects + +OBJS =$(CTYPE) + +# targets +all: $(OBJS) $(MAKEDEP) + +clean: + del ..\$(OBJ_DIR)\ctype.o + +# implicit rules +.asm.o: + $(NASM) -o../$(OBJ_DIR)/$@ $< + +.c.o: + $(CC) -c -o../$(OBJ_DIR)/$@ $< + +# dependencies +ctype.o: ctype.c $(MAKEDEP) + diff --git a/Dump/hybos/lib/ctype/ctype.c b/Dump/hybos/lib/ctype/ctype.c new file mode 100644 index 0000000..acf64e3 --- /dev/null +++ b/Dump/hybos/lib/ctype/ctype.c @@ -0,0 +1,46 @@ +#include + +char _ctype[] = +{ + 0x00, +/* 0 */ CT_CTL, CT_CTL, CT_CTL, CT_CTL, + CT_CTL, CT_CTL, CT_CTL, CT_CTL, +/* 8 */ CT_CTL, CT_CTL | CT_WHT, CT_CTL | CT_WHT, CT_CTL | CT_WHT, + CT_CTL | CT_WHT, CT_CTL | CT_WHT, CT_CTL, CT_CTL, +/* 16 */CT_CTL, CT_CTL, CT_CTL, CT_CTL, + CT_CTL, CT_CTL, CT_CTL, CT_CTL, +/* 24 */CT_CTL, CT_CTL, CT_CTL, CT_CTL, + CT_CTL, CT_CTL, CT_CTL, CT_CTL, +/* ' ' */CT_WHT | CT_SP, CT_PUN, CT_PUN, CT_PUN, + CT_PUN, CT_PUN, CT_PUN, CT_PUN, +/* '(' */CT_PUN, CT_PUN, CT_PUN, CT_PUN, + CT_PUN, CT_PUN, CT_PUN, CT_PUN, +/* '0' */CT_DIG, CT_DIG, CT_DIG, CT_DIG, + CT_DIG, CT_DIG, CT_DIG, CT_DIG, +/* '8' */CT_DIG, CT_DIG, CT_PUN, CT_PUN, + CT_PUN, CT_PUN, CT_PUN, CT_PUN, +/* '@' */CT_PUN, CT_UP | CT_HEX, CT_UP | CT_HEX, CT_UP | CT_HEX, + CT_UP | CT_HEX, CT_UP | CT_HEX, CT_UP | CT_HEX, CT_UP, +/* 'H' */CT_UP, CT_UP, CT_UP, CT_UP, + CT_UP, CT_UP, CT_UP, CT_UP, +/* 'P' */CT_UP, CT_UP, CT_UP, CT_UP, + CT_UP, CT_UP, CT_UP, CT_UP, +/* 'X' */CT_UP, CT_UP, CT_UP, CT_PUN, + CT_PUN, CT_PUN, CT_PUN, CT_PUN, +/* '`' */CT_PUN, CT_LOW | CT_HEX, CT_LOW | CT_HEX, CT_LOW | CT_HEX, + CT_LOW | CT_HEX, CT_LOW | CT_HEX, CT_LOW | CT_HEX, CT_LOW, +/* h' */CT_LOW, CT_LOW, CT_LOW, CT_LOW, + CT_LOW, CT_LOW, CT_LOW, CT_LOW, +/* 'p' */CT_LOW, CT_LOW, CT_LOW, CT_LOW, + CT_LOW, CT_LOW, CT_LOW, CT_LOW, +/* 'x' */CT_LOW, CT_LOW, CT_LOW, CT_PUN, + CT_PUN, CT_PUN, CT_PUN, CT_CTL, +/* 128 */0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +/* 144 */0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +/* 160 */0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +/* 176 */0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +/* 192 */0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +/* 208 */0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +/* 224 */0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +/* 240 */0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +}; diff --git a/Dump/hybos/lib/libc.a b/Dump/hybos/lib/libc.a new file mode 100644 index 0000000..68b8fcb --- /dev/null +++ b/Dump/hybos/lib/libc.a Binary files differ diff --git a/Dump/hybos/lib/math/Makefile b/Dump/hybos/lib/math/Makefile new file mode 100644 index 0000000..9e7bf8e --- /dev/null +++ b/Dump/hybos/lib/math/Makefile @@ -0,0 +1,44 @@ +.SUFFIXES: .asm + +# defines +MAKEFILE =Makefile +MAKEDEP =$(MAKEFILE) +INCDIR =../../include +NASM =nasm -f win32 -dUNDERBARS=1 -i$(INCDIR)/ +CC =gcc -g -Wall -W -O2 -nostdinc -fno-builtin -I$(INCDIR) + +MATH =abs.o \ + max.o \ + min.o \ + rotl.o \ + rotr.o + +# This will be one level above where we are now +OBJ_DIR =objects + +OBJS =$(MATH) + +# targets +all: $(OBJS) $(MAKEDEP) + +clean: + del ..\$(OBJ_DIR)\abs.o + del ..\$(OBJ_DIR)\max.o + del ..\$(OBJ_DIR)\min.o + del ..\$(OBJ_DIR)\rotl.o + del ..\$(OBJ_DIR)\rotr.o + +# implicit rules +.asm.o: + $(NASM) -o../$(OBJ_DIR)/$@ $< + +.c.o: + $(CC) -c -o../$(OBJ_DIR)/$@ $< + +# dependencies +abs.o: abs.c $(MAKEDEP) +max.o: max.c $(MAKEDEP) +min.o: min.c $(MAKEDEP) +rotl.o: rotl.c $(MAKEDEP) +rotr.o: rotr.c $(MAKEDEP) + diff --git a/Dump/hybos/lib/math/abs.c b/Dump/hybos/lib/math/abs.c new file mode 100644 index 0000000..adf8157 --- /dev/null +++ b/Dump/hybos/lib/math/abs.c @@ -0,0 +1,32 @@ +/*** +*abs.c - find absolute value +* +* Copyright (c) 1985-1997, Microsoft Corporation. All rights reserved. +* +*Purpose: +* defines abs() - find the absolute value of an int. +* +*******************************************************************************/ + + +/*** +*int abs(number) - find absolute value of number +* +*Purpose: +* Returns the absolute value of number (if number >= 0, returns number, +* else returns -number). +* +*Entry: +* int number - number to find absolute value of +* +*Exit: +* returns the aboslute value of number +* +*Exceptions: +* +*******************************************************************************/ + +int abs(int number) +{ + return( number>=0 ? number : -number ); +} diff --git a/Dump/hybos/lib/math/max.c b/Dump/hybos/lib/math/max.c new file mode 100644 index 0000000..869833a --- /dev/null +++ b/Dump/hybos/lib/math/max.c @@ -0,0 +1,4 @@ +int max(int a, int b) +{ + return (a > b) ? a : b; +} diff --git a/Dump/hybos/lib/math/min.c b/Dump/hybos/lib/math/min.c new file mode 100644 index 0000000..10d4dc5 --- /dev/null +++ b/Dump/hybos/lib/math/min.c @@ -0,0 +1,4 @@ +int min(int a, int b) +{ + return (a < b) ? a : b; +} diff --git a/Dump/hybos/lib/math/rotl.c b/Dump/hybos/lib/math/rotl.c new file mode 100644 index 0000000..8981329 --- /dev/null +++ b/Dump/hybos/lib/math/rotl.c @@ -0,0 +1,49 @@ +/*** +*rotl.c - rotate an unsigned integer left +* +* Copyright (c) 1989-1997, Microsoft Corporation. All rights reserved. +* +*Purpose: +* defines _rotl() - performs a rotate left on an unsigned integer. +* +*******************************************************************************/ + + +/*** +*unsigned _rotl(val, shift) - int rotate left +* +*Purpose: +* Performs a rotate left on an unsigned integer. +* +* [Note: The _lrotl entry is based on the assumption +* that sizeof(int) == sizeof(long).] +*Entry: +* unsigned val: value to rotate +* int shift: number of bits to shift by +* +*Exit: +* returns rotated value +* +*Exceptions: +* None. +* +*******************************************************************************/ + +unsigned rotl(unsigned val, int shift) +{ + register unsigned hibit; /* non-zero means hi bit set */ + register unsigned num = val; /* number to rotate */ + + shift &= 0x1f; /* modulo 32 -- this will also make + negative shifts work */ + + while(shift--) + { + hibit = num & 0x80000000; /* get high bit */ + num <<= 1; /* shift left one bit */ + if(hibit) + num |= 1; /* set lo bit if hi bit was set */ + } + + return num; +} diff --git a/Dump/hybos/lib/math/rotr.c b/Dump/hybos/lib/math/rotr.c new file mode 100644 index 0000000..10247ff --- /dev/null +++ b/Dump/hybos/lib/math/rotr.c @@ -0,0 +1,52 @@ +/*** +*rotr.c - rotate an unsigned integer right +* +* Copyright (c) 1989-1997, Microsoft Corporation. All rights reserved. +* +*Purpose: +* defines _rotr() - performs a rotate right on an unsigned integer. +* +*******************************************************************************/ + + + + +/*** +*unsigned _rotr(val, shift) - int rotate right +* +*Purpose: +* Performs a rotate right on an unsigned integer. +* +* [Note: The _lrotl entry is based on the assumption +* that sizeof(int) == sizeof(long).] +*Entry: +* unsigned val: value to rotate +* int shift: number of bits to shift by +* +*Exit: +* returns rotated value +* +*Exceptions: +* None. +* +*******************************************************************************/ + + +unsigned rotr(unsigned val, int shift) +{ + register unsigned lobit; /* non-zero means lo bit set */ + register unsigned num = val; /* number to rotate */ + + shift &= 0x1f; /* modulo 32 -- this will also make + negative shifts work */ + + while(shift--) + { + lobit = num & 1; /* get high bit */ + num >>= 1; /* shift right one bit */ + if(lobit) + num |= 0x80000000; /* set hi bit if lo bit was set */ + } + + return num; +} diff --git a/Dump/hybos/lib/mem/Makefile b/Dump/hybos/lib/mem/Makefile new file mode 100644 index 0000000..0cdbee4 --- /dev/null +++ b/Dump/hybos/lib/mem/Makefile @@ -0,0 +1,59 @@ +.SUFFIXES: .asm + +# defines +MAKEFILE =Makefile +MAKEDEP =$(MAKEFILE) +INCDIR =../../include +NASM =nasm -f win32 -dUNDERBARS=1 -i$(INCDIR)/ +CC =gcc -g -Wall -W -O2 -nostdinc -fno-builtin -I$(INCDIR) + +MEM =memccpy.o \ + memchr.o \ + memcmp.o \ + memcpy.o \ + memcpybw.o \ + memicmp.o \ + memmove.o \ + memset.o \ + memsetw.o \ + swab.o + +# This will be one level above where we are now +OBJ_DIR =objects + +OBJS =$(MEM) + +# targets +all: $(OBJS) $(MAKEDEP) + +clean: + del ..\$(OBJ_DIR)\memccpy.o + del ..\$(OBJ_DIR)\memchr.o + del ..\$(OBJ_DIR)\memcmp.o + del ..\$(OBJ_DIR)\memcpy.o + del ..\$(OBJ_DIR)\memcpybw.o + del ..\$(OBJ_DIR)\memicmp.o + del ..\$(OBJ_DIR)\memmove.o + del ..\$(OBJ_DIR)\memset.o + del ..\$(OBJ_DIR)\memsetw.o + del ..\$(OBJ_DIR)\swab.o + +# implicit rules +.asm.o: + $(NASM) -o../$(OBJ_DIR)/$@ $< + +.c.o: + $(CC) -c -o../$(OBJ_DIR)/$@ $< + +# dependencies +memccpy.o: memccpy.c $(MAKEDEP) +memchr.o: memchr.c $(MAKEDEP) +memcmp.o: memcmp.c $(MAKEDEP) +memcpy.o: memcpy.c $(MAKEDEP) +memcpybw.o: memcpybw.c $(MAKEDEP) +memicmp.o: memicmp.c $(MAKEDEP) +memmove.o: memmove.c $(MAKEDEP) +memset.o: memset.c $(MAKEDEP) +memsetw.o: memsetw.c $(MAKEDEP) +swab.o: swab.c $(MAKEDEP) + diff --git a/Dump/hybos/lib/mem/memccpy.c b/Dump/hybos/lib/mem/memccpy.c new file mode 100644 index 0000000..287057b --- /dev/null +++ b/Dump/hybos/lib/mem/memccpy.c @@ -0,0 +1,41 @@ +/*** +*memccpy.c - copy bytes until a character is found +* +* Copyright (c) 1985-1997, Microsoft Corporation. All rights reserved. +* +*Purpose: +* defines _memccpy() - copies bytes until a specifed character +* is found, or a maximum number of characters have been copied. +* +*******************************************************************************/ + + +/*** +*char *_memccpy(dest, src, c, count) - copy bytes until character found +* +*Purpose: +* Copies bytes from src to dest until count bytes have been +* copied, or up to and including the character c, whichever +* comes first. +* +*Entry: +* void *dest - pointer to memory to receive copy +* void *src - source of bytes +* int c - character to stop copy at +* unsigned int count - max number of bytes to copy +* +*Exit: +* returns pointer to byte immediately after c in dest +* returns NULL if c was never found +* +*Exceptions: +* +*******************************************************************************/ + +void *memccpy(void *dest, const void *src, int c, unsigned count) +{ + while(count && (*((char *)(dest = (char *)dest + 1) - 1) = *((char *)(src = (char *)src + 1) - 1)) != (char)c ) + count--; + + return count ? dest : 0; +} diff --git a/Dump/hybos/lib/mem/memchr.c b/Dump/hybos/lib/mem/memchr.c new file mode 100644 index 0000000..ccf6e3b --- /dev/null +++ b/Dump/hybos/lib/mem/memchr.c @@ -0,0 +1,43 @@ +/*** +*memchr.c - search block of memory for a given character +* +* Copyright (c) 1985-1997, Microsoft Corporation. All rights reserved. +* +*Purpose: +* defines memchr() - search memory until a character is +* found or a limit is reached. +* +*******************************************************************************/ + + +/*** +*char *memchr(buf, chr, cnt) - search memory for given character. +* +*Purpose: +* Searches at buf for the given character, stopping when chr is +* first found or cnt bytes have been searched through. +* +*Entry: +* void *buf - memory buffer to be searched +* int chr - character to search for +* size_t cnt - max number of bytes to search +* +*Exit: +* returns pointer to first occurence of chr in buf +* returns NULL if chr not found in the first cnt bytes +* +*Exceptions: +* +*******************************************************************************/ +#include <_size_t.h> + +void *memchr(const void * buf, int chr, size_t cnt) +{ + while( cnt && (*(unsigned char *)buf != (unsigned char)chr)) + { + buf = (unsigned char *)buf + 1; + cnt--; + } + + return cnt ? (void *)buf : 0; +} diff --git a/Dump/hybos/lib/mem/memcmp.c b/Dump/hybos/lib/mem/memcmp.c new file mode 100644 index 0000000..f4d498d --- /dev/null +++ b/Dump/hybos/lib/mem/memcmp.c @@ -0,0 +1,46 @@ +/*** +*memcmp.c - compare two blocks of memory +* +* Copyright (c) 1985-1997, Microsoft Corporation. All rights reserved. +* +*Purpose: +* defines memcmp() - compare two memory blocks lexically and +* find their order. +* +*******************************************************************************/ + + +/*** +*int memcmp(buf1, buf2, count) - compare memory for lexical order +* +*Purpose: +* Compares count bytes of memory starting at buf1 and buf2 +* and find if equal or which one is first in lexical order. +* +*Entry: +* void *buf1, *buf2 - pointers to memory sections to compare +* size_t count - length of sections to compare +* +*Exit: +* returns < 0 if buf1 < buf2 +* returns 0 if buf1 == buf2 +* returns > 0 if buf1 > buf2 +* +*Exceptions: +* +*******************************************************************************/ +#include <_size_t.h> + +int memcmp(const void *buf1, const void *buf2, size_t count) +{ + if(!count) + return(0); + + while(--count && *(char *)buf1 == *(char *)buf2) + { + buf1 = (char *)buf1 + 1; + buf2 = (char *)buf2 + 1; + } + + return *((unsigned char *)buf1) - *((unsigned char *)buf2); +} diff --git a/Dump/hybos/lib/mem/memcpy.c b/Dump/hybos/lib/mem/memcpy.c new file mode 100644 index 0000000..bb86792 --- /dev/null +++ b/Dump/hybos/lib/mem/memcpy.c @@ -0,0 +1,13 @@ +void *memcpy(void *s, const void *t, unsigned n) +{ + void *ret = s; + + while(n--) + { + *(char *)s = *(char *)t; + s = (char *)s + 1; + t = (char *)t + 1; + } + + return ret; +} diff --git a/Dump/hybos/lib/mem/memcpybw.c b/Dump/hybos/lib/mem/memcpybw.c new file mode 100644 index 0000000..3db51f3 --- /dev/null +++ b/Dump/hybos/lib/mem/memcpybw.c @@ -0,0 +1,13 @@ +void *memcpybw(void *s, void *t, unsigned n) +{ + void *ret = s; + + while(n--) + { + *(char *)s = *(char *)t; + s = (char *)s + 2; + t = (char *)t + 1; + } + + return ret; +} diff --git a/Dump/hybos/lib/mem/memicmp.c b/Dump/hybos/lib/mem/memicmp.c new file mode 100644 index 0000000..74f2888 --- /dev/null +++ b/Dump/hybos/lib/mem/memicmp.c @@ -0,0 +1,58 @@ +/*** +*memicmp.c - compare memory, ignore case +* +* Copyright (c) 1988-1997, Microsoft Corporation. All rights reserved. +* +*Purpose: +* defines _memicmp() - compare two blocks of memory for lexical +* order. Case is ignored in the comparison. +* +*******************************************************************************/ + + +#define _TOLOWER(c) ( ((c) >= 'A') && ((c) <= 'Z') ? ((c) - 'A' + 'a') :\ + (c) ) + +/*** +*int _memicmp(first, last, count) - compare two blocks of memory, ignore case +* +*Purpose: +* Compares count bytes of the two blocks of memory stored at first +* and last. The characters are converted to lowercase before +* comparing (not permanently), so case is ignored in the search. +* +*Entry: +* char *first, *last - memory buffers to compare +* unsigned count - maximum length to compare +* +*Exit: +* returns < 0 if first < last +* returns 0 if first == last +* returns > 0 if first > last +* +*Uses: +* +*Exceptions: +* +*******************************************************************************/ + +int _memicmp(const void * first, const void * last, unsigned int count) +{ + int f = 0; + int l = 0; + + while(count--) + { + if((*(unsigned char *)first == *(unsigned char *)last) || + ((f = _TOLOWER( *(unsigned char *)first)) == + (l = _TOLOWER( *(unsigned char *)last)))) + { + first = (char *)first + 1; + last = (char *)last + 1; + } + else + break; + } + + return (f - l); +} diff --git a/Dump/hybos/lib/mem/memmove.c b/Dump/hybos/lib/mem/memmove.c new file mode 100644 index 0000000..8c0266a --- /dev/null +++ b/Dump/hybos/lib/mem/memmove.c @@ -0,0 +1,68 @@ +/*** +*memmove.c - contains memmove routine +* +* Copyright (c) 1988-1997, Microsoft Corporation. All right reserved. +* +*Purpose: +* memmove() copies a source memory buffer to a destination buffer. +* Overlapping buffers are treated specially, to avoid propogation. +* +*******************************************************************************/ + +/*** +*memmove - Copy source buffer to destination buffer +* +*Purpose: +* memmove() copies a source memory buffer to a destination memory buffer. +* This routine recognize overlapping buffers to avoid propogation. +* For cases where propogation is not a problem, memcpy() can be used. +* +*Entry: +* void *dst = pointer to destination buffer +* const void *src = pointer to source buffer +* size_t count = number of bytes to copy +* +*Exit: +* Returns a pointer to the destination buffer +* +*Exceptions: +*******************************************************************************/ +#include <_size_t.h> + +void *memmove(void *dst, const void *src, size_t count) +{ + void *ret = dst; + + + if(dst <= src || (char *)dst >= ((char *)src + count)) + { + /* + * Non-Overlapping Buffers + * copy from lower addresses to higher addresses + */ + while(count--) + { + *(char *)dst = *(char *)src; + dst = (char *)dst + 1; + src = (char *)src + 1; + } + } + else + { + /* + * Overlapping Buffers + * copy from higher addresses to lower addresses + */ + dst = (char *)dst + count - 1; + src = (char *)src + count - 1; + + while(count--) + { + *(char *)dst = *(char *)src; + dst = (char *)dst - 1; + src = (char *)src - 1; + } + } + + return ret; +} diff --git a/Dump/hybos/lib/mem/memset.c b/Dump/hybos/lib/mem/memset.c new file mode 100644 index 0000000..0dfd884 --- /dev/null +++ b/Dump/hybos/lib/mem/memset.c @@ -0,0 +1,12 @@ +void *memset(void *s, int i, unsigned n) +{ + void *start = s; + + while(n--) + { + *(char *)s = (char)i; + s = (char *)s + 1; + } + + return start; +} diff --git a/Dump/hybos/lib/mem/memsetw.c b/Dump/hybos/lib/mem/memsetw.c new file mode 100644 index 0000000..a81ad7a --- /dev/null +++ b/Dump/hybos/lib/mem/memsetw.c @@ -0,0 +1,13 @@ + +void *memsetw(void *s, short i, unsigned n) +{ + void *start = s; + + while(n--) + { + *(short *)s = (short)i; + s = (short *)s + 1; + } + + return(start); +} diff --git a/Dump/hybos/lib/mem/swab.c b/Dump/hybos/lib/mem/swab.c new file mode 100644 index 0000000..3220a4a --- /dev/null +++ b/Dump/hybos/lib/mem/swab.c @@ -0,0 +1,44 @@ +/*** +*swab.c - block copy, while swapping even/odd bytes +* +* Copyright (c) 1989-1997, Microsoft Corporation. All rights reserved. +* +*Purpose: +* This module contains the routine _swab() which swaps the odd/even +* bytes of words during a block copy. +* +*******************************************************************************/ + +/*** +*void _swab(srcptr, dstptr, nbytes) - swap ODD/EVEN bytes during word move +* +*Purpose: +* This routine copys a block of words and swaps the odd and even +* bytes. nbytes must be > 0, otherwise nothing is copied. If +* nbytes is odd, then only (nbytes-1) bytes are copied. +* +*Entry: +* srcptr = pointer to the source block +* dstptr = pointer to the destination block +* nbytes = number of bytes to swap +* +*Returns: +* None. +* +*Exceptions: +* +*******************************************************************************/ + +void swab(char *src, char *dest, int nbytes) +{ + char b1, b2; + + while(nbytes > 1) + { + b1 = *src++; + b2 = *src++; + *dest++ = b2; + *dest++ = b1; + nbytes -= 2; + } +} diff --git a/Dump/hybos/lib/setjmp/Makefile b/Dump/hybos/lib/setjmp/Makefile new file mode 100644 index 0000000..258ee28 --- /dev/null +++ b/Dump/hybos/lib/setjmp/Makefile @@ -0,0 +1,35 @@ +.SUFFIXES: .asm + +# defines +MAKEFILE =Makefile +MAKEDEP =$(MAKEFILE) +INCDIR =../../include +NASM =nasm -f win32 -dUNDERBARS=1 -i$(INCDIR)/ +CC =gcc -g -Wall -W -O2 -nostdinc -fno-builtin -I$(INCDIR) + +SETJMP =longjmp.o \ + setjmp.o + +# This will be one level above where we are now +OBJ_DIR =objects + +OBJS =$(SETJMP) + +# targets +all: $(OBJS) $(MAKEDEP) + +clean: + del ..\$(OBJ_DIR)\longjmp.o + del ..\$(OBJ_DIR)\setjmp.o + +# implicit rules +.asm.o: + $(NASM) -o../$(OBJ_DIR)/$@ $< + +.c.o: + $(CC) -c -o../$(OBJ_DIR)/$@ $< + +# dependencies +setjmp.o: setjmp.asm $(MAKEDEP) +longjmp.o: longjmp.c $(MAKEDEP) + diff --git a/Dump/hybos/lib/setjmp/longjmp.c b/Dump/hybos/lib/setjmp/longjmp.c new file mode 100644 index 0000000..af06310 --- /dev/null +++ b/Dump/hybos/lib/setjmp/longjmp.c @@ -0,0 +1,78 @@ +#include /* jmp_buf */ +/***************************************************************************** +To use setjmp() and longjmp() for asynchronous (interrupt-driven; +pre-emptive) task-switching, we want to enable interrupts simultaneous +with jumping to the task. In other words, we want the EFLAGS and EIP +registers loaded at the same time. + +The only instruction that can do this is IRET, which also loads the CS +register. Changing CS is done in code that uses far pointers, and it's +also done when changing address spaces, and when changing privilege levels. +We're not interested in any of those, so just push the current CS value +on the stack and let IRET use that. + +Three distinct stack pointer (ESP) values are used in this routine: +- 'Old' or 'current' stack pointer value, which is discarded by + this routine (use setjmp() to save it) +- ESP is made to point, briefly, to the jmp_buf struct itself +- 'New' ESP value; stored in jmp_buf.esp + +Register values are restored from the jmp_buf as follows: +1. Push jmp_buf.eflags, the current CS value, and jmp_buf.eip + onto the 'new' stack +2. Make ESP point to the jmp_buf struct itself, then use the POPA + instruction to pop the 7 general purpose registers (ESP is not + loaded by POPA). The use of POPA means that registers in the + jmp_buf MUST be stored in the order that POPA expects. + (Maybe use MOVs instead, to eliminate this restriction? + Might have to rewrite entire function in asm, instead of C.) +3. Load ESP with the 'new' stack pointer, from jmp_buf.esp +4. Use IRET to pop EIP, CS, and EFLAGS from the 'new' stack +5. ??? +6. Profit! <--- obligatory Slashdot joke + +This code does NOT save the floating-point state of the CPU. Either: +1. Don't use floating point, or +2. Don't use floating point in more than one thread, or +3. Rewrite this code so it DOES save the floating-point state, or +4. Save/restore the floating-point state when entering/leaving + the kernel (protected OS only) +*****************************************************************************/ +void longjmp(jmp_buf buf, int ret_val) +{ + unsigned *esp; + +/* make sure return value is not 0 */ + if(ret_val == 0) + ret_val++; +/* EAX is used for return values, so store it in jmp_buf.EAX */ + buf->eax = ret_val; +/* get ESP for new stack */ + esp = (unsigned *)buf->esp; +/* push EFLAGS on the new stack */ + esp--; + *esp = buf->eflags; +/* push current CS on the new stack */ + esp--; + __asm__ __volatile__( + "mov %%cs,%0\n" + : "=m"(*esp)); +/* push EIP on the new stack */ + esp--; + *esp = buf->eip; +/* new ESP is 12 bytes lower; update jmp_buf.ESP */ + buf->esp = (unsigned)esp; +/* now, briefly, make the jmp_buf struct our stack */ + __asm__ __volatile__( + "movl %0,%%esp\n" +/* ESP now points to 8 general-purpose registers stored in jmp_buf +Pop them */ + "popa\n" +/* load new stack pointer from jmp_buf */ + "movl -20(%%esp),%%esp\n" +/* ESP now points to new stack, with the IRET frame (EIP, CS, EFLAGS) +we created just above. Pop these registers: */ + "iret\n" + : + : "m"(buf)); +} diff --git a/Dump/hybos/lib/setjmp/setjmp.asm b/Dump/hybos/lib/setjmp/setjmp.asm new file mode 100644 index 0000000..dc0ae60 --- /dev/null +++ b/Dump/hybos/lib/setjmp/setjmp.asm @@ -0,0 +1,35 @@ +%include "asm.inc" + +SECTION .text + +EXP setjmp + push ebx + mov ebx,[8 + esp] + + mov [0 + ebx],edi ; buf->edi == 0(ebx) == EDI + mov [4 + ebx],esi ; buf->esi == 4(ebx) == ESI + mov [8 + ebx],ebp ; buf->ebp == 8(ebx) == EBP + + mov [20 + ebx],edx ; buf->edx == 20(ebx) == EDX + mov [24 + ebx],ecx ; buf->ecx == 24(ebx) == ECX + mov [28 + ebx],eax ; buf->eax == 28(ebx) == EAX + +; use EBX value saved on stack; not the current value + mov eax,[esp] + mov [16 + ebx],eax ; buf->ebx == 16(ebx) == EBX + +; use ESP value after RET; not the current value + lea eax,[8 + esp] + mov [12 + ebx],eax ; buf->esp == 32(ebx) == ESP + +; use return address of this routine (EIP value saved on stack); +; not the current value + mov eax,[4 + esp] + mov [32 + ebx],eax ; buf->eip == 36(ebx) == EIP + +; none of the PUSH or MOV instructions changed EFLAGS! + pushf + pop dword [36 + ebx] ; buf->eflags == 40(ebx) == EFLAGS + pop ebx + xor eax,eax + ret diff --git a/Dump/hybos/lib/stdio/.doprintf.c.swp b/Dump/hybos/lib/stdio/.doprintf.c.swp new file mode 100644 index 0000000..7956be6 --- /dev/null +++ b/Dump/hybos/lib/stdio/.doprintf.c.swp Binary files differ diff --git a/Dump/hybos/lib/stdio/Makefile b/Dump/hybos/lib/stdio/Makefile new file mode 100644 index 0000000..4d6994b --- /dev/null +++ b/Dump/hybos/lib/stdio/Makefile @@ -0,0 +1,38 @@ +.SUFFIXES: .asm + +# defines +MAKEFILE =Makefile +MAKEDEP =$(MAKEFILE) +INCDIR =../../include +NASM =nasm -f win32 -dUNDERBARS=1 -i$(INCDIR)/ +CC =gcc -g -Wall -W -O2 -nostdinc -fno-builtin -I$(INCDIR) + +STDIO =doprintf.o \ + sprintf.o \ + printf.o + +# This will be one level above where we are now +OBJ_DIR =objects + +OBJS =$(STDIO) + +# targets +all: $(OBJS) $(MAKEDEP) + +clean: + del ..\$(OBJ_DIR)\doprintf.o + del ..\$(OBJ_DIR)\sprintf.o + del ..\$(OBJ_DIR)\printf.o + +# implicit rules +.asm.o: + $(NASM) -o../$(OBJ_DIR)/$@ $< + +.c.o: + $(CC) -c -o../$(OBJ_DIR)/$@ $< + +# dependencies +doprintf.o: doprintf.c $(MAKEDEP) +sprintf.o: sprintf.c $(MAKEDEP) +printf.o: printf.c $(MAKEDEP) + diff --git a/Dump/hybos/lib/stdio/doprintf.c b/Dump/hybos/lib/stdio/doprintf.c new file mode 100644 index 0000000..dc9e8ac --- /dev/null +++ b/Dump/hybos/lib/stdio/doprintf.c @@ -0,0 +1,357 @@ +#include <_printf.h> /* fnptr_t */ +#include /* strlen() */ +#include /* va_list, va_arg() */ +/***************************************************************************** +Revised Jan 28, 2002 +- changes to make characters 0x80-0xFF display properly + +Revised June 10, 2001 +- changes to make vsprintf() terminate string with '\0' + +Revised May 12, 2000 +- math in DO_NUM is now unsigned, as it should be +- %0 flag (pad left with zeroes) now works +- actually did some TESTING, maybe fixed some other bugs + + name: do_printf + action: minimal subfunction for ?printf, calls function + 'fn' with arg 'ptr' for each character to be output + returns:total number of characters output + + %[flag][width][.prec][mod][conv] + flag: - left justify, pad right w/ blanks DONE + 0 pad left w/ 0 for numerics DONE + + always print sign, + or - no + ' ' (blank) no + # (???) no + + width: (field width) DONE + + prec: (precision) no + + conv: d,i decimal int DONE + u decimal unsigned DONE + o octal DONE + x,X hex DONE + f,e,g,E,G float no + c char DONE + s string DONE + p ptr DONE + + mod: N near ptr DONE + F far ptr no + h short (16-bit) int DONE + l long (32-bit) int DONE + L long long (64-bit) int no +*****************************************************************************/ +/* flags used in processing format string */ +#define PR_LJ 0x01 /* left justify */ +#define PR_CA 0x02 /* use A-F instead of a-f for hex */ +#define PR_SG 0x04 /* signed numeric conversion (%d vs. %u) */ +#define PR_32 0x08 /* long (32-bit) numeric conversion */ +#define PR_16 0x10 /* short (16-bit) numeric conversion */ +#define PR_WS 0x20 /* PR_SG set and num was < 0 */ +#define PR_LZ 0x40 /* pad left with '0' instead of ' ' */ +#define PR_FP 0x80 /* pointers are far */ + +/* largest number handled is 2^32-1, lowest radix handled is 8. +2^32-1 in base 8 has 11 digits (add 5 for trailing NUL and for slop) */ +#define PR_BUFLEN 16 + +int do_printf(const char *fmt, va_list args, fnptr_t fn, void *ptr) +{ + unsigned state, flags, radix, actual_wd, count, given_wd; + unsigned char *where, buf[PR_BUFLEN]; + long num; + + state = flags = count = given_wd = 0; +/* begin scanning format specifier list */ + for(; *fmt; fmt++) + { + switch(state) + { +/* STATE 0: AWAITING % */ + case 0: + if(*fmt != '%') /* not %... */ + { + fn(*fmt, &ptr); /* ...just echo it */ + count++; + break; + } +/* found %, get next char and advance state to check if next char is a flag */ + state++; + fmt++; + /* FALL THROUGH */ +/* STATE 1: AWAITING FLAGS (%-0) */ + case 1: + if(*fmt == '%') /* %% */ + { + fn(*fmt, &ptr); + count++; + state = flags = given_wd = 0; + break; + } + if(*fmt == '-') + { + if(flags & PR_LJ)/* %-- is illegal */ + state = flags = given_wd = 0; + else + flags |= PR_LJ; + break; + } +/* not a flag char: advance state to check if it's field width */ + state++; +/* check now for '%0...' */ + if(*fmt == '0') + { + flags |= PR_LZ; + fmt++; + } + /* FALL THROUGH */ +/* STATE 2: AWAITING (NUMERIC) FIELD WIDTH */ + case 2: + if(*fmt >= '0' && *fmt <= '9') + { + given_wd = 10 * given_wd + + (*fmt - '0'); + break; + } +/* not field width: advance state to check if it's a modifier */ + state++; + /* FALL THROUGH */ +/* STATE 3: AWAITING MODIFIER CHARS (FNlh) */ + case 3: + if(*fmt == 'F') + { + flags |= PR_FP; + break; + } + if(*fmt == 'N') + break; + if(*fmt == 'l') + { + flags |= PR_32; + break; + } + if(*fmt == 'h') + { + flags |= PR_16; + break; + } +/* not modifier: advance state to check if it's a conversion char */ + state++; + /* FALL THROUGH */ +/* STATE 4: AWAITING CONVERSION CHARS (Xxpndiuocs) */ + case 4: + where = buf + PR_BUFLEN - 1; + *where = '\0'; + switch(*fmt) + { + case 'X': + flags |= PR_CA; + /* FALL THROUGH */ +/* xxx - far pointers (%Fp, %Fn) not yet supported */ + case 'x': + case 'p': + case 'n': + radix = 16; + goto DO_NUM; + case 'd': + case 'i': + flags |= PR_SG; + /* FALL THROUGH */ + case 'u': + radix = 10; + goto DO_NUM; + case 'o': + radix = 8; +/* load the value to be printed. l=long=32 bits: */ +DO_NUM: if(flags & PR_32) + num = va_arg(args, unsigned long); +/* h=short=16 bits (signed or unsigned) */ + else if(flags & PR_16) + { + if(flags & PR_SG) + num = va_arg(args, short); + else + num = va_arg(args, unsigned short); + } +/* no h nor l: sizeof(int) bits (signed or unsigned) */ + else + { + if(flags & PR_SG) + num = va_arg(args, int); + else + num = va_arg(args, unsigned int); + } +/* take care of sign */ + if(flags & PR_SG) + { + if(num < 0) + { + flags |= PR_WS; + num = -num; + } + } +/* convert binary to octal/decimal/hex ASCII +OK, I found my mistake. The math here is _always_ unsigned */ + do + { + unsigned long temp; + + temp = (unsigned long)num % radix; + where--; + if(temp < 10) + *where = temp + '0'; + else if(flags & PR_CA) + *where = temp - 10 + 'A'; + else + *where = temp - 10 + 'a'; + num = (unsigned long)num / radix; + } + while(num != 0); + goto EMIT; + case 'c': +/* disallow pad-left-with-zeroes for %c */ + flags &= ~PR_LZ; + where--; + *where = (unsigned char)va_arg(args, + unsigned char); + actual_wd = 1; + goto EMIT2; + case 's': +/* disallow pad-left-with-zeroes for %s */ + flags &= ~PR_LZ; + where = va_arg(args, unsigned char *); +EMIT: + actual_wd = strlen(where); + if(flags & PR_WS) + actual_wd++; +/* if we pad left with ZEROES, do the sign now */ + if((flags & (PR_WS | PR_LZ)) == + (PR_WS | PR_LZ)) + { + fn('-', &ptr); + count++; + } +/* pad on left with spaces or zeroes (for right justify) */ +EMIT2: if((flags & PR_LJ) == 0) + { + while(given_wd > actual_wd) + { + fn(flags & PR_LZ ? '0' : + ' ', &ptr); + count++; + given_wd--; + } + } +/* if we pad left with SPACES, do the sign now */ + if((flags & (PR_WS | PR_LZ)) == PR_WS) + { + fn('-', &ptr); + count++; + } +/* emit string/char/converted number */ + while(*where != '\0') + { + fn(*where++, &ptr); + count++; + } +/* pad on right with spaces (for left justify) */ + if(given_wd < actual_wd) + given_wd = 0; + else given_wd -= actual_wd; + for(; given_wd; given_wd--) + { + fn(' ', &ptr); + count++; + } + break; + default: + break; + } + default: + state = flags = given_wd = 0; + break; + } + } + return count; +} +#if 0 /* testing */ +/***************************************************************************** +SPRINTF +*****************************************************************************/ +int vsprintf_help(unsigned c, void **ptr) +{ + char *dst; + + dst = *ptr; + *dst++ = c; + *ptr = dst; + return 0 ; +} +/***************************************************************************** +*****************************************************************************/ +int vsprintf(char *buffer, const char *fmt, va_list args) +{ + int ret_val; + + ret_val = do_printf(fmt, args, vsprintf_help, (void *)buffer); + buffer[ret_val] = '\0'; + return ret_val; +} +/***************************************************************************** +*****************************************************************************/ +int sprintf(char *buffer, const char *fmt, ...) +{ + va_list args; + int ret_val; + + va_start(args, fmt); + ret_val = vsprintf(buffer, fmt, args); + va_end(args); + return ret_val; +} +/***************************************************************************** +PRINTF +You must write your own putchar() +*****************************************************************************/ +int vprintf_help(unsigned c, void **ptr) +{ + putchar(c); + return 0 ; +} +/***************************************************************************** +*****************************************************************************/ +int vprintf(const char *fmt, va_list args) +{ + return do_printf(fmt, args, vprintf_help, NULL); +} +/***************************************************************************** +*****************************************************************************/ +int printf(const char *fmt, ...) +{ + va_list args; + int ret_val; + + va_start(args, fmt); + ret_val = vprintf(fmt, args); + va_end(args); + return ret_val; +} +/***************************************************************************** +*****************************************************************************/ +int main(void) +{ + char buf[64]; + + sprintf(buf, "%u score and %i years ago...\n", 4, -7); + puts(buf); + + sprintf(buf, "-1L == 0x%lX == octal %lo\n", -1L, -1L); + puts(buf); + + printf("<%-08s> and <%08s> justified strings\n", "left", "right"); + return 0; +} +#endif diff --git a/Dump/hybos/lib/stdio/printf.c b/Dump/hybos/lib/stdio/printf.c new file mode 100644 index 0000000..39b1647 --- /dev/null +++ b/Dump/hybos/lib/stdio/printf.c @@ -0,0 +1,32 @@ +/** + * printf.c + * + */ + +#include /* va_* */ +#include <_printf.h> /* fnptr_t */ +#include + +int do_printf(const char *fmt, va_list args, fnptr_t fn, void *ptr); +void putch(unsigned c); + +int printf_help(unsigned c, void **ptr) +{ + /** + * Leave this for now + */ + ptr = ptr; + + putch(c); + return 0; +} + +void printf(const char *fmt, ...) +{ + va_list args; + + va_start(args, fmt); + (void)do_printf(fmt, args, printf_help, NULL); + va_end(args); +} + diff --git a/Dump/hybos/lib/stdio/sprintf.c b/Dump/hybos/lib/stdio/sprintf.c new file mode 100644 index 0000000..586bb6a --- /dev/null +++ b/Dump/hybos/lib/stdio/sprintf.c @@ -0,0 +1,19 @@ +/** + * sprintf.c + * + */ + +#include /* va_* */ + +int vsprintf_help(unsigned c, void **ptr); + +int sprintf(char *buffer, const char *fmt, ...) +{ + va_list args; + int ret_val; + + va_start(args, fmt); + ret_val = vsprintf(buffer, fmt, args); + va_end(args); + return ret_val; +} diff --git a/Dump/hybos/lib/string/Makefile b/Dump/hybos/lib/string/Makefile new file mode 100644 index 0000000..4fd1d3c --- /dev/null +++ b/Dump/hybos/lib/string/Makefile @@ -0,0 +1,92 @@ +.SUFFIXES: .asm + +# defines +MAKEFILE =Makefile +MAKEDEP =$(MAKEFILE) +INCDIR =../../include +NASM =nasm -f win32 -dUNDERBARS=1 -i$(INCDIR)/ +CC =gcc -g -Wall -W -O2 -nostdinc -fno-builtin -I$(INCDIR) + +STRING =strcat.o \ + strchr.o \ + strcmp.o \ + strcpy.o \ + strcspn.o \ + stricmp.o \ + strlen.o \ + strncmp.o \ + strncpy.o \ + strnicmp.o \ + strnpst.o \ + strnset.o \ + strpbrk.o \ + strpst.o \ + strrchr.o \ + strrev.o \ + strset.o \ + strspn.o \ + strstr.o \ + tolower.o \ + toupper.o + +# This will be one level above where we are now +OBJ_DIR =objects + +OBJS =$(STRING) + +# targets +all: $(OBJS) $(MAKEDEP) + +clean: + del ..\$(OBJ_DIR)\strcat.o + del ..\$(OBJ_DIR)\strchr.o + del ..\$(OBJ_DIR)\strcmp.o + del ..\$(OBJ_DIR)\strcpy.o + del ..\$(OBJ_DIR)\strcspn.o + del ..\$(OBJ_DIR)\stricmp.o + del ..\$(OBJ_DIR)\strlen.o + del ..\$(OBJ_DIR)\strncmp.o + del ..\$(OBJ_DIR)\strncpy.o + del ..\$(OBJ_DIR)\strnicmp.o + del ..\$(OBJ_DIR)\strnpst.o + del ..\$(OBJ_DIR)\strnset.o + del ..\$(OBJ_DIR)\strpbrk.o + del ..\$(OBJ_DIR)\strpst.o + del ..\$(OBJ_DIR)\strrchr.o + del ..\$(OBJ_DIR)\strrev.o + del ..\$(OBJ_DIR)\strset.o + del ..\$(OBJ_DIR)\strspn.o + del ..\$(OBJ_DIR)\strstr.o + del ..\$(OBJ_DIR)\tolower.o + del ..\$(OBJ_DIR)\toupper.o + +# implicit rules +.asm.o: + $(NASM) -o../$(OBJ_DIR)/$@ $< + +.c.o: + $(CC) -c -o../$(OBJ_DIR)/$@ $< + +# dependencies +strcat.o: strcat.c $(MAKEDEP) +strchr.o: strchr.c $(MAKEDEP) +strcmp.o: strcmp.c $(MAKEDEP) +strcpy.o: strcpy.c $(MAKEDEP) +strcspn.o: strcspn.c $(MAKEDEP) +stricmp.o: stricmp.c $(MAKEDEP) +strlen.o: strlen.c $(MAKEDEP) +strcmp.o: strcmp.c $(MAKEDEP) +strncpy.o: strncpy.c $(MAKEDEP) +strnicmp.o: strnicmp.c $(MAKEDEP) +strnpst.o: strnpst.c $(MAKEDEP) +strnset.o: strnset.c $(MAKEDEP) +strpbrk.o: strpbrk.c $(MAKEDEP) +strpst.o: strpst.c $(MAKEDEP) +strrchr.o: strrchr.c $(MAKEDEP) +strrev.o: strrev.c $(MAKEDEP) +strset.o: strset.c $(MAKEDEP) +strspn.o: strspn.c $(MAKEDEP) +strstr.o: strstr.c $(MAKEDEP) +tolower.o: tolower.c $(MAKEDEP) +toupper.o: toupper.c $(MAKEDEP) + diff --git a/Dump/hybos/lib/string/strcat.c b/Dump/hybos/lib/string/strcat.c new file mode 100644 index 0000000..9b87dc5 --- /dev/null +++ b/Dump/hybos/lib/string/strcat.c @@ -0,0 +1,90 @@ +/*** +*strncat.c - append n chars of string to new string +* +* Copyright (c) 1985-1997, Microsoft Corporation. All rights reserved. +* +*Purpose: +* defines strncat() - appends n characters of string onto +* end of other string +* +*******************************************************************************/ + + +/*** +*char *strncat(front, back, count) - append count chars of back onto front +* +*Purpose: +* Appends at most count characters of the string back onto the +* end of front, and ALWAYS terminates with a null character. +* If count is greater than the length of back, the length of back +* is used instead. (Unlike strncpy, this routine does not pad out +* to count characters). +* +*Entry: +* char *front - string to append onto +* char *back - string to append +* unsigned count - count of max characters to append +* +*Exit: +* returns a pointer to string appended onto (front). +* +*Uses: +* +*Exceptions: +* +*******************************************************************************/ +#include <_size_t.h> + +/******************************************************************************/ +/* strcat - Concatenate String */ +/* */ +/* This fuction concatenates two strings (add the source string to the end of */ +/* the destination string. It assumes there is enough space in the */ +/* destination to add the source string to it. */ +/* */ +/* s The destination string. */ +/* t The source string. */ +/* @ The destination string. */ +/******************************************************************************/ +char *strcat(char *s, const char *t) +{ + char *c = s; + + /* Find the end of the destination string. */ + while (*s) s++; + + /* Copy the source sting to the destination string. */ + while ((*s++ = *t++)); + + return (c); +} + +/******************************************************************************/ +/* strncat - Concatenate String up to n Characters */ +/* */ +/* This fuction concatenates two strings (add the source string to the end of */ +/* the destination string. It assumes there is enough space in the */ +/* destination to add the source string to it. The total lenght of the */ +/* concatened string may not be larger than n characters. This includes the */ +/* NULL charecter. */ +/* */ +/* s The destination string. */ +/* t The source string. */ +/* n The maximum lenght of the concatednated string. */ +/* @ The destination string. */ +/******************************************************************************/ + +char *strncat(char *front, const char *back, size_t count) +{ + char *start = front; + + while(*front++); + front--; + + while(count--) + if(!(*front++ = *back++)) + return(start); + + *front = '\0'; + return(start); +} diff --git a/Dump/hybos/lib/string/strcat.c~ b/Dump/hybos/lib/string/strcat.c~ new file mode 100644 index 0000000..c46d321 --- /dev/null +++ b/Dump/hybos/lib/string/strcat.c~ @@ -0,0 +1,90 @@ +/*** +*strncat.c - append n chars of string to new string +* +* Copyright (c) 1985-1997, Microsoft Corporation. All rights reserved. +* +*Purpose: +* defines strncat() - appends n characters of string onto +* end of other string +* +*******************************************************************************/ + + +/*** +*char *strncat(front, back, count) - append count chars of back onto front +* +*Purpose: +* Appends at most count characters of the string back onto the +* end of front, and ALWAYS terminates with a null character. +* If count is greater than the length of back, the length of back +* is used instead. (Unlike strncpy, this routine does not pad out +* to count characters). +* +*Entry: +* char *front - string to append onto +* char *back - string to append +* unsigned count - count of max characters to append +* +*Exit: +* returns a pointer to string appended onto (front). +* +*Uses: +* +*Exceptions: +* +*******************************************************************************/ +#include <_size_t.h> + +/******************************************************************************/ +/* strcat - Concatenate String */ +/* */ +/* This fuction concatenates two strings (add the source string to the end of */ +/* the destination string. It assumes there is enough space in the */ +/* destination to add the source string to it. */ +/* */ +/* s The destination string. */ +/* t The source string. */ +/* @ The destination string. */ +/******************************************************************************/ +char *strcat(char *s, const char *t) +{ + char *c = s; + + /* Find the end of the destination string. */ + while (*s) s++; + + /* Copy the source sting to the destination string. */ + while (*s++ = *t++); + + return (c); +} + +/******************************************************************************/ +/* strncat - Concatenate String up to n Characters */ +/* */ +/* This fuction concatenates two strings (add the source string to the end of */ +/* the destination string. It assumes there is enough space in the */ +/* destination to add the source string to it. The total lenght of the */ +/* concatened string may not be larger than n characters. This includes the */ +/* NULL charecter. */ +/* */ +/* s The destination string. */ +/* t The source string. */ +/* n The maximum lenght of the concatednated string. */ +/* @ The destination string. */ +/******************************************************************************/ + +char *strncat(char *front, const char *back, size_t count) +{ + char *start = front; + + while(*front++); + front--; + + while(count--) + if(!(*front++ = *back++)) + return(start); + + *front = '\0'; + return(start); +} diff --git a/Dump/hybos/lib/string/strchr.c b/Dump/hybos/lib/string/strchr.c new file mode 100644 index 0000000..9a0ca0b --- /dev/null +++ b/Dump/hybos/lib/string/strchr.c @@ -0,0 +1,39 @@ +/*** +*strchr.c - search a string for a given character +* +* Copyright (c) 1985-1997, Microsoft Corporation. All rights reserved. +* +*Purpose: +* defines strchr() - search a string for a character +* +*******************************************************************************/ + +/*** +*char *strchr(string, c) - search a string for a character +* +*Purpose: +* Searches a string for a given character, which may be the +* null character '\0'. +* +*Entry: +* char *string - string to search in +* char c - character to search for +* +*Exit: +* returns pointer to the first occurence of c in string +* returns NULL if c does not occur in string +* +*Exceptions: +* +*******************************************************************************/ + +char *strchr(const char * string, int ch) +{ + while(*string && *string != (char)ch) + string++; + + if(*string == (char)ch) + return((char *)string); + + return(0); +} diff --git a/Dump/hybos/lib/string/strcmp.c b/Dump/hybos/lib/string/strcmp.c new file mode 100644 index 0000000..518bb64 --- /dev/null +++ b/Dump/hybos/lib/string/strcmp.c @@ -0,0 +1,14 @@ +int strcmp(const char * src, const char * dst) +{ + int ret = 0 ; + + while(!(ret = *(unsigned char *)src - *(unsigned char *)dst) && *dst) + ++src, ++dst; + + if(ret < 0) + ret = -1 ; + else if(ret > 0) + ret = 1 ; + + return(ret); +} diff --git a/Dump/hybos/lib/string/strcpy.c b/Dump/hybos/lib/string/strcpy.c new file mode 100644 index 0000000..8922e3b --- /dev/null +++ b/Dump/hybos/lib/string/strcpy.c @@ -0,0 +1,7 @@ + +char *strcpy(char *s, const char *t) +{ + while((*(s++) = *(t++))); + + return s; +} diff --git a/Dump/hybos/lib/string/strcspn.c b/Dump/hybos/lib/string/strcspn.c new file mode 100644 index 0000000..95dd844 --- /dev/null +++ b/Dump/hybos/lib/string/strcspn.c @@ -0,0 +1,69 @@ +/*** +*strspn.c - find length of initial substring of chars from a control string +* +* Copyright (c) 1985-1997, Microsoft Corporation. All rights reserved. +* +*Purpose: +* defines strspn() - finds the length of the initial substring of +* a string consisting entirely of characters from a control string. +* +* defines strcspn()- finds the length of the initial substring of +* a string consisting entirely of characters not in a control string. +* +* defines strpbrk()- finds the index of the first character in a string +* that is not in a control string +* +*******************************************************************************/ +#include +/*** +*int strcspn(string, control) - search for init substring w/o control chars +* +*Purpose: +* returns the index of the first character in string that belongs +* to the set of characters specified by control. This is equivalent +* to the length of the length of the initial substring of string +* composed entirely of characters not in control. Null chars not +* considered. +* +*Entry: +* char *string - string to search +* char *control - set of characters not allowed in init substring +* +*Exit: +* returns the index of the first char in string +* that is in the set of characters specified by control. +* +*Exceptions: +* +*******************************************************************************/ + +size_t strcspn(const char * string, const char * control) +{ + const unsigned char *str = (unsigned char *)string; + const unsigned char *ctrl = (unsigned char *)control; + + unsigned char map[32]; + int count; + + /* Clear out bit map */ + for(count=0; count<32; count++) + map[count] = 0; + + /* Set bits in control map */ + while(*ctrl) + { + map[*ctrl >> 3] |= (1 << (*ctrl & 7)); + ctrl++; + } + + /* 1st char in control map stops search */ + count=0; + map[0] |= 1; /* null chars not considered */ + while(!(map[*str >> 3] & (1 << (*str & 7)))) + { + count++; + str++; + } + + return count; +} diff --git a/Dump/hybos/lib/string/stricmp.c b/Dump/hybos/lib/string/stricmp.c new file mode 100644 index 0000000..50d64b4 --- /dev/null +++ b/Dump/hybos/lib/string/stricmp.c @@ -0,0 +1,49 @@ +/*** +*stricmp.c - contains case-insensitive string comp routine _stricmp/_strcmpi +* +* Copyright (c) 1985-1997, Microsoft Corporation. All rights reserved. +* +*Purpose: +* contains _stricmp(), also known as _strcmpi() +* +*******************************************************************************/ + + +/*** +*int _stricmp(dst, src), _strcmpi(dst, src) - compare strings, ignore case +* +*Purpose: +* _stricmp/_strcmpi perform a case-insensitive string comparision. +* For differences, upper case letters are mapped to lower case. +* Thus, "abc_" < "ABCD" since "_" < "d". +* +*Entry: +* char *dst, *src - strings to compare +* +*Return: +* <0 if dst < src +* 0 if dst = src +* >0 if dst > src +* +*Exceptions: +* +*******************************************************************************/ + +/* strcmpi */ + +int stricmp(const char *dst, const char *src) +{ + int f,l; + + do + { + if(((f = (unsigned char)(*(dst++))) >= 'A') && (f <= 'Z')) + f -= ('A' - 'a'); + + if(((l = (unsigned char)(*(src++))) >= 'A') && (l <= 'Z')) + l -= ('A' - 'a'); + } while ( f && (f == l) ); + + + return (f - l); +} diff --git a/Dump/hybos/lib/string/strlen.c b/Dump/hybos/lib/string/strlen.c new file mode 100644 index 0000000..d37eb21 --- /dev/null +++ b/Dump/hybos/lib/string/strlen.c @@ -0,0 +1,11 @@ +#include /* size_t */ +/***************************************************************************** +*****************************************************************************/ +size_t strlen(const char *str) +{ + size_t ret_val; + + for(ret_val = 0; *str != '\0'; str++) + ret_val++; + return ret_val; +} diff --git a/Dump/hybos/lib/string/strncmp.c b/Dump/hybos/lib/string/strncmp.c new file mode 100644 index 0000000..ab61fd3 --- /dev/null +++ b/Dump/hybos/lib/string/strncmp.c @@ -0,0 +1,15 @@ +#include + +int strncmp(const char * first, const char * last, size_t count) +{ + if(!count) + return(0); + + while(--count && *first && *first == *last) + { + first++; + last++; + } + + return( *(unsigned char *)first - *(unsigned char *)last ); +} diff --git a/Dump/hybos/lib/string/strncpy.c b/Dump/hybos/lib/string/strncpy.c new file mode 100644 index 0000000..1de4174 --- /dev/null +++ b/Dump/hybos/lib/string/strncpy.c @@ -0,0 +1,15 @@ +#include /* size_t */ + +char *strncpy(char * dest, const char * source, size_t count) +{ + char *start = dest; + + while(count && (*dest++ = *source++)) /* copy string */ + count--; + + if(count) /* pad out with zeroes */ + while(--count) + *dest++ = '\0'; + + return(start); +} diff --git a/Dump/hybos/lib/string/strnicmp.c b/Dump/hybos/lib/string/strnicmp.c new file mode 100644 index 0000000..39204c6 --- /dev/null +++ b/Dump/hybos/lib/string/strnicmp.c @@ -0,0 +1,56 @@ +/*** +*strnicmp.c - compare n chars of strings, ignoring case +* +* Copyright (c) 1985-1997, Microsoft Corporation. All rights reserved. +* +*Purpose: +* defines _strnicmp() - Compares at most n characters of two strings, +* without regard to case. +* +*******************************************************************************/ + +/*** +*int _strnicmp(first, last, count) - compares count char of strings, ignore case +* +*Purpose: +* Compare the two strings for lexical order. Stops the comparison +* when the following occurs: (1) strings differ, (2) the end of the +* strings is reached, or (3) count characters have been compared. +* For the purposes of the comparison, upper case characters are +* converted to lower case. +* +*Entry: +* char *first, *last - strings to compare +* size_t count - maximum number of characters to compare +* +*Exit: +* returns <0 if first < last +* returns 0 if first == last +* returns >0 if first > last +* +*Exceptions: +* +*******************************************************************************/ + +#include <_size_t.h> /* size_t */ + +int strnicmp(const char *first, const char *last, size_t count) +{ + int f,l; + + if(!count) + return 0; + + do + { + if(((f = (unsigned char)(*(first++))) >= 'A') && (f <= 'Z')) + f -= 'A' - 'a'; + + if(((l = (unsigned char)(*(last++))) >= 'A') && (l <= 'Z')) + l -= 'A' - 'a'; + + } while ( --count && f && (f == l) ); + + + return (f - l); +} diff --git a/Dump/hybos/lib/string/strnpst.c b/Dump/hybos/lib/string/strnpst.c new file mode 100644 index 0000000..6911536 --- /dev/null +++ b/Dump/hybos/lib/string/strnpst.c @@ -0,0 +1,11 @@ + +char *strnpst(char *s, const char *t, unsigned n) +{ + while(*t && n) + { + *(s++) = *(t++); + n--; + }; + + return s; +} diff --git a/Dump/hybos/lib/string/strnset.c b/Dump/hybos/lib/string/strnset.c new file mode 100644 index 0000000..f1edada --- /dev/null +++ b/Dump/hybos/lib/string/strnset.c @@ -0,0 +1,11 @@ +#include /* size_t */ + +char *_strnset(char * string, int val, size_t count) +{ + char *start = string; + + while(count-- && *string) + *string++ = (char)val; + + return start; +} diff --git a/Dump/hybos/lib/string/strpbrk.c b/Dump/hybos/lib/string/strpbrk.c new file mode 100644 index 0000000..26071e2 --- /dev/null +++ b/Dump/hybos/lib/string/strpbrk.c @@ -0,0 +1,70 @@ +/*** +*strspn.c - find length of initial substring of chars from a control string +* +* Copyright (c) 1985-1997, Microsoft Corporation. All rights reserved. +* +*Purpose: +* defines strspn() - finds the length of the initial substring of +* a string consisting entirely of characters from a control string. +* +* defines strcspn()- finds the length of the initial substring of +* a string consisting entirely of characters not in a control string. +* +* defines strpbrk()- finds the index of the first character in a string +* that is not in a control string +* +*******************************************************************************/ + + + +/*** +*char *strpbrk(string, control) - scans string for a character from control +* +*Purpose: +* Finds the first occurence in string of any character from +* the control string. +* +*Entry: +* char *string - string to search in +* char *control - string containing characters to search for +* +*Exit: +* returns a pointer to the first character from control found +* in string. +* returns NULL if string and control have no characters in common. +* +*Exceptions: +* +*******************************************************************************/ + + +char *strpbrk(const char * string, const char * control) +{ + const unsigned char *str = (unsigned char *)string; + const unsigned char *ctrl = (unsigned char *)control; + + unsigned char map[32]; + int count; + + /* Clear out bit map */ + for(count=0; count<32; count++) + map[count] = 0; + + /* Set bits in control map */ + while(*ctrl) + { + map[*ctrl >> 3] |= (1 << (*ctrl & 7)); + ctrl++; + } + + /* 1st char in control map stops search */ + while(*str) + { + if(map[*str >> 3] & (1 << (*str & 7))) + return((char *)str); + + str++; + } + + return 0; +} diff --git a/Dump/hybos/lib/string/strpst.c b/Dump/hybos/lib/string/strpst.c new file mode 100644 index 0000000..a571764 --- /dev/null +++ b/Dump/hybos/lib/string/strpst.c @@ -0,0 +1,10 @@ + +char *strpst(char *s, const char *t) +{ + while(*t) + { + *(s++) = *(t++); + }; + + return s; +} diff --git a/Dump/hybos/lib/string/strrchr.c b/Dump/hybos/lib/string/strrchr.c new file mode 100644 index 0000000..0a888d7 --- /dev/null +++ b/Dump/hybos/lib/string/strrchr.c @@ -0,0 +1,46 @@ +/*** +*strrchr.c - find last occurrence of character in string +* +* Copyright (c) 1985-1997, Microsoft Corporation. All rights reserved. +* +*Purpose: +* defines strrchr() - find the last occurrence of a given character +* in a string. +* +*******************************************************************************/ + + +/*** +*char *strrchr(string, ch) - find last occurrence of ch in string +* +*Purpose: +* Finds the last occurrence of ch in string. The terminating +* null character is used as part of the search. +* +*Entry: +* char *string - string to search in +* char ch - character to search for +* +*Exit: +* returns a pointer to the last occurrence of ch in the given +* string +* returns NULL if ch does not occurr in the string +* +*Exceptions: +* +*******************************************************************************/ + +char *strrchr(const char * string, int ch) +{ + char *start = (char *)string; + + while(*string++); /* find end of string */ + + /* search towards front */ + while(--string != start && *string != (char)ch); + + if(*string == (char)ch) /* char found ? */ + return (char *)string; + + return 0; +} diff --git a/Dump/hybos/lib/string/strrev.c b/Dump/hybos/lib/string/strrev.c new file mode 100644 index 0000000..6c564ab --- /dev/null +++ b/Dump/hybos/lib/string/strrev.c @@ -0,0 +1,47 @@ +/*** +*strrev.c - reverse a string in place +* +* Copyright (c) 1985-1997, Microsoft Corporation. All rights reserved. +* +*Purpose: +* defines _strrev() - reverse a string in place (not including +* '\0' character) +* +*******************************************************************************/ + +/*** +*char *_strrev(string) - reverse a string in place +* +*Purpose: +* Reverses the order of characters in the string. The terminating +* null character remains in place. +* +*Entry: +* char *string - string to reverse +* +*Exit: +* returns string - now with reversed characters +* +*Exceptions: +* +*******************************************************************************/ + +char *_strrev(char *string) +{ + char *start = string; + char *left = string; + char ch; + + while(*string++); /* find end of string */ + + string -= 2; + + while(left < string) + { + ch = *left; + *left++ = *string; + *string-- = ch; + } + + return start; +} diff --git a/Dump/hybos/lib/string/strset.c b/Dump/hybos/lib/string/strset.c new file mode 100644 index 0000000..4202021 --- /dev/null +++ b/Dump/hybos/lib/string/strset.c @@ -0,0 +1,10 @@ + +char *_strset(char *string, int val) +{ + char *start = string; + + while(*string) + *string++ = (char)val; + + return start; +} diff --git a/Dump/hybos/lib/string/strspn.c b/Dump/hybos/lib/string/strspn.c new file mode 100644 index 0000000..7298b5d --- /dev/null +++ b/Dump/hybos/lib/string/strspn.c @@ -0,0 +1,75 @@ +/*** +*strspn.c - find length of initial substring of chars from a control string +* +* Copyright (c) 1985-1997, Microsoft Corporation. All rights reserved. +* +*Purpose: +* defines strspn() - finds the length of the initial substring of +* a string consisting entirely of characters from a control string. +* +* defines strcspn()- finds the length of the initial substring of +* a string consisting entirely of characters not in a control string. +* +* defines strpbrk()- finds the index of the first character in a string +* that is not in a control string +* +*******************************************************************************/ + + +/*** +*int strspn(string, control) - find init substring of control chars +* +*Purpose: +* Finds the index of the first character in string that does belong +* to the set of characters specified by control. This is +* equivalent to the length of the initial substring of string that +* consists entirely of characters from control. The '\0' character +* that terminates control is not considered in the matching process. +* +*Entry: +* char *string - string to search +* char *control - string containing characters not to search for +* +*Exit: +* returns index of first char in string not in control +* +*Exceptions: +* +*******************************************************************************/ + +#include /* size_t */ + +size_t strspn(const char *string, const char *control) +{ + const unsigned char *str = (unsigned char *)string; + const unsigned char *ctrl = (unsigned char *)control; + + unsigned char map[32]; + int count; + + /* Clear out bit map */ + for(count=0; count<32; count++) + map[count] = 0; + + /* Set bits in control map */ + while(*ctrl) + { + map[*ctrl >> 3] |= (1 << (*ctrl & 7)); + ctrl++; + } + + /* 1st char NOT in control map stops search */ + if(*str) + { + count=0; + while(map[*str >> 3] & (1 << (*str & 7))) + { + count++; + str++; + } + + return count; + } + + return 0; +} diff --git a/Dump/hybos/lib/string/strstr.c b/Dump/hybos/lib/string/strstr.c new file mode 100644 index 0000000..bc34107 --- /dev/null +++ b/Dump/hybos/lib/string/strstr.c @@ -0,0 +1,54 @@ +/*** +*strstr.c - search for one string inside another +* +* Copyright (c) 1985-1997, Microsoft Corporation. All rights reserved. +* +*Purpose: +* defines strstr() - search for one string inside another +* +*******************************************************************************/ + +/*** +*char *strstr(string1, string2) - search for string2 in string1 +* +*Purpose: +* finds the first occurrence of string2 in string1 +* +*Entry: +* char *string1 - string to search in +* char *string2 - string to search for +* +*Exit: +* returns a pointer to the first occurrence of string2 in +* string1, or NULL if string2 does not occur in string1 +* +*Uses: +* +*Exceptions: +* +*******************************************************************************/ + +char *strstr(const char * str1, const char * str2) +{ + char *cp = (char *)str1; + char *s1, *s2; + + if(!*str2 ) + return (char *)str1; + + while(*cp) + { + s1 = cp; + s2 = (char *)str2; + + while(*s1 && *s2 && !(*s1-*s2)) + s1++, s2++; + + if(!*s2) + return cp; + + cp++; + } + + return 0; +} diff --git a/Dump/hybos/lib/string/tolower.c b/Dump/hybos/lib/string/tolower.c new file mode 100644 index 0000000..afc2c0e --- /dev/null +++ b/Dump/hybos/lib/string/tolower.c @@ -0,0 +1,9 @@ + +char *tolower(char* s) +{ + while(*s++) + if(*s >= 'A' && *s <= 'Z') + *s += 'a' - 'A'; + + return s; +} diff --git a/Dump/hybos/lib/string/toupper.c b/Dump/hybos/lib/string/toupper.c new file mode 100644 index 0000000..344820b --- /dev/null +++ b/Dump/hybos/lib/string/toupper.c @@ -0,0 +1,10 @@ + +char *toupper(char *s) +{ + char *c = '\0'; + while(*s++) + if(*s >= 'a' && *s <= 'z') + *s += 'A' - 'a'; + + return c; +} diff --git a/Dump/hybos/lib/util/Makefile b/Dump/hybos/lib/util/Makefile new file mode 100644 index 0000000..483190c --- /dev/null +++ b/Dump/hybos/lib/util/Makefile @@ -0,0 +1,32 @@ +.SUFFIXES: .asm + +# defines +MAKEFILE =Makefile +MAKEDEP =$(MAKEFILE) +INCDIR =../../include +NASM =nasm -f win32 -dUNDERBARS=1 -i$(INCDIR)/ +CC =gcc -g -Wall -W -O2 -nostdinc -fno-builtin -I$(INCDIR) + +UTIL =rand.o + +# This will be one level above where we are now +OBJ_DIR =objects + +OBJS =$(UTIL) + +# targets +all: $(OBJS) $(MAKEDEP) + +clean: + del ..\$(OBJ_DIR)\rand.o + +# implicit rules +.asm.o: + $(NASM) -o../$(OBJ_DIR)/$@ $< + +.c.o: + $(CC) -c -o../$(OBJ_DIR)/$@ $< + +# dependencies +rand.o: rand.c $(MAKEDEP) + diff --git a/Dump/hybos/lib/util/rand.c b/Dump/hybos/lib/util/rand.c new file mode 100644 index 0000000..c9188a7 --- /dev/null +++ b/Dump/hybos/lib/util/rand.c @@ -0,0 +1,56 @@ +/*** +*rand.c - random number generator +* +* Copyright (c) 1985-1997, Microsoft Corporation. All rights reserved. +* +*Purpose: +* defines rand(), srand() - random number generator +* +*******************************************************************************/ + +static long holdrand = 1L; + + +/*** +*void srand(seed) - seed the random number generator +* +*Purpose: +* Seeds the random number generator with the int given. Adapted from the +* BASIC random number generator. +* +*Entry: +* unsigned seed - seed to seed rand # generator with +* +*Exit: +* None. +* +*Exceptions: +* +*******************************************************************************/ + +void srand(unsigned int seed) +{ + holdrand = (long)seed; +} + + +/*** +*int rand() - returns a random number +* +*Purpose: +* returns a pseudo-random number 0 through 32767. +* +*Entry: +* None. +* +*Exit: +* Returns a pseudo-random number 0 through 32767. +* +*Exceptions: +* +*******************************************************************************/ + +int rand(void) +{ + return (((holdrand = holdrand * 214013L + 2531011L) >> 16) & 0x7fff); +} diff --git a/Dump/hybos/lib/x86/.inportb.c.swp b/Dump/hybos/lib/x86/.inportb.c.swp new file mode 100644 index 0000000..6532e11 --- /dev/null +++ b/Dump/hybos/lib/x86/.inportb.c.swp Binary files differ diff --git a/Dump/hybos/lib/x86/Makefile b/Dump/hybos/lib/x86/Makefile new file mode 100644 index 0000000..9039ed2 --- /dev/null +++ b/Dump/hybos/lib/x86/Makefile @@ -0,0 +1,47 @@ +.SUFFIXES: .asm + +# defines +MAKEFILE =Makefile +MAKEDEP =$(MAKEFILE) +INCDIR =../../include +NASM =nasm -f win32 -dUNDERBARS=1 -i$(INCDIR)/ +CC =gcc -g -Wall -W -O2 -nostdinc -fno-builtin -I$(INCDIR) + +X86 =disable.o \ + enable.o \ + inportb.o \ + outportb.o \ + inportw.o \ + outportw.o + +# This will be one level above where we are now +OBJ_DIR =objects + +OBJS =$(X86) + +# targets +all: $(OBJS) $(MAKEDEP) + +clean: + del ..\$(OBJ_DIR)\disable.o + del ..\$(OBJ_DIR)\enable.o + del ..\$(OBJ_DIR)\inportb.o + del ..\$(OBJ_DIR)\outportb.o + del ..\$(OBJ_DIR)\inportw.o + del ..\$(OBJ_DIR)\outportw.o + +# implicit rules +.asm.o: + $(NASM) -o../$(OBJ_DIR)/$@ $< + +.c.o: + $(CC) -c -o../$(OBJ_DIR)/$@ $< + +# dependencies +disable.o: disable.c $(MAKEDEP) +enable.o: enable.c $(MAKEDEP) +inportb.o: inportb.c $(MAKEDEP) +outportb.o: outportb.c $(MAKEDEP) +inportw.o: inportw.c $(MAKEDEP) +outportw.o: outportw.c $(MAKEDEP) + diff --git a/Dump/hybos/lib/x86/disable.c b/Dump/hybos/lib/x86/disable.c new file mode 100644 index 0000000..b31ef49 --- /dev/null +++ b/Dump/hybos/lib/x86/disable.c @@ -0,0 +1,13 @@ +/***************************************************************************** +*****************************************************************************/ +unsigned disable(void) +{ + unsigned ret_val; + + __asm__ __volatile__("pushfl\n" + "popl %0\n" + "cli" + : "=a"(ret_val) + :); + return ret_val; +} diff --git a/Dump/hybos/lib/x86/enable.c b/Dump/hybos/lib/x86/enable.c new file mode 100644 index 0000000..bc98632 --- /dev/null +++ b/Dump/hybos/lib/x86/enable.c @@ -0,0 +1,9 @@ +/***************************************************************************** +*****************************************************************************/ +void enable(void) +{ + __asm__ __volatile__("sti" + : + : + ); +} diff --git a/Dump/hybos/lib/x86/inportb.c b/Dump/hybos/lib/x86/inportb.c new file mode 100644 index 0000000..f3088fe --- /dev/null +++ b/Dump/hybos/lib/x86/inportb.c @@ -0,0 +1,11 @@ +/***************************************************************************** +*****************************************************************************/ +unsigned inportb(unsigned short port) +{ + unsigned char ret_val; + + __asm__ __volatile__("inb %1,%0" + : "=a"(ret_val) + : "d"(port)); + return ret_val; +} diff --git a/Dump/hybos/lib/x86/inportw.c b/Dump/hybos/lib/x86/inportw.c new file mode 100644 index 0000000..b541d59 --- /dev/null +++ b/Dump/hybos/lib/x86/inportw.c @@ -0,0 +1,13 @@ +unsigned short inportw(int port) +{ + register unsigned short r; + + __asm__ __volatile__ + ( + "inw %%dx, %%ax\n" + : "=a" (r) + : "d" (port) + ); + + return r; +} diff --git a/Dump/hybos/lib/x86/outportb.c b/Dump/hybos/lib/x86/outportb.c new file mode 100644 index 0000000..8346d67 --- /dev/null +++ b/Dump/hybos/lib/x86/outportb.c @@ -0,0 +1,8 @@ +/***************************************************************************** +*****************************************************************************/ +void outportb(unsigned port, unsigned val) +{ + __asm__ __volatile__("outb %b0,%w1" + : + : "a"(val), "d"(port)); +} diff --git a/Dump/hybos/lib/x86/outportw.c b/Dump/hybos/lib/x86/outportw.c new file mode 100644 index 0000000..5985172 --- /dev/null +++ b/Dump/hybos/lib/x86/outportw.c @@ -0,0 +1,9 @@ +void outportw(int port, unsigned short data) +{ + __asm__ __volatile__ + ( + "outw %%ax, %%dx\n\t" + : + : "a" (data), "d" (port) + ); +} diff --git a/Dump/hybos/src/._krnl.h.swp b/Dump/hybos/src/._krnl.h.swp new file mode 100644 index 0000000..b54106a --- /dev/null +++ b/Dump/hybos/src/._krnl.h.swp Binary files differ diff --git a/Dump/hybos/src/.debug.c.swp b/Dump/hybos/src/.debug.c.swp new file mode 100644 index 0000000..d6738a0 --- /dev/null +++ b/Dump/hybos/src/.debug.c.swp Binary files differ diff --git a/Dump/hybos/src/.kbd.c.swp b/Dump/hybos/src/.kbd.c.swp new file mode 100644 index 0000000..977b87d --- /dev/null +++ b/Dump/hybos/src/.kbd.c.swp Binary files differ diff --git a/Dump/hybos/src/.krnl1m.ld.swp b/Dump/hybos/src/.krnl1m.ld.swp new file mode 100644 index 0000000..f95cad1 --- /dev/null +++ b/Dump/hybos/src/.krnl1m.ld.swp Binary files differ diff --git a/Dump/hybos/src/.main.c.swp b/Dump/hybos/src/.main.c.swp new file mode 100644 index 0000000..1dd3750 --- /dev/null +++ b/Dump/hybos/src/.main.c.swp Binary files differ diff --git a/Dump/hybos/src/.ming.mak.swp b/Dump/hybos/src/.ming.mak.swp new file mode 100644 index 0000000..feda0c7 --- /dev/null +++ b/Dump/hybos/src/.ming.mak.swp Binary files differ diff --git a/Dump/hybos/src/.sched.c.swp b/Dump/hybos/src/.sched.c.swp new file mode 100644 index 0000000..c75ddf3 --- /dev/null +++ b/Dump/hybos/src/.sched.c.swp Binary files differ diff --git a/Dump/hybos/src/.tasks.c.swp b/Dump/hybos/src/.tasks.c.swp new file mode 100644 index 0000000..abe0e47 --- /dev/null +++ b/Dump/hybos/src/.tasks.c.swp Binary files differ diff --git a/Dump/hybos/src/.video.c.swp b/Dump/hybos/src/.video.c.swp new file mode 100644 index 0000000..50cb716 --- /dev/null +++ b/Dump/hybos/src/.video.c.swp Binary files differ diff --git a/Dump/hybos/src/Makefile b/Dump/hybos/src/Makefile new file mode 100644 index 0000000..ab24d4d --- /dev/null +++ b/Dump/hybos/src/Makefile @@ -0,0 +1,18 @@ +#MAKEFILE=ming.mak +MAKEFILE=Makefile + +all: + make -f $(MAKEFILE) -C kernel + make -f $(MAKEFILE) -C mm + make -f $(MAKEFILE) -C esh + +install: + make -f $(MAKEFILE) -C mm + make -f $(MAKEFILE) -C esh + make -f $(MAKEFILE) -C kernel install + +clean: + make -f $(MAKEFILE) -C kernel clean + make -f $(MAKEFILE) -C mm clean + make -f $(MAKEFILE) -C esh clean + diff --git a/Dump/hybos/src/README b/Dump/hybos/src/README new file mode 100644 index 0000000..dfca7af --- /dev/null +++ b/Dump/hybos/src/README @@ -0,0 +1,20 @@ +Directory structure layout for HybOS + +kernel + HybOS kernel source +keymaps + Keyboard keymaps +objects + .o files +fs + Filesystem source +etc + /etc entries for installed system +test + Various system tests +mm + Memory management source +osh + OpenSHell source +esh + ESHell (HybOS Emergency Shell) source diff --git a/Dump/hybos/src/esh/Makefile b/Dump/hybos/src/esh/Makefile new file mode 100644 index 0000000..48f19d4 --- /dev/null +++ b/Dump/hybos/src/esh/Makefile @@ -0,0 +1,34 @@ +.SUFFIXES: .asm + +# defines +MAKEFILE =Makefile +MAKEDEP =$(MAKEFILE) +INCDIR =../../include +LDSCRIPT =../../krnl1m.ld +NASM =nasm -f win32 -dUNDERBARS=1 -i$(INCDIR)/ +CC =gcc -g -Wall -W -O2 -nostdinc -fno-builtin -I$(INCDIR) +LD =ld -g -T $(LDSCRIPT) -nostdlib +LIBC =../../lib/libc.a + +OBJS =esh.o + +OBJS_DEP =*.o + +OBJ_DIR =objects + +# targets +all: $(OBJS) $(MAKEDEP) + +clean: + del ..\$(OBJ_DIR)\esh.o + +# implicit rules +.asm.o: + $(NASM) -o../$(OBJ_DIR)/$@ $< + +.c.o: + $(CC) -c -o../$(OBJ_DIR)/$@ $< + +# dependencies +esh.o: esh.c $(MAKEDEP) + diff --git a/Dump/hybos/src/esh/esh.c b/Dump/hybos/src/esh/esh.c new file mode 100644 index 0000000..5df2ced --- /dev/null +++ b/Dump/hybos/src/esh/esh.c @@ -0,0 +1,372 @@ +/** + * esh.c + * + * Error SHell for HybOS + * + * Exports: + * None. + * + * Imports: + * None. + * + * Description: + * Since esh is called on a new thread in user-space and not in + * kernel-space, imports and exports are not necessary. All the + * kernel needs to know is what functions to call when the + * keyboard buffer has been filled (this even happens when the + * user presses the EOL key, which is the ENTER key on either + * the keypad or the "normal" keyboard). + */ + +#include +#include +#include +#include +#include + +void dumpheapk(void); + +ESHCOMMANDS eshCommands[COMMAND_COUNT]; + + +/** + * keyDown() + * + * This function is called when a key is pressed and is called + * on a new thread which resides in user-space so that esh + * cannot lock up the kernel. + * + * @param unsigned Which key was pressed. See keyboard.h + * + * @return void + */ +void keyDown(unsigned key) +{ + key = key; /* to shut gcc up */ +} + +/** + * keyUp() + * + * This function is called when a key is released. + * + * @param unsigned Which key was released. See keyboard.h + * + * @return void + */ +void keyUp(unsigned key) +{ + key = key; /* to shut gcc up */ +} + +void initCommands(void) +{ + eshCommands[0].minparams = 0; + eshCommands[0].maxparams = 0; + strcpy(eshCommands[0].command, "dumpheap\0"); + strcpy(eshCommands[0].params[0], "-h\0"); + strcpy(eshCommands[0].description, "Print listing of heap usage and status.\0"); + + eshCommands[1].minparams = 1; + eshCommands[1].maxparams = MAX_PARAMS; + strcpy(eshCommands[1].params[0], "-h\0"); + strcpy(eshCommands[1].command, "echo\0"); + strcpy(eshCommands[1].description, "Echo a line of text to the terminal.\0"); + + /*this will be called with either "help" or "help command" */ + eshCommands[2].minparams = 0; + eshCommands[2].maxparams = 1; + strcpy(eshCommands[2].params[0], "-h\0"); + strcpy(eshCommands[2].command, "help\0"); + strcpy(eshCommands[2].description, "Displays general help menu or help on specific command.\0"); + + /* -r|-h [time] */ + eshCommands[3].minparams = 1; + eshCommands[3].maxparams = 2; + strcpy(eshCommands[3].command, "shutdown\0"); + strcpy(eshCommands[3].params[0], "-r\0"); + strcpy(eshCommands[3].params[1], "-h\0"); + strcpy(eshCommands[3].params[2], "NOW\0"); + strcpy(eshCommands[3].description, "Halt or restart the system.\0"); + + /* clear screen */ + eshCommands[4].minparams = 0; + eshCommands[4].maxparams = 0; + strcpy(eshCommands[4].params[0], "-h\0"); + strcpy(eshCommands[4].command, "cls\0"); + strcpy(eshCommands[4].description, "Clears the terminal of all output.\0"); + + /* print working directory */ + eshCommands[5].minparams = 0; + eshCommands[5].maxparams = 0; + strcpy(eshCommands[5].params[0], "-h\0"); + strcpy(eshCommands[5].command, "pwd\0"); + strcpy(eshCommands[5].description, "Prints the current working directory.\0"); +} + +/** + * mapCommand() + * + * Used internally by esh to map a command to it's zero-based + * index of commands. + * + * @param char * the entire line of the command + * + * @return int index of command entry if found, otherwise -1 + */ +int mapCommand(char *cmd) +{ + int i; /* for our loops */ + int params; /* number of parameters found for the command */ + int previdx; /* previous index */ + char cmdName[MAX_LEN]; /* name of the command */ + + i = 0; + previdx = 0; + params = 0; + + /** + * Loop while cmd[i] is not a space + */ + i = 0; + for(i = 0; i < (int)strlen(cmd); i++) + { + if(cmd[i] == ' ') + break; + } + + strncpy(cmdName, cmd, i); + cmdName[i] = '\0'; + + for(i = 0; i < COMMAND_COUNT; i++) + { + if(!strcmp(eshCommands[i].command, cmdName)) + return i; + } + + return -1; +} + +/** + * isParam() + * + * Determines if the supplied parameter is valid for the + * given command. + * + * @param int index of command + * @param char * command string + * + * @return bool true if parameter is valid, false otherwise + */ +bool isParam(int argc, char *argv) +{ + int i; + + for(i = 0; i < MAX_PARAMS; i++) + { + if(!strcmp(eshCommands[argc].params[i], argv)) + return true; + } + + return false; +} + +/** + * mapParams() + * + * Maps each parameter to the pars struct + * + * @param char * Buffer from the command line + * @param struct Parameter structure + * + * @return int Number of command line parameters (arguments) parsed + */ +int mapParams(char *buf, ESHCURRCOMMAND *pars) +{ + int i; /* for our loops */ + int previdx; /* previous index */ + int idx; /* current index */ + int j; /* loops */ + + i = 0; + j = 0; + previdx = 0; + pars->count = 0; + + previdx = mapCommand(buf); + + if(previdx == -1) + return 0; + + strcpy(pars->param[0], eshCommands[previdx].command); + j++; + pars->count++; + + i = 0; + idx = 0; + + for(i = 0; i < (int)strlen(buf); i++) + { + /* we have encountered a seperator */ + if(buf[i] == ' ') + { + if(j > MAX_PARAMS) + break; + + i++; /* skip one space */ + + idx = i; + + if(buf[i] == '"') + { + i++; + idx++; + + while(buf[i] != '"' && i != (int)strlen(buf)) + i++; + + strncpy(pars->param[j], &buf[idx], (i - idx)); + pars->param[j][i - idx] = '\0'; + + idx = i; + j++; + pars->count++; + } + else + { + while(buf[i] != ' ' && i != (int)strlen(buf)) + i++; + + strncpy(pars->param[j], &buf[idx], i - idx); + pars->param[j][i - idx] = '\0'; + i = idx; + j++; + pars->count++; + } + } + } + + return pars->count; +} + +/** + * processCommand() + * + * This function is called when the user has pressed + * the ENTER key. + * + * @param char * The contents of the current buffer or NULL if empty + * @param int Size of the buffer (number of characters) + * + * @return void + */ +void processCommand(char *line, int count) +{ + int i; + int cmd; /* stores the numeric index of the command */ + ESHCURRCOMMAND params; + + count = count; /* to shut gcc up */ + + /*for(i = 0; i < MAX_PARAMS; i++) + params.param[i][0] = '\0';*/ + params.param[0][0] = '\0'; + + initCommands(); + + cmd = mapCommand(line); + mapParams(line, ¶ms); + + switch(cmd) + { + case 0: /* dumpheap */ + dumpheapk(); + //testheap(); + break; + case 1: /* echo */ + for(i = 1; i < params.count; i++) + printf("%s", params.param[i]); + + printf("\n"); + break; + case 2: /* help */ + if(params.count == 1) + { + printf("HybOS EShell Commands:\n"); + for(i = 0; i < COMMAND_COUNT; i++) + if(strlen(eshCommands[i].command) > 0) + printf("%10s %-s\n", eshCommands[i].command, eshCommands[i].description); + } + else + { + cmd = mapCommand(params.param[0]); + mapParams(params.param[1], ¶ms); + + //if(isParam(cmd, params.param[1])) + if(cmd != -1) + { + printf("Usage: %s %s\n", params.param[0], eshCommands[cmd].params[1]); + } + else + printf("esh: '%s' not found.\n", params.param[1]); + } + break; + default: + if(strlen(params.param[0]) > 0 && strcmp(params.param[0], "help")) + printf("esh: '%s' not found.\n", params.param[0]); + else + printf("esh: '%s' not found.\n", &line[0]); + break; + } + + /*for(i = 0; i < params.count; i++) + printf("param[%i]: %s\n", i, params.param[i]);*/ + + //if(isParam(3, ¶ms.param[1])) + // printf("valid parameter\n"); + //else + // printf("invalid parameter\n"); + + return; + + if(!strcmp(line, "dumpheap")) + dumpheapk(); + else if(!strncmp(line, "echo", 4)) + printf("%s\n", line[4] == ' ' ? &line[5] : &line[4]); + else if(!strcmp(line, "help")) + { + printf("HybOS EShell Commands:\n"); + printf("dumpheap\tPrint listing of heap usage and status\n"); + printf("testheap\tTest the heap and print out results\n"); + printf("shutdown -r\tRestart the system.\n"); + printf("pwd\t\tPrint the current working directory.\n"); + } + else if(!strncmp(line, "shutdown", 8)) + { + if(strlen(line) > 9 && !strncmp(&line[9], "-r", 2)) + { + printf("\nSystem shutdown from vtty%u\n", get_current_vc()); + printf("Restarting..."); + //reboot(); + } + else + { + if((strlen(line) > 9) && (strlen(&line[9]) > 0)) + printf("shutdown: Invalid argument \"%s\".\n", &line[9]); + else + printf("Usage: shutdown -r\n"); + } + } + else if((strlen(line) > 0) && (!strcmp(line, "cls"))) + { + printf("\x1B[2J"); + } + else if((strlen(line) >= 8) && (!strcmp(line, "testheap"))) + { + //testheap(); + } + else if((strlen(line) > 0) && (!strcmp(line, "pwd"))) + printf("/\n"); + else if(strlen(line) > 0) + printf("eshell: \"%s\" not found.\n", line); +} diff --git a/Dump/hybos/src/etc/fstab b/Dump/hybos/src/etc/fstab new file mode 100644 index 0000000..5de9431 --- /dev/null +++ b/Dump/hybos/src/etc/fstab @@ -0,0 +1,4 @@ +# Poor man's File System Table. + +root=/dev/ROOT +usr=/dev/USR diff --git a/Dump/hybos/src/etc/group b/Dump/hybos/src/etc/group new file mode 100644 index 0000000..4c7996a --- /dev/null +++ b/Dump/hybos/src/etc/group @@ -0,0 +1,10 @@ +operator:*:0: +daemon:*:1: +bin:*:2: +other:*:3: +tty:*:4: +uucp:*:5: +news:*:6: +ftp:*:7: +kmem:*:8: +nogroup:*:99: diff --git a/Dump/hybos/src/etc/passwd b/Dump/hybos/src/etc/passwd new file mode 100644 index 0000000..1560b30 --- /dev/null +++ b/Dump/hybos/src/etc/passwd @@ -0,0 +1,8 @@ +root:##root:0:0::/: +daemon:*:1:1::/etc: +bin:##root:2:0:Binaries:/usr/src:/usr/bin/ash +uucp:*:5:5:UNIX to UNIX copy:/usr/spool/uucp:/usr/bin/uucico +news:*:6:6:Usenet news:/usr/spool/news: +ftp:*:7:7:Anonymous FTP:/usr/ftp: +nobody:*:9999:99::/tmp: +ast:*:8:3:Andrew S. Tanenbaum:/usr/ast: diff --git a/Dump/hybos/src/etc/profile b/Dump/hybos/src/etc/profile new file mode 100644 index 0000000..741e407 --- /dev/null +++ b/Dump/hybos/src/etc/profile @@ -0,0 +1,3 @@ +# Set timezone for Middle European Time. + +TZ='MET-1MET DST,M3.5.0/2,M9.5.0/3' export TZ diff --git a/Dump/hybos/src/etc/protocols b/Dump/hybos/src/etc/protocols new file mode 100644 index 0000000..313d915 --- /dev/null +++ b/Dump/hybos/src/etc/protocols @@ -0,0 +1,19 @@ +# +# Internet (IP) protocols +# +# @(#)protocols 8.1 (Berkeley) 6/9/93 +# +ip 0 IP # internet protocol, pseudo protocol number +icmp 1 ICMP # internet control message protocol +igmp 2 IGMP # internet group management protocol +ggp 3 GGP # gateway-gateway protocol +tcp 6 TCP # transmission control protocol +egp 8 EGP # exterior gateway protocol +pup 12 PUP # PARC universal packet protocol +udp 17 UDP # user datagram protocol +hmp 20 HMP # host monitoring protocol +xns-idp 22 XNS-IDP # Xerox NS IDP +rdp 27 RDP # reliable data protocol +iso-tp4 29 ISO-TP4 # ISO Transport Protocol Class 4 +iso-ip 80 ISO-IP # ISO Internet Protocol +encap 98 ENCAP # RFC1241 encapsulation diff --git a/Dump/hybos/src/etc/rc b/Dump/hybos/src/etc/rc new file mode 100644 index 0000000..d9a3a1d --- /dev/null +++ b/Dump/hybos/src/etc/rc @@ -0,0 +1,24 @@ +# This file performs various system initializations. + +umask 022 +PATH=/usr/local/bin:/bin:/usr/bin +export PATH + +# National keyboard? +test -f /etc/keymap && loadkeys /etc/keymap + +# Set timezone. (If the clock tells GMT then put this after 'date'.) +. /etc/profile + +# Try to read the hardware real-time clock, if there is one, to set the date +date `readclock` + +# Initialize files. +printroot >/etc/mtab # /etc/mtab keeps track of mounts +>/etc/utmp # /etc/utmp keeps track of logins + +# /etc/fstab lists the root, tmp and usr devices. +. /etc/fstab + +# Any messages? +test -f /etc/issue && cat /etc/issue diff --git a/Dump/hybos/src/etc/services b/Dump/hybos/src/etc/services new file mode 100644 index 0000000..9bcd523 --- /dev/null +++ b/Dump/hybos/src/etc/services @@ -0,0 +1,85 @@ +# +# Network services, Internet style +# +# @(#)services 8.1 (Berkeley) 6/9/93 +# +tcpmux 1/tcp # TCP port multiplexer (RFC1078) +echo 7/tcp +echo 7/udp +discard 9/tcp sink null +discard 9/udp sink null +systat 11/tcp users +daytime 13/tcp +daytime 13/udp +netstat 15/tcp +qotd 17/tcp quote +chargen 19/tcp ttytst source +chargen 19/udp ttytst source +ftp 21/tcp +telnet 23/tcp +smtp 25/tcp mail +time 37/tcp timserver +time 37/udp timserver +rlp 39/udp resource # resource location +nameserver 42/tcp name # IEN 116 +whois 43/tcp nicname +domain 53/tcp nameserver # name-domain server +domain 53/udp nameserver +mtp 57/tcp # deprecated +# Bootp experimental (sellgren@vangogh) +bootp 67/udp # bootp server +#bootpc 68/udp # bootp client +# +tftp 69/udp +rje 77/tcp netrjs +finger 79/tcp +http 80/tcp # World Wide Web +link 87/tcp ttylink +supdup 95/tcp +hostnames 101/tcp hostname # usually from sri-nic +tsap 102/tcp # part of ISODE. +#csnet-cs 105/? +pop 110/tcp postoffice +sunrpc 111/tcp +sunrpc 111/udp +auth 113/tcp authentication +sftp 115/tcp +uucp-path 117/tcp +nntp 119/tcp readnews untp # USENET News Transfer Protocol +ntp 123/udp +snmp 161/udp +snmp-trap 162/udp +# +# UNIX specific services +# +exec 512/tcp +biff 512/udp comsat +login 513/tcp +who 513/udp whod +shell 514/tcp cmd # no passwords used +syslog 514/udp +printer 515/tcp spooler # line printer spooler +talk 517/udp +ntalk 518/udp +route 520/udp router routed +timed 525/udp timeserver +tempo 526/tcp newdate +courier 530/tcp rpc +conference 531/tcp chat +netnews 532/tcp readnews +netwall 533/udp # -for emergency broadcasts +uucp 540/tcp uucpd # uucp daemon +rdist 541/tcp rdistd # rdist daemon +remotefs 556/tcp rfs_server rfs # Brunhoff remote filesystem + +ingreslock 1524/tcp +# +# Kerberos (Project Athena/MIT) services +# +kerberos 750/udp kdc # Kerberos (server) udp +kerberos 750/tcp kdc # Kerberos (server) tcp +krbupdate 760/tcp kreg # Kerberos registration +kpasswd 761/tcp kpwd # Kerberos "passwd" +klogin 543/tcp # Kerberos rlogin +eklogin 2105/tcp # Kerberos encrypted rlogin +kshell 544/tcp krcmd # Kerberos remote shell diff --git a/Dump/hybos/src/etc/shadow b/Dump/hybos/src/etc/shadow new file mode 100644 index 0000000..15fa36d --- /dev/null +++ b/Dump/hybos/src/etc/shadow @@ -0,0 +1 @@ +root::0:0::: diff --git a/Dump/hybos/src/etc/termcap b/Dump/hybos/src/etc/termcap new file mode 100644 index 0000000..c5f89b4 --- /dev/null +++ b/Dump/hybos/src/etc/termcap @@ -0,0 +1,64 @@ +mx|minix|minix console:\ + :am:xn:bs:\ + :co#80:li#25:\ + :is=\E[0m:\ + :cd=\E[0J:cl=\E[H\E[0J:\ + :so=\E[7m:se=\E[0m:\ + :us=\E[4m:ue=\E[0m:\ + :mb=\E[5m:md=\E[1m:\ + :mr=\E[7m:me=\E[0m:\ + :sr=\EM:\ + :cm=\E[%i%d;%dH:\ + :ho=\E[H:\ + :al=\E[L:AL=\E[%dL:\ + :ce=\E[K:\ + :DC=\E[%dP:dc=\E[P:\ + :DL=\E[%dM:dl=\E[M:\ + :DO=\E[%dB:do=\E[B:\ + :IC=\E[%d@:ic=\E[@:\ + :it#8:\ + :le=^H:LE=\E[%dD:nd=\E[C:\ + :ri=\E[C:RI=\E[%dC:\ + :up=\E[A:UP=\E[%dA:\ + :ku=\E[A:kd=\E[B:\ + :kl=\E[D:kr=\E[C:\ + :kh=\E[H:\ + :k0=\E[Y:l0=End:\ + :k1=\E[V:l1=PgUp:\ + :k2=\E[U:l2=PgDn:\ + :k3=\E[T:l3=Num +:\ + :k4=\E[S:l4=Num -:\ + :k5=\E[G:l5=Num 5: +du|dialup|Dialup line:\ + :bs:co#80:li#24: +db|dumb|Really dumb terminal:\ + :bs:co#80:li#24: +lp|lp|Line Printer:\ + :co#80:li#66: +li|ansi|Ansi standard crt:\ + :am:bs:cd=\E[J:ce=\E[K:cl=\E[2J\E[H:cm=\E[%i%d;%dH:co#80:\ + :dn=\E[B:me=\E[0m:mb=\E[5m:mr=\E[7m:md=\E[1m:ho=\E[H:li#24:\ + :nd=\E[C:ms:pt:so=\E[7m:se=\E[0m:us=\E[4m:ue=\E[0m:up=\E[A:\ + :kb=^h:ku=\E[A:kd=\E[B:kl=\E[D:kr=\E[C: +vs|xterm|xterms|vs100|xterm terminal emulator (X window system):\ + :am:cr=^M:do=^J:nl=^J:bl=^G:le=^H:ho=\E[H:\ + :co#80:li#24:cl=\E[H\E[2J:bs:cm=\E[%i%d;%dH:nd=\E[C:up=\E[A:\ + :ce=\E[K:cd=\E[J:so=\E[7m:se=\E[m:us=\E[4m:ue=\E[m:\ + :md=\E[1m:mr=\E[7m:me=\E[m:\ + :ku=\E[A:kd=\E[B:kr=\E[C:kl=\E[D:kb=^H:\ + :k1=\E[P:k2=\E[Q:k3=\E[R:k4=\E[S:ta=^I:pt:sf=\n:sr=\EM:\ + :al=\E[L:dl=\E[M:ic=\E[@:dc=\E[P:\ + :MT:ks=\E[?1h\E=:ke=\E[?1l\E>:\ + :is=\E[r\E[m\E[2J\E[H\E[?7h\E[?1;3;4;6l:\ + :rs=\E[r\E<\E[m\E[2J\E[H\E[?7h\E[?1;3;4;6l:xn:\ + :AL=\E[%dL:DL=\E[%dM:IC=\E[%d@:DC=\E[%dP:\ + :hs:ts=\E]2;:fs=^G:ds=\E]2;^G: +d0|vt100|vt100-am|vt100am|dec-vt100|dec vt100:\ + :do=^J:co#80:li#24:cl=\E[;H\E[2J:sf=\ED:\ + :le=^H:bs:am:cm=\E[%i%d;%dH:nd=\E[C:up=\E[A:\ + :ce=\E[K:cd=\E[J:so=\E[7m:se=\E[m:us=\E[4m:ue=\E[m:\ + :md=\E[1m:mr=\E[7m:mb=\E[5m:me=\E[m:is=\E[1;24r\E[24;1H:\ + :rs=\E>\E[?3l\E[?4l\E[?5l\E[?7h\E[?8h:ks=\E[?1h\E=:ke=\E[?1l\E>:\ + :ku=\EOA:kd=\EOB:kr=\EOC:kl=\EOD:kb=^H:\ + :ho=\E[H:k1=\EOP:k2=\EOQ:k3=\EOR:k4=\EOS:pt:sr=\EM:vt#3:xn:\ + :sc=\E7:rc=\E8:cs=\E[%i%d;%dr: diff --git a/Dump/hybos/src/etc/ttytab b/Dump/hybos/src/etc/ttytab new file mode 100644 index 0000000..cd566f5 --- /dev/null +++ b/Dump/hybos/src/etc/ttytab @@ -0,0 +1,13 @@ +# ttytab - terminals +# +# Device Type Program Init +console hybos getty +ttyc1 hybos getty +ttyc2 hybos getty +ttyc3 hybos getty +tty00 unknown +tty01 unknown +ttyp0 network +ttyp1 network +ttyp2 network +ttyp3 network diff --git a/Dump/hybos/src/fs/buf.h b/Dump/hybos/src/fs/buf.h new file mode 100644 index 0000000..0de78da --- /dev/null +++ b/Dump/hybos/src/fs/buf.h @@ -0,0 +1,31 @@ +#ifndef _BUF_H +#define _BUF_H + +#include + +typedef struct buf +{ + union + { + char b__data[BLOCK_SIZE]; /* ordinary user data */ + direct b__dir[NR_DIR_ENTRIES]; /* directory block */ + zone1_t b__v1_ind[V1_INDIRECTS]; /* V1 indirect block */ + zone_t b__v2_ind[V2_INDIRECTS]; /* V2 indirect block */ + d1_inode b__v1_ino[V1_INODES_PER_BLOCK]; /* V1 inode block */ + d2_inode b__v2_ino[V2_INODES_PER_BLOCK]; /* V2 inode block */ + bitchunk_t b__bitmap[BITMAP_CHUNKS]; /* bit map block */ + } b; + + /** + * Header portion of the buffer + */ + struct buf *b_next; /* used to link all free bufs in a chain */ + struct buf *b_prev; /* used to link all free bufs the other way */ + struct buf *b_hash; /* used to link all bufs on hash chains */ + block_t b_blocknr; /* block number of its (minor) device */ + dev_t b_dev; /* major | minor device where block resides */ + char b_dirt; /* CLEAN or DIRTY */ + char b_count; /* number of users of this buffer */ +} buf[NR_BUFFS]; + +#endif /* _BUF_H */ diff --git a/Dump/hybos/src/kernel/Makefile b/Dump/hybos/src/kernel/Makefile new file mode 100644 index 0000000..5e7a2d1 --- /dev/null +++ b/Dump/hybos/src/kernel/Makefile @@ -0,0 +1,73 @@ +.SUFFIXES: .asm + +# defines +MAKEFILE =Makefile +MAKEDEP =$(MAKEFILE) +INCDIR =../../include +LDSCRIPT =../krnl1m.ld +NASM =nasm -f elf -i$(INCDIR)/ +CC =gcc -g -Wall -W -O2 -nostdinc -fno-builtin -I$(INCDIR) +LD =ld -g -T $(LDSCRIPT) -nostdlib +#LD =D:/cygwin/usr/cross/bin/i586-elf-ld.exe -g -T $(LDSCRIPT) -nostdlib +LIBC =../../lib/libc.a + +OBJS =debug.o \ + main.o \ + kstart.o \ + keyboard.o \ + sched.o \ + tasks.o \ + video.o \ + bootlog.o +# cpu.o +OBJS_DEP =*.o + +OBJ_DIR =objects + +# targets +all: kernel.bin + +install: kernel.bin + copy ..\..\boot\kernel.bin a:\kernel.bin + +clean: + del ..\$(OBJ_DIR)\debug.o + del ..\$(OBJ_DIR)\keyboard.o + del ..\$(OBJ_DIR)\kstart.o + del ..\$(OBJ_DIR)\main.o + del ..\$(OBJ_DIR)\sched.o + del ..\$(OBJ_DIR)\tasks.o + del ..\$(OBJ_DIR)\video.o + del ..\..\boot\kernel.bin + del ..\$(OBJ_DIR)\kernel.dis + del ..\$(OBJ_DIR)\kernel.sym + del ..\$(OBJ_DIR)\bootlog.o +# del ..\$(OBJ_DIR)\cpu.o + +# implicit rules +.asm.o: + $(NASM) -o../$(OBJ_DIR)/$@ $< + +.c.o: + $(CC) -c -o../$(OBJ_DIR)/$@ $< + +# dependencies +kstart.o: kstart.asm $(MAKEDEP) +main.o: main.c $(MAKEDEP) +video.o: video.c $(MAKEDEP) +debug.o: debug.c $(MAKEDEP) +kbd.o: kbd.c $(MAKEDEP) +sched.o: sched.c $(MAKEDEP) +tasks.o: tasks.c $(MAKEDEP) +bootlog.o: bootlog.c $(MAKEDEP) +#cpu.o: cpu.c $(MAKEDEP) + +# explicit rules +$(LIBC): ../../lib/$(MAKEFILE) + make -C ../../lib -f $(MAKEFILE) + +kernel.bin: $(OBJS) $(LDSCRIPT) $(LIBC) $(MAKEDEP) + $(LD) -o../../boot/$@ ../$(OBJ_DIR)/*.o $(LIBC) + objdump --source ../../boot/$@ >../$(OBJ_DIR)/kernel.dis + nm --line-numbers ../../boot/$@ | sort >../$(OBJ_DIR)/kernel.sym + strip ../../boot/$@ diff --git a/Dump/hybos/src/kernel/_krnl.h b/Dump/hybos/src/kernel/_krnl.h new file mode 100644 index 0000000..8354cca --- /dev/null +++ b/Dump/hybos/src/kernel/_krnl.h @@ -0,0 +1,131 @@ +#ifndef __TL__KRNL_H +#define __TL__KRNL_H + +//#ifdef __cplusplus +//extern "C" +//{ +//#endif + +#include /* jmp_buf */ + +#define MAX_VC 12 /* maximum number of virtual terminals */ + +/** + * CPU error codes + */ +#define _K_CPU_DBZ 0 /* Divide by zero */ +#define _K_CPU_SS 1 /* Single Step */ +#define _K_CPU_NMI 2 /* Non-maskable (NMI) */ +#define _K_CPU_BPX 3 /* Breakpoint */ +#define _K_CPU_OFT 4 /* Overflow trap */ +#define _K_CPU_BND 5 /* BOUND range exceeded */ +#define _K_CPU_IOP 6 /* Invalid opcode */ +#define _K_CPU_CNA 7 /* Coprocessor not available */ +#define _K_CPU_DFE 8 /* Double fault exception */ +#define _K_CPU_CSO 9 /* Coprocessor segment overrun */ +#define _K_CPU_CPE 10 /* Coprocessor error */ +#define _K_CPU_ITS 0x0A /* Invalid task state management */ +#define _K_CPU_SNP 0x0B /* Segment not present */ +#define _K_CPU_SEX 0x0C /* Stack exception (or illicit sex) */ +#define _K_CPU_GPF 0x0D /* General protection exception */ +#define _K_CPU_PGF 0x0E /* Page fault */ + +/** + * Interrupt table + */ +#define _K_IRQ_TIMER 0x08 /* timer (55ms intervals, 18.21590/sec) */ +#define _K_IRQ_KEYBOARD 0x09 /* keyboard service required */ +#define _K_IRQ_S8259 0x0A /* slave 8259 or EGA/VGA vertical retrace */ +#define _K_IRQ_COM2 0x0B /* COM2 service required (PS/2 MCA COM3-COM8) */ +#define _K_IRQ_COM1 0x0C /* COM1 service required */ +#define _K_IRQ_HDDREQ 0x0D /* fixed disk or data request from LPT2 */ +#define _K_IRQ_FDDSERV 0x0E /* floppy disk service required */ +#define _K_IRQ_LPT1REQ 0x0F /* data request from LPT1 */ +#define _K_IRQ_VIDEO 0x10 /* video (int 10h) */ +#define _K_IRQ_EQPDET 0x11 /* equipment determination (int 11h) */ +#define _K_IRQ_MEMORY 0x12 /* memory size (int 12h) */ +#define _K_IRQ_DIO 0x13 /* disk I/O service (int 13h) */ +#define _K_IRQ_SERIAL 0x14 /* serial communications (int 14h) */ +#define _K_IRQ_SYSTEM 0x15 /* system services, cassette (int 15h) */ +#define _K_IRQ_KBDSERV 0x16 /* keyboard services (int 16h) */ +#define _K_IRQ_LPT 0x17 /* parallel printer (int 17h) */ +#define _K_IRQ_ROM 0x18 /* ROM BASIC loader */ +#define _K_IRQ_BTSTRAP 0x19 /* bootstrap loader (unreliable, int 19h) */ +#define _K_IRQ_TOD 0x1A /* time of day (int 1A) */ +#define _K_IRQ_CBREAK 0x1B /* user defined ctrl-break handler (int 1B) */ +#define _K_IRQ_TICK 0x1C /* user defined clock tick handler (int 1C) */ +#define _K_IRQ_VIDEOP 0x1D /* 6845 video parameter pointer */ +#define _K_IRQ_DISKPARAM 0x1E /* diskette parameter pointer (base table) */ +#define _K_IRQ_GCHTBL 0x1F /* graphics character table */ +#define _K_IRQ_HDD 0x40 /* hard disk */ +#define _K_IRQ_FIXEDD0 0x41 /* fixed disk 0 parameters pointer (int 13h, int 9h) */ +#define _K_IRQ_RELVID 0x42 /* relocated video handler (EGA/VGA/PS) */ +#define _K_IRQ_UFT 0x43 /* user font table (EGA/VGA/PS) */ +#define _K_IRQ_GRAPH 0x44 /* first 128 graphics characters (also Netware) */ +#define _K_IRQ_FIXED1 0x46 /* fixed disk 1 parameters ptr (int 13h, int 9h/int 41h) */ +#define _K_IRQ_PCJR 0x48 /* PCjr cordless keyboard translation */ +#define _K_IRQ_PCJRSCAN 0x49 /* PCjr non-keyboard scancode translation table */ +#define _K_IRQ_USERALARM 0x4A /* user alarm (int 4A) */ +#define _K_IRQ_PALARM 0x50 /* periodic alarm timer (PS/2) */ +#define _K_IRQ_GSS 0x59 /* GSS computer graphics interface */ +#define _K_IRQ_BIOSEP 0x5A /* cluster adapter BIOS entry point */ +#define _K_IRQ_CADAPBT 0x5B /* cluster adapter boot */ +#define _K_IRQ_NETBIOS 0x5C /* NETBIOS interface, TOPS interface */ +#define _K_IRQ_EMS 0x67 /* LIM/EMS specifications (int 67h) */ +#define _K_IRQ_APPC 0x68 /* APPC */ +#define _K_IRQ_RTC 0x70 /* real time clock (int 15h) */ +#define _K_IRQ_REDIRIRQ2 0x71 /* software redirected to IRQ2 */ +#define _K_IRQ_MOUSE 0x74 /* mouse interrupt */ +#define _K_IRQ_HDC 0x76 /* fixed disk controller */ + +/* the code for setvect() and getvect() in +KSTART.ASM depends on the layout of this structure */ +typedef struct +{ + unsigned access_byte, eip; +} vector_t; + +/* the layout of this structure must match the order of registers +pushed and popped by the exception handlers in KSTART.ASM */ +typedef struct +{ +/* pushed by pusha */ + unsigned edi, esi, ebp, esp, ebx, edx, ecx, eax; +/* pushed separately */ + unsigned ds, es, fs, gs; + unsigned which_int, err_code; +/* pushed by exception. Exception may also push err_code. +user_esp and user_ss are pushed only if a privilege change occurs. */ + unsigned eip, cs, eflags, user_esp, user_ss; +} regs_t; + +typedef struct /* circular queue */ +{ + unsigned char *data; + unsigned size, in_base, in_ptr/*, out_base*/, out_ptr; +} queue_t; + +typedef struct +{ +/* virtual console input */ + queue_t keystrokes; +/* virtual console output */ + unsigned esc, attrib, csr_x, csr_y, esc1, esc2, esc3; + unsigned short *fb_adr; +} console_t; + +typedef struct +{ + console_t *vc; + jmp_buf state; + enum + { + TS_RUNNABLE = 1, TS_BLOCKED = 2, TS_ZOMBIE = 3 + } status; +} task_t; + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/Dump/hybos/src/kernel/bootlog.c b/Dump/hybos/src/kernel/bootlog.c new file mode 100644 index 0000000..c03200a --- /dev/null +++ b/Dump/hybos/src/kernel/bootlog.c @@ -0,0 +1,78 @@ +#include +#include +#include +#include +#include <_printf.h> /* do_printf() */ +#include "_krnl.h" +#include "bootlog.h" + +void klog(char *proc, char *entry, KLOGRESULT result, console_t *vtty0) +{ + unsigned oldattrib; + int i = 0; + int offset = 69; /* -4 for the "[ ]" part, -2 for the ": " part, -1 for space at end, and -4 for the status */ + char status[4]; + va_list args; + + args = args; + status[0] = '\0'; + + /** + * Save our old color attributes + */ + oldattrib = vtty0->attrib; + + if(result == K_KLOG_SUCCESS) + { + /** + * Successfull initialization of something. + * Write "..Ok" then leave + */ + vtty0->attrib = 8; + printf("\b\b\b\b.."); + vtty0->attrib = 2; + printf("Ok\n"); + vtty0->attrib = oldattrib; + + return; + } + else if(result == K_KLOG_FAILURE) + { + /** + * Unsuccessfull initialization of something. + * Write "Fail" then leave + */ + vtty0->attrib = 4; + printf("\b\b\b\bFail\n"); + vtty0->attrib = oldattrib; + + return; + } + + /** + * FIXME + * + * Should "wrap" the line instead + */ + if(strlen(entry) + 8 > 80) + return; + + vtty0->attrib = 8; + printf("[ "); + vtty0->attrib = 15; + printf("%s: %s", proc, entry); + vtty0->attrib = 8; + printf(" ]"); + + offset -= strlen(proc); + offset -= strlen(entry); + + for(i = 0; i < offset; i++) + printf("."); + + vtty0->attrib = 8; + printf("Wait"); + + vtty0->attrib = oldattrib; +} + diff --git a/Dump/hybos/src/kernel/bootlog.h b/Dump/hybos/src/kernel/bootlog.h new file mode 100644 index 0000000..83c3b86 --- /dev/null +++ b/Dump/hybos/src/kernel/bootlog.h @@ -0,0 +1,15 @@ +#ifndef _BOOTLOG_H +#define _BOOTLOG_H +#include +#include +#include "_krnl.h" + +typedef unsigned KLOGRESULT; + +#define K_KLOG_SUCCESS 0x00 /* successfull completion of task, finish log message */ +#define K_KLOG_PENDING 0x01 /* task hasn't completed yet, delay logging status */ +#define K_KLOG_FAILURE 0x02 /* unsuccessfull completion of task, finish log message */ + +void klog(char *proc, char *entry, KLOGRESULT result, console_t *vtty0); + +#endif /* !defined(_BOOTLOG_H) */ diff --git a/Dump/hybos/src/kernel/cpu.c b/Dump/hybos/src/kernel/cpu.c new file mode 100644 index 0000000..4675fda --- /dev/null +++ b/Dump/hybos/src/kernel/cpu.c @@ -0,0 +1,1351 @@ +/** + * Processor Management + */ + +/** + * Processor Identification + */ + +/** + * Name Title Revision + * ---------------------------------------------------------------------------------------------------- + * AMD AMD-K6 Processor Model 6 Revision Guide G 1998 August + * AMD AMD-K6 Processor Model 7 Revision Guide H 1999 June + * AMD AMD-K6-2 Processor Model 8 Revision Guide F 1999 June + * AMD AMD-K6-III Processor Model 9 Revision Guide C 1999 July + * AMD AMD Athlon Processor Model 1 & Model 2 Revision Guide D 2000 August + * AMD AMD Duron Processor Model 3 Revision Guide I 2002 December + * AMD AMD Athlon Processor Model 4 Revision Guide I 2002 December + * AMD AMD Athlon Processor Model 6 Revision Guide E 2002 December + * AMD AMD Duron Processor Model 7 Revision Guide C 2002 December + * AMD AMD Athlon Processor Model 8 Revision Guide C 2002 December + * + * Intel Intel386 CX/SXSA Microprocessor Specification Update 002 1997 January + * Intel Intel386 DX Processor Specification Update 002 1997 January + * Intel Intel386 EX Embedded Processor Specification Update 010 1998 October + * Intel 60- and 66-MHz Pentium Processor Specification Update 001 1997 February + * Intel Pentium Processor Specification Update 041 1999 January + * Intel Pentium Pro Processor Specification Update 039 1999 January + * Intel Mobile Intel Celeron Processor at 466 MHz, ... Specification Update 038 2002 November + * Intel Mobile Intel Pentium II Processor Specification Update 046 2002 November + * Intel Intel Pentium II Xeon Processor Specification Update 032 2002 January + * Intel Intel Pentium II Processor Specification Update 049 2002 July + * Intel Intel Celeron Processor Specification Update 047 2002 October + * Intel Intel Pentium III Processor Specification Update 045 2002 November + * Intel Mobile Intel Celeron Processor (0.18� and 0.13�) Specification Update 030 2002 August + * Intel Mobile Intel Pentium III Processor and ... Specification Update 036 2002 November + * Intel Intel Pentium III Xeon Processor Specification Update 037 2002 July + * Intel Intel Pentium 4 Processor Specification Update 029 2002 November + * Intel Mobile Intel Pentium 4 Processor-M Specification Update 008 2002 November + * Intel Intel Celeron Processor in the 478-Pin Package Specification Update 005 2002 November + * Intel Mobile Intel Celeron Processor on .13 Micron ... Specification Update 002 2002 August + * Intel Intel Xeon Processor Specification Update 020 2002 November + * Intel Intel Xeon Processor MP Specification Updata 009 2002 November + * Intel Low Voltage Intel Xeon Processor Specification Update 003 2002 November + * Intel Intel Pentium M Processor 001 2003 March + * Intel Intel Itanium Processor Specification Update 008 2003 January + * Intel Intel Itanium 2 Processor Specification Update 007 2003 January + * AMD AMD Processor Recognition W-1 2002 November + * Intel Intel Processor Identification and the CPUID Instruction 023 2003 March + * Intel Intel Processor Serial Number 001 1999 March + * IDT IDT WinChip C6 Data Sheet 1.10 1998 March + */ + +/** + * Mobile Athlon Detection + * + * Problems with CPU identication: + * 1) How much information? + * 2) Getting the information + * + * CPU identification has two purposes: OS information and user information. Since this module wil be + * used in TriOS we'll only need OS information (ident upto stepping for erratas) No process size, + * packaging or voltage info. I can be found withofficial name and codename. To prevent user confusion + * we need to show the diff between Celeron / Pentium / Xeon. Cache info is important for some memory + * defragmentation and alignment algorithms, perhaps. + * + * OLD CPUS: + * + * i4004 / i4040 + * i8008 / i8080 / i8080A / Zilog Z80 / i8085A / i8085AH + * + * 2.13 Contemporary CPUs + * Contemporary 16 bit CPUs to 8086/8088 were Zilog Z8000 CPU, Fairchild 9445 CPU, Texas Instruments TI9900 CPU and Mil-Std 1750A CPU. Last is reason DOD (Department Of Defence) contractors were not interested in 8086/8088. Mil-Std 1750A CPU was specified in all contracts of 1979 - 1984 period. + * Texas Instruments TI9900 CPU was probably the best of the lot, but Texas Instruments considered it a closed architecture, so no-one used it. + * + * 8086 - 80368 Intel Only + * 80486 Lots of manufacturers, almost no stpping info + * 80586 Lots of incorrect information and processors that were never sold, no stepping info + * 80686 Celeron / Pentium / Xeon // !Mobile! (Inel realy srewed up the names here) + * 80786 VERY WELL DONE BY INTEL (at least names are a bit more consistant) + * 80886 Not officialy realeasd at the moment + * + * Intel detection: AAA xxh doesn't #UD + * Cyrix Detection: Read the chipset data, but I heard there was a better one + * AMD Detection If there not TI, IBM, UMC, Cyrix or Intel, must be AMD, need sometin' better + * UMC Detection support CPUID I believe + * Texas Detection Models do not real conflic (aren't those things the same as IBM have to check) + * IBM Detection Ax or 8x as family (but there are exceptions) and models do not conflict + * + * CYRIX/TI/IBM Identificaton through Chipset Data (I/O 22h and 23h) + * + * Not about the use of stepping and revision: + * + * Stepping is used always. I try to change this into: Stepping = A0 / Revision = 3h + * Intel also calls the revion Stepping ID + * + * 386 Reset Data + * 0- 3 Minor Stepping Revision + * 4- 7 Major Stepping Model + * 8-11 Family Family + * 12-15 Type DX/SX/SL and TI/IBM/Intel + * + * 486+ Reset Data + * 0- 3 Revision + * 4- 7 Model + * 8-11 Family + * 12-13 Type 0 = Normal, 1 = OverDrive, 2 = Second Processor, 3 = Reserved + * 14-15 Reserved + * 16-19 Extended Model + * 20-27 Extended Family + * 28-30 Reserved + * 31 Reserved Has Serial Number + * + * All over drives could also have type 0 if they are an errata (whatever that means) + * + * Legal Mumbo Jumbo: In the CPUID Documentation, Intel says the PSN could be reported wrongly, for + * example if the voltage or frequency is wrong. It doesn't say it's corec when the processor is + * working on the correct voltage and frequency... + * + * IF HighetExtened CPUID Fucntion > 0x80000000 Brand String is supported, even if 0x800000001 or 2 ??? + * + * Should OverDrives just be ignored? According to Intel internal caches or execution times may vary + * According to Intel CPUID is unreliable in V86 Mode + * According to Intel MSRs vary between different Models of the Pentium (P5 that is) + * PSN is not guaranteed to be unique + * Intel PSN Style: XXXX-XXXX-XXXX-XXXX-XXXX-XXXX (96 bit) + * Transmeta PSN S: XXXXXXXX:XXXXXXXX:XXXXXXXX:XXXXXXXX (128 bit) + * + * Intel says apps need to use the BRAND STRING to identify the processor (ARE THEY CRAZY???) + * Intel says apps need to use the BRAND ID to identify the processor (not crazy, but useless) + * + * DAZ DAZ DAZ DAZ DAZ DAZ DAZ + * + * 11 DENORMALS ARE ZERO + * With the introduction of the SSE2 extensions, some Intel Architecture processors have the ability to convert SSE + * and SSE2 source operand denormal numbers to zero. This feature is referred to as Denormals -Are-Zero (DAZ). The + * DAZ mode is not compatible with IEEE Standard 754. The DAZ mode is provided to improve processor + * performance for applications such as streaming media processing, where rounding a denormal operand to zero does + * not appreciably affect the quality of the processed data. + * Some processor steppings support SSE2 but do not support the DAZ mode. To determine if a processor supports the + * DAZ mode, software must perform the following steps. + * 1. Execute the CPUID instruction with an input value of EAX=0 and ensure the vendor-ID string returned is �GenuineIntel�. + * 2. Execute the CPUID instruction with EAX=1. This will load the EDX register with the feature flags. + * 3. Ensure that the FXSR feature flag (EDX bit 24) is set. This indicates the processor supports the FXSAVE and FXRSTOR + * instructions. + * 4. Ensure that the XMM feature flag (EDX bit 25) or the EMM feature flag (EDX bit 26) is set. This indicates that the + * processor supports at least one of the SSE/SSE2 instruction sets and its MXCSR control register. + * 5. Zero a 16-byte aligned, 512-byte area of memory. This is necessary since some implementations of FXSAVE do not modify + * reserved areas within the image. + * 6. Execute an FXSAVE into the cleared area. + * 7. Bytes 28-31 of the FXSAVE image are defined to contain the MXCSR_MASK. If this value is 0, then the processor's + * MXCSR_MASK is 0xFFBF, otherwise MXCSR_MASK is the value of this dword. + * 8. If bit 6 of the MXCSR_MASK is set, then DAZ is supported. + * After completing this algorithm, if DAZ is supported, software can enable DAZ mode by setting bit 6 in the + * MXCSR register save area and executing the FXRSTOR instruction. Alternately software can enable DAZ mode by + * setting bit 6 in the MXCSR by executing the LDMXCSR instruction. Refer to the chapter titled �Programming with + * the Streaming SIMD Extensions (SSE)� in the Intel Architecture Software Developer�s Manual volume 1: Basic + * Architecture. + * + * DAZ DAZ DAZ DAZ DAZ DAZ DAZ + * + * Legacy detecyion + * 8086 EFLAGS 12-15 are always set + * 80286 EFLAGS 12-15 are clear in RM + * 80366 EFLAGS 18 Cant be set, if it can it a 486+ + * 80848 EFLAGS 21 Can't be set, if it can use CPUID + * + * FPU If control/status word can be saved it's present + * 27/387 Infinity control Rounding Stuff + * 487 486 with coproc + * + * What about the Xeon DP???? + * + * CMXCHG8B Disabled because of Stuoid MSWinNT bug (studpid. Microsft not diabling. stupid) + * + * sAVE bRAND sTRING BEFRORE s3 POWER DOWN + * + * NSC Geode!!!! + * + * "The iAPX 286 will push a different value on the stack for PUSH SP than the iAPX 86/88." + * "When a word write is performed at offset FFFFh in a segment, the 8086 will write one byte at offset + * FFFFh, and the other at offset 0, while an 80186 family processor will write one byte at offset + * FFFFh, and the other at offset 10000h (one byte beyond the end of the segment)." + * + * A finalty note: I'm looking for some information on the Intel Timna (Intel's MediaGX). The project + * was abandonned so Intel never published any useful material on this. It was based on the P-III. + * Also some info in the Microsoft X-Box' special P-III would help + */ + +#include +#include "bootlog.h" + +typedef struct { + unsigned n; + char* i; + char* v; +} VENDORLIST; + +VENDORLIST VendorList[] = +{ + {0x0001, "ThinkTrinary", "Trinary Technologies"}, + {0x0002, "GenuineIntel", "Intel"}, + {0x0003, "AuthenticAMD", "AMD"}, + {0x0003, "AMD ISBETTER", "AMD"}, + {0x0004, "CentaurHauls", "Centaur (IDT / VIA)"}, + {0x0005, "CyrixInstead", "Cyrix (VIA)"}, + {0x0006, "GenuineTMx86", "Transmeta"}, + {0x0007, "Geode by NSC", "National Semiconductor"}, + {0x0008, "NexGenDriven", "NexGen"}, + {0x0009, "RiseRiseRise", "Rise"}, + {0x000A, "SiS SiS SiS ", "SiS"}, + {0x000B, "UMC UMC UMC ", "UMC"}, +}; + +typedef struct { + long long id; + bool verified; + char* name; +} PROCLIST; + + + +PROCLIST ProcessorList[] = +{ + {0x00FFFFFF, false, "Unknown x86 Processor"}, + {0x0000FFFF, false, "Unknown 8086 Compatible Processor"}, + {0x0001FFFF, false, "Unknown 186 Compatible Processor"}, + {0x0002FFFF, false, "Unknown 286 Compatible Processor"}, + {0x0003FFFF, false, "Unknown 386 Compatible Processor"}, + {0x0004FFFF, false, "Unknown 486 Compatible Processor"}, + {0x0005FFFF, false, "Unknown 586 Compatible Processor"}, + {0x0006FFFF, false, "Unknown 686 Compatible Processor"}, + {0x02FFFFFF, false, "Unknown Intel Processor"}, + {0x0203FFFF, false, "Unknown Intel i386 Processor"}, + {0x0204FFFF, false, "Unknown Intel i486 Processor"}, + {0x0205FFFF, false, "Unknown Intel Pentium Processor"}, + {0x020501FF, false, "Intel Pentium Classic"}, + {0x020502FF, false, "Intel Pentium"}, + {0x020503FF, false, "Intel Pentium OverDrive"}, + {0x020504FF, false, "Intel Pentium MMX"}, + {0x020507FF, false, "Intel Pentium Mobile"}, + {0x020508FF, false, "Intel Pentium MMX Mobile 'Tillamook'"}, + {0x0206FFFF, false, "Unknown Intel P6 Processor"}, + {0x020601FF, false, "Intel Pentium Pro"}, + {0x020603FF, false, "Unknown Intel Pentium II"}, + {0x02060301, false, "Intel Pentium II 'Klamath'"}, /* 0512 - 0512 */ + {0x02060305, false, "Intel Pentium II OverDrive"}, /* OVERDRIVE */ + {0x020605FF, false, "Unknown Intel Pentium II"}, + {0x02060500, false, "Intel Celeron II 'Covington'"}, /* 0000 - 0000 */ + {0x02060501, false, "Intel Pentium II 'Deschutes'"}, /* 0512 - 0512 */ + {0x02060502, false, "Intel Xeon II 'Drake'"}, /* 0512 - 2048 */ + {0x02060504, false, "Intel Pentium II Mobile 'Tonga'"}, /* 0512 - 0512 */ + {0x020606FF, false, "Unknown Intel Pentium II"}, + {0x02060600, false, "Intel Celeron II 'Mendocino'"}, /* 0128 - 0128 */ +/**/ {0x02060603, false, "Intel Celeron II Mobile"}, /* 0128 - 0128 (A) */ + {0x02060604, false, "Intel Pentium II Mobile 'Dixon'"}, /* 0256 - 0256 (A) */ + {0x020607FF, false, "Unknown Intel Pentium III"}, + {0x02060701, false, "Intel Pentium III 'Katmai'"}, /* 0512 - 0512 */ + {0x02060702, false, "Intel Xeon III 'Tanner'"}, /* 0512 - 2048 */ + {0x020608FF, false, "Unknown Intel Pentium III"}, + {0x02060801, false, "Intel Celeron III 'Coppermine'"}, + {0x02060802, false, "Intel Pentium III (Mobile) 'Coppermine'"}, + {0x02060803, false, "Intel Xeon III 'Cascades'"}, + {0x020609FF, false, "Unknown Intel Pentium M"}, + {0x02060916, false, "Intel Pentium M 'Banias'"}, + {0x02060AFF, false, "Unknown Intel Pentium III"}, + {0x02060A03, false, "Intel Xeon III 'Cascades'"}, + {0x02060BFF, false, "Unknown Intel Pentium III"}, + {0x02060B03, false, "Intel Celeron III 'Tualatin'"}, + {0x02060B04, false, "Intel Pentium III 'Coppermine'"}, + {0x02060B06, false, "Intel Pentium III Mobile 'Geyserville'"}, + {0x02060B07, false, "Intel Celeron III Mobile 'Geyserville'"}, + {0x0207FFFF, false, "Unknown Intel Itanium"}, + {0x020FFFFF, false, "Unknown Intel NetBurst Processor"}, + {0x020F0008, false, "Intel Pentium 4 'Willamette'"}, + {0x020F000E, false, "Intel Xeon 4 'Foster'"}, + {0x020F0108, false, "Intel Pentium 4 'Willamette'"}, + {0x020F0109, false, "Intel Pentium 4 'Willamette'"}, + {0x020F010A, false, "Intel Celeron 4 'Willamette'"}, + {0x020F010B, false, "Intel Xeon 4 MP 'Foster'"}, + {0x020F010E, false, "Intel Xeon 4 'Foster'"}, + {0x020F020C, false, "Intel Xeon 4 MP 'Gallatin'"}, + {0x020F0208, false, "Intel Celeron 4 Mobile 'Northwood'"}, + {0x020F0209, false, "Intel Pentium 4 'Northwood'"}, + {0x020F020B, false, "Intel Xeon 4 'Prestonia'"}, + {0x020F020E, false, "Intel Pentium 4 Mobile 'Northwood'"}, + {0x020F020A, false, "Intel Celeron 4 'Northwood'"}, + {0x0210FFFF, false, "Unknown Intel Itanium 2"}, + {0x03FFFFFF, false, "Unknown AMD Processor"}, + {0x0306FFFF, false, "Unknown AMD Athlon Processor"}, + {0x030601FF, false, "AMD Athlon 'Pluto'"}, + {0x030602FF, false, "AMD Athlon 'Argon'"}, + {0x030603FF, false, "AMD Duron 'Spitfire'"}, + {0x030604FF, false, "AMD Athlon 'Thunderbird'"}, + {0x030605FF, false, "AMD Athlon Ultra 'Mustang'"}, + {0x030606FF, false, "AMD Athlon MP 'Palomino'"}, + {0x030606FF, false, "AMD Athlon XP/MP 'Palomino'"}, + {0x030606FF, false, "AMD Athlon 4 Mobile 'Palomino'"}, + {0x030607FF, false, "AMD Duron 'Morgan'"}, + {0x030607FF, false, "AMD Duron MP 'Morgan'"}, + {0x030607FF, false, "AMD Duron Mobile 'Morgan'"}, + {0x030608FF, false, "AMD Athlon XP 'Thoroughbred'"}, + {0x030608FF, false, "AMD Athlon MP 'Thoroughbred'"}, + {0x030608FF, false, "AMD Athlon XP Mobile 'Thoroughbred'"}, + {0x030609FF, false, "AMD Duron 'Appaloosa'"}, + {0x030609FF, false, "AMD Duron MP 'Appaloosa'"}, + {0x030609FF, false, "AMD Duron Mobile 'Appaloosa'"}, + {0x03060AFF, false, "AMD Athlon XP 'Barton'"}, + {0x03060AFF, false, "AMD Athlon MP 'Barton'"}, + {0x04FFFFFF, false, "Unknown IDT / VIA Processor"}, + {0x0405FFFF, false, "Unknown IDT WinChip"}, + {0x040504FF, false, "IDT WinChip C6"}, + {0x040508FF, false, "IDT WinChip 2"}, + {0x040509FF, false, "IDT WinChip 3"}, + {0x0406FFFF, false, "Unknown VIA C3"}, + {0x040606FF, false, "VIA C3 'Samuel 1' / VIA Eden 4000"}, + {0x040607FF, false, "VIA C3 'Samuel 2 / Ezra' / VIA Eden 5000 / VIA Eden 6000"}, /* 0-7 / 8-F */ + {0x040608FF, false, "VIA C3 'Ezra-T' (VIA Eden 7000)"}, +// {0x040609FF, false, "VIA C3 'Nehalem VIA Eden 8000"}, + {0x05FFFFFF, false, "Unknown Cyrix Processor"}, + {0x0506FFFF, false, "Unknown VIA Cyrix III"}, + {0x050605FF, false, "VIA Cyrix III 'Joshua'"}, + {0x06FFFFFF, false, "Unknown Transmeta Processor"}, + {0x0604FFFF, false, "Transmeta Crusoe 3x00 / 5x00 Processor"}, + {0x08FFFFFF, false, "Unknown NexGen Processor"}, + {0x0805FFFF, false, "Unknown NexGen Nx586 / Nx686 Processor"}, + {0x080500FF, false, "Unknown NexGen Nx586"}, + {0x08050000, false, "NexGen Nx586"}, + {0x08050001, false, "NexGen Nx586FP"}, + //{0x0805??FF, false, "Unknown NexGen Nx686"}, + {0x0CFFFFFF, false, "Unknown UMC Processor"}, + {0x0C04FFFF, false, "Unknown UMC 486 Processor"}, + {0x0C0401FF, false, "UMC U5SD"}, + {0x0C0402FF, false, "UMC U5S"}, + {0x0C0403FF, false, "UMC U486DX2"}, + {0x0C0405FF, false, "UMC U486SX2"}, + + + + + + + + + {0xABCDABCD, false, "XXX"} +}; + + +#if 0 + /**********************************************************************************************/ +// {"GenuineIntel", 0x05, 0x00, 0x0?, 0, false, "Intel Pentium Classic (A*)"}, +// {"GenuineIntel", 0x05, 0x01, 0x02, 0, false, "Intel Pentium Classic (B*)"}, +// {"GenuineIntel", 0x05, 0x01, 0x04, 0, false, "Intel Pentium Classic (B2)"}, +// {"GenuineIntel", 0x05, 0x04, 0x01, 0, false, "Intel Pentium MMX (A1)"}, +// {"GenuineIntel", 0x05, 0x04, 0x02, 0, false, "Intel Pentium MMX (A2)"}, +// {"GenuineIntel", 0x05, 0x05, 0x0?, 0, false, "Intel Pentium MMX OverDrive"}, +// {"GenuineIntel", 0x05, 0x06, 0x0?, 0, false, "Intel Pentium MMX OverDrive"}, +// {"GenuineIntel", 0x06, 0x00, 0x0?, 0, false, "Intel Pentium Pro (A0)"}, +// {"GenuineIntel", 0x06, 0x04, 0x0?, 0, false, "Intel Pentium II OverDrive (?)"}, +// {"GenuineIntel", 0x0F, 0x02, 0x07, 0x0E, false, "Intel Pentium 4 Mobile (C1)"}, +// {"AuthenticAMD", 0x06, 4, 4, 0, false, "AMD Athlon 'Thunderbird' Model 4 (B0)"}, //??Grzegorz +// {"AuthenticAMD", 0x06,5?, ?, 0, false, "AMD Athlon Ultra 'Mustang' Model 5? (??)"}, /* CANCELED */ + +// {"GenuineIntel",F?,3?, ?, ?, "Intel Pentium 4 'Prescott' (??)"}, //.09 +// {"GenuineIntel",F?,3?, ?, ?, "Intel Xeon 4 'Nocona' (??)"}, //.09 +// {"GenuineIntel",F?,4?, ?, ?, "Intel Pentium 4 'Tyler' (??)"}, +// {"GenuineIntel",F?,4?, ?, ?, "Intel Pentium 4 'Tejas' (??)"}, +// {"GenuineIntel",F?,4?, ?, ?, "Intel Xeon 4 'Potomac' (??)"}, + +//GI Nehalem Pentium 5 + + +// {"GenuineIntel", ?,?, ?, ?, "Intel Mobillium 'Banias' (??)"}, +// {"GenuineIntel", ?,?, ?, ?, "Intel Mobillium 'Dothan' (??)"}, +// {"GenuineIntel", ?,?, ?, ?, "Intel Mobillium 'Morem' (??)"}, /* Next GEN!!!! */ +// {"GenuineIntel", ?,?, ?, ?, "Intel Mobillium 'Gilo' (??)"}, /* Next GEN!!!! */ +// Intel's truly mobile processor. Intel says this is a completly new processor. Sources say it's just +// a rework of the PIII or P4. I don't believe this, beacause it has SSE2 (not in PIII) and is faster +// than the P4. I guess they just shortened the enormous 20 stage P4 pipeline a bit, which is too long +// to be used effecivly. More backup is provided for the fact that the Pentium 5 will be based upon +// this chip. And another thing many sources will tell you this chip will be called 'Intel Banias', +// didn't Intel call the Pentium III, Intel Katmai for a very long time. With this in mind it wouldn't +// even surprise me if this processor is goin to be called Pentium 5. Sorry but I have to go one now +// I'm brainstorming. The mobile part of it might not even be used for mobile computers, but for +// desktops and servers as well, because cooling has become almost impossible today. If speeds are +// going to get even higher the next couple of years, the processor cores will just melt. Because +// AMD's processors get even hotter and isn't working on a similar project Intel might even regain +// it's market monopoly (wheter this is good or bad, I don't know?) +// {"GenuineIntel",F?,?, ?, ?, "Intel Pentium 5 'Nehalem' (??)"}, +// This is just a rumor. It's supposed to come out in 2006, run at 6Ghz and have a bus speed of +// 1.5Ghz. It COULD be using the Intel Banias core. Suggesting the Banias is a Pentium 5 and that it +// IS completely new. IF you read the note above this could also be the Pentium 6 or something. +// {"GenuineIntel", 7, 6, 4, 0, "Intel Itanium 'Merced' (C0)"}, //0007000604 +// {"GenuineIntel", 7, 7, 4, 0, "Intel Itanium 'Merced' (C1)"}, //0007000704 +// {"GenuineIntel", 7, 7, 4, 0, "Intel Itanium 'Merced' (C2)"}, //0007000804 +// {"GenuineIntel", 0x10, 0, ?, 0, "Intel Itanium 2 'McKinley' (B3)"}, //001F000704 +// {"GenuineIntel",A?, ?, ?, ?, ???, "Intel Itanium 2 'Madison' (??)"}, +// {"GenuineIntel",A?, ?, ?, ?, ???, "Intel Itanium 2 'Deerfield' (??)"},XXX +// {"GenuineIntel",A?, ?, ?, ?, ???, "Intel Itanium 2 'Montecito' (??)"} +// {"GenuineIntel",A?, ?, ?, ?, ???, "Intel Itanium 2 'Shavano' (??)"}, +// {"GenuineIntel",A?, ?, ?, ?, ???, "Intel Itanium 2? 'Yosemite' (??)"}, +// {"GenuineIntel",A?, ?, ?, ?, ???, "Intel Itanium 2? 'Tanglewood' (??)"}, + +// {"AuthenticAMD", ?, ?, ?, ?, "AMD Athlon XP64 / Hammer 'Clawhammer' (??)"}, +// {"AuthenticAMD", ?, ?, ?, ?, "AMD Athlon XP64 / Hammer 'San Diego' (??)"}, +// {"AuthenticAMD", ?, ?, ?, ?, "AMD Athlon XP64 / Hammer Mobile 'Odessa' (??)"}, +// {"AuthenticAMD", ?, ?, ?, ?, "AMD Opteron 'Sledgehammer' (??)"}, +// {"AuthenticAMD", ?, ?, ?, ?, "AMD Opteron 'Athens' (??)"}, +// {"CentaurHauls", 0x05, 0x08, 0x01, 0x00, false, "IDT WinChip 2"}, +// {"CentaurHauls", 6, 0xA, ?, 0, "IDT WinChip 4"}, //PROBABLY DOESN'T EXIST! -> Is a VIA C3!!! + + /** Intel 8086 / 8088 (Includes model manufactured by AMD, Harris, Siemens, Hitachi) ************/ + + //I belive there an alroithm to identify the diff between HMOS and CMOS models + {"GenuineIntel", 1, 0, 0, 0, false, "Intel 8088"}, + {"GenuineIntel", 1, 0, 0, 1, false, "Intel 8086"}, + {"GenuineIntel", 1, 0, 0, 2, false, "Intel 80C88"}, + {"GenuineIntel", 1, 0, 0, 3, false, "Intel 80C86"}, + {"GenuineIntel", 1, 0, 0, 4, false, "Intel 80188"}, //XL/EA/EB/EC AMD/Siemens + {"GenuineIntel", 1, 0, 0, 5, false, "Intel 80186"}, //XL/EA/EB/EC AMD/Siemens + {"GenuineIntel", 1, 0, 0, 6, false, "NEC V20"}, //V20H/V25/V25 Plus/V25 Softwae Guard/V40/V40H//V45 + {"GenuineIntel", 1, 0, 0, 7, false, "NEC V30"}, //V30H/V35/V35 Plus/V35 Softwae Guard/V50/V50H//V55 + //Intel 80886??? + + {"GenuineIntel", 2, 0, 0, 0, false, "Intel 80286"},//amd/harris/siemens/fujitsu/kruger + + + /** Intel 386 ***********************************************************************************/ + + + //The 386 use a very different format: Family (8-bits!) + Revision (8-bits! Model+Stepping) + //Not to myself: The high four bits of the family should coume in the extra field + //These chips were also munufactured by AMD!!! They are affected by the POPAD bug???? + //Old (sigma-pi) i386 have 32-bit multipy bug + //C&T 38600DX do not have POPAD bug. IBM 386SLC unknwon + //AMD 386DX & DXL hav Intel microcode + //AMD 386DXLV & SXLV hav UMOV??? + //Nx586 has no AC has 386 instr set + + //Erly modles (A stepping) as Famuly: 0, Revision: ??? (In Intel Docs! Support the 'Bit Instrucs') + //0300 + // * Intel i386DX : F0 + {"GenuineIntel", 3, 0, 3, 0, false, "Intel i386DX (B0/B1/B2/B3/B4/B5/B6/B7/B8/B9/B10)"}, + {"GenuineIntel", 3, 0, 4, 0, false, "Intel i386DX (C???)"}, // Stepping not confiremed + {"GenuineIntel", 3, 0, 5, 0, false, "Intel i386DX (D0)"}, + {"GenuineIntel", 3, 0, 8, 0, false, "Intel i386DX (D1/D2/E0/E1/F0)"}, //E0/E1/F0 coulld also be 9!!! + + //The family 23 could also simply be 3 (I don't know were the 2 stands for???) Officialy not part + //Difference between DX and SX perhaps (I hope so) + // * Intel i386CX/SXSA : A2 / B + // * Intel i386EX : A0 / B1 / B2 + {"GenuineIntel",23, 0, 4, 0, false, "Intel i386SX (A0)"}, + {"GenuineIntel",23, 0, 5, 0, false, "Intel i386SX (B)"}, + {"GenuineIntel",23, 0, 8, 0, false, "Intel i386SX (C/D/E)"}, + {"GenuineIntel",23, 0, 8, 0, false, "Intel i386CXSA/B (A) / i386EX (A) / i386SXSA (?)"}, //A || B + {"GenuineIntel",23, 0, 9, 0, false, "Intel i386SX (?)"}, //EMBEDDED (CX/FX + {"GenuineIntel",23, 0, 9, 0, false, "Intel i386EX (A0/B1/C1)"}, + + //Dito for 33 (376 perhaps) + {"GenuineIntel",33, 0, 5, 0, false, "Intel i376 (A0)"}, //Never used in PC because they only work in PM + {"GenuineIntel",33, 0, 8, 0, false, "Intel i376 (B)"}, //... + + //And againt for 43 (386SL) + //have a signatur register @ 30e + //step level A0: 0x4300, + //step level A1: 0x4300, + //step level A2: 0x4301, + //step level A3: 0x4302, + //step level B0: 0x4310, + //step level B1: 0x4311. +// {"GenuineIntel",43, 0, 5, ?, false, "Intel i386SL (B)"}, +// {"GenuineIntel",43, 0, 5, ?, false, "Intel i386SL (A0/A1/A2/A3)"}, //Not sure about this +// {"GenuineIntel",43, 1, 0, 0, false, "Intel i386SL (A0/A1/A2/A3)"}, +// {"GenuineIntel",43, 1, 1, 0, false, "Intel i386SL (B0/B1)"}, + + //RapidCADs are not so familiar to me, where they ever used in PCs??? + {"GenuineIntel", 3, 4, 0, 0, false, "Intel RapidCAD (A)"}, + {"GenuineIntel", 3, 4, 1, 0, false, "Intel RapidCAD (B)"}, + + + /** Intel 486 ***********************************************************************************/ + + //According to Intel only SL Enhanced and WB Enhanced processors support CPUID + + {"GenuineIntel", 4, 0, 0, 0, false, "Intel i486DX (A0/A1)"}, + {"GenuineIntel", 4, 0, 1, 0, false, "Intel i486DX (B2/B3/B4/B5/B6)"}, + {"GenuineIntel", 4, 0, 2, 0, false, "Intel i486DX (C0)"}, + {"GenuineIntel", 4, 0, 3, 0, false, "Intel i486DX (C1)"}, + {"GenuineIntel", 4, 0, 4, 0, false, "Intel i486DX (D0)"}, +// {"GenuineIntel", 4, 0, ?, 0, false, "Intel i486DX"}, + + {"GenuineIntel", 4, 1, 0, 0, false, "Intel i486DX (cA2/cA3)"}, + {"GenuineIntel", 4, 1, 1, 0, false, "Intel i486DX (cB0/cB1)"}, + {"GenuineIntel", 4, 1, 3, 0, false, "Intel i486DX (cC0)"}, + {"GenuineIntel", 4, 1, 4, 0, false, "Intel i486DX (aA0/aA1)"}, //SL Enhanced + {"GenuineIntel", 4, 1, 5, 0, false, "Intel i486DX (aB0)"}, //SL Enhanced +// {"GenuineIntel", 4, 1, ?, 0, false, "Intel i486DX"}, + + {"GenuineIntel", 4, 2, 0, 0, false, "Intel i486SX / i487SX (A0)"}, //Should 487 be model 3 + {"GenuineIntel", 4, 2, 1, 0, false, "Intel i487SX (B0)"}, //Should 487 be model 3 + {"GenuineIntel", 4, 2, 2, 0, false, "Intel i486SX (B0)"}, + {"GenuineIntel", 4, 2, 3, 0, false, "Intel i486SX (bBx)"}, //SL Enhanced and... CPUID + {"GenuineIntel", 4, 2, 4, 0, false, "Intel i486SX (gAx)"}, + {"GenuineIntel", 4, 2, 7, 0, false, "Intel i486SX (cA0)"}, + {"GenuineIntel", 4, 2, 8, 0, false, "Intel i486SX (cB0)"}, + {"GenuineIntel", 4, 2, 0xA, 0, false, "Intel i486SX (aA0/aA1)"}, //SL Enhanced + {"GenuineIntel", 4, 2, 0xB, 0, false, "Intel i486SX (aB0/aC0)"}, //SL Enhanced + {"GenuineIntel", 4, 2, 0xE, 0, false, "Intel i486SX (E)"}, //SL Enhanced??? Grzegorz +// {"GenuineIntel", 4, 2, ?, 0, false, "Intel i486SX"}, + +// {"GenuineIntel", 4, 3, ?, 0, false, "Intel i486DX2 / i486DX2 OverDrive / i487"}, + {"GenuineIntel", 4, 3, 2, 0, false, "Intel i486DX2 (A0/A1/A2)"}, + {"GenuineIntel", 4, 3, 3, 0, false, "Intel i486DX2 (B1)"}, + {"GenuineIntel", 4, 3, 4, 0, false, "Intel i486DX2 (aA0/aA1)"}, //SL Enhanced + {"GenuineIntel", 4, 3, 5, 0, false, "Intel i486DX2 (aB0/aC0)"}, //SL Enhanced + {"GenuineIntel", 4, 3, 6, 0, false, "Intel i486DX2"}, //Possibly as WB in WT Mode + + {"GenuineIntel", 4, 4, 0, 0, false, "Intel i486SL (A)"}, + {"GenuineIntel", 4, 4, 1, 0, false, "Intel i486SL (?)"}, + {"GenuineIntel", 4, 4, 3, 0, false, "Intel i486SL (?)"}, //In Intel Docs, saupoosed to support CPUID +// {"GenuineIntel", 4, 4, ?, 0, false, "Intel i486SL"}, + +// {"GenuineIntel", 4, 5, ?, 0, false, "Intel i486SX2"}, + {"GenuineIntel", 4, 5, 0xB, 0, false, "Intel i486SX2 (aC0)"}, //SL Enhanced + + {"GenuineIntel", 4, 7, 0, 0, false, "Intel i486DX2-WB (A)"}, + {"GenuineIntel", 4, 7, 3, 0, false, "Intel i486DX2-WB (?)"}, //In Intel Docs, saupoosed to support CPUID +// {"GenuineIntel", 4, 7, ?, 0, false, "Intel i486DX2-WB"}, + + {"GenuineIntel", 4, 8, 0, 0, false, "Intel i486DX4 (A)"}, + {"GenuineIntel", 4, 8, 0, 1, false, "Intel i486DX4 OverDrive (A)"}, + {"GenuineIntel", 4, 8, 3, 0, false, "Intel i486DX4 (A)"}, //Possibly as WB in WT Mode, Support CPUID +// {"GenuineIntel", 4, 8, ?, 0, false, "Intel i486DX4 / i486DX4 OverDrive"}, + + {"GenuineIntel", 4, 9, 0, 0, false, "Intel i486DX4-WB (A)"}, //(Do not exist according to Intel CPUID Inf) +// {"GenuineIntel", 4, 9, ?, 0, false, "Intel i486DX4-WB"}, + + + /** AMD *****************************************************************************************/ + + {"AuthenticAMD", 4, 1, 2, 0, false, "AMD 486DX"}, + {"AuthenticAMD", 4, 3, 2, 0, false, "AMD 486DX/2"}, //DX4 (WT2x) toooo && DXL2 / DX4NV8T + {"AuthenticAMD", 4, 3, 4, 0, false, "AMD 486DX/2"}, //DX4 (WT2x) toooo && DXL2 / DX4SV8B +// {"AuthenticAMD", 4, 7, ?, 0, false, "AMD 486DX/2-WB"}, //DX4 (WB2x) + {"AuthenticAMD", 4, 7, 4, 0, false, "AMD SV8B (WT)"}, +// {"AuthenticAMD", 4, 8, ?, 0, false, "AMD 486DX/4"}, //5x86 toooo + {"AuthenticAMD", 4, 8, 4, 0, false, "AMD 486DX/4"}, //3xWT + {"AuthenticAMD", 4, 9, 4, 0, false, "AMD 486DX/4-WB"}, //3xWB + {"AuthenticAMD", 4, 0xE, 4, 0, false, "AMD Am5x86-WT"}, //AMD Enhanced 486 + {"AuthenticAMD", 4, 0xF, 4, 0, false, "AMD Am5x86-WB (4)"}, //AMD Enhanced 486 + + //cores: 5.0 / 5.0 (MMX) / 5.1 / 5.2 + {"AuthenticAMD", 5, 0, 0, 0, false, "AMD K5 SSA/5 (E)"}, //??? Stepping Name + {"AuthenticAMD", 5, 0, 1, 0, false, "AMD K5 SSA/5 (F)"}, //??? Stepping Name +// {"AuthenticAMD", 5, 0, ?, 0, false, "AMD K5 SSA/5 (?)"}, //??? Stepping Name +// {"AuthenticAMD", 5, 1, ?, 0, false, "AMD K5 5k86 Model 1 (?)"}, //??? Stepping Name + {"AuthenticAMD", 5, 1, 1, 0, false, "AMD K5 5k86 Model 1 (?)"}, //??? Stepping Name + {"AuthenticAMD", 5, 1, 2, 0, false, "AMD K5 5k86 Model 1 (?)"}, //??? Stepping Name + {"AuthenticAMD", 5, 1, 4, 0, false, "AMD K5 5k86 Model 1 (?)"}, //CLKMUL=1.5 +// {"AuthenticAMD", 5, 2, ?, 0, false, "AMD K5 5k86 Model 1 (?)"}, //??? Stepping Name + {"AuthenticAMD", 5, 2, 4, 0, false, "AMD K5 5k86 Model 2 (?)"}, //CLKMUL=1.75 +// {"AuthenticAMD", 5, 3, ?, 0, false, "AMD K5 5k86 Model 3 (?)"}, //??? Stepping Name (NOT RELEASED) + {"AuthenticAMD", 5, 3, 4, 0, false, "AMD K5 5k86 Model 1 (?)"}, //CLKMUL=2.0 + + + //Missing: MobileS (= k6-7!!!) / K6-2+ n/ K6-III+ + {"AuthenticAMD", 5, 6, 1, 0, false, "AMD-K6 Model 6 (B)"}, + {"AuthenticAMD", 5, 6, 2, 0, false, "AMD-K6 Model 6 (C)"}, + {"AuthenticAMD", 5, 7, 0, 0, false, "AMD-K6 Model 7 'Little Foot' (A)"}, + {"AuthenticAMD", 5, 8, 0, 0, false, "AMD-K6-2 Model 8 'Chomper' (A0)"}, //doesnt CXT stnd fr Chomber XT +// {"AuthenticAMD", 5, 8, 8, 0, false, "AMD-K6-2 Model 8 'Chomper' (AC)"}, //In Recognition < CXT + {"AuthenticAMD", 5, 8, 0xC, 0, false, "AMD-K6-2 Model 8 'Chomper' (AC)"}, //CXT Core (Write COmbining) I believe YES!!! avvording to Chase + {"AuthenticAMD", 5, 9, 1, 0, false, "AMD-K6-III 'Sharptooth' Model 9 (B)"}, +// {"AuthenticAMD", 5, 0xD, ?, 0, false, "AMD-K6-2+ / K6-III+ 'Sharptooth' (?)"}, //Not doced by AMD (3DNow!+) + +//* {"AuthenticAMD", 6, 0, ?, 0, "AMD K7 [ES]"}, //UNDOCUMENTED!?! + + + /* Cyrix **************************************************************************************/ + + //My sources are unreliable at best for these suckers, so I list them all + //Also I belive the names aren't entire ly correct, confused codename/ actualt name and extensions + + {"CyrixInstead", 0, 0, 5, 0, false, "Cyrix M5 Cx486S/D"}, //No CPUID I believe (is family correct?) + {"CyrixInstead", 0, 0, 6, 0, false, "Cyrix M6 Cx486DX"}, //... + {"CyrixInstead", 0, 0, 7, 0, false, "Cyrix M7 Cx486DX2"}, //... + {"CyrixInstead", 0, 0, 8, 0, false, "Cyrix M8 Cx486DX4"}, + //... + + {"CyrixInstead", 4, 1, 0, 0, false, "Cyrix 4x86SLC"}, +// {"CyrixInstead", 4, 2, ?, 0, false, "Cyrix 5x86"}, + {"CyrixInstead", 4, 2, 9, 0, false, "Cyrix 5x86 (Rev 1-)"}, //Bus *2 + {"CyrixInstead", 4, 2, 0xB, 0, false, "Cyrix 5x86 (Rev 1-)"}, //Bus *2 + {"CyrixInstead", 4, 2, 0xD, 0, false, "Cyrix 5x86 (Rev 1-)"}, //Bus *3 + {"CyrixInstead", 4, 2, 0xF, 0, false, "Cyrix 5x86 (Rev 1-)"}, //Bus *3 +// {"CyrixInstead", 4, 4, ?, 0, false, "Cyrix MediaGX"}, + {"CyrixInstead", 4, 9, 0, 0, false, "Cyrix 5x86 (Rev 2+)"}, +// {"CyrixInstead", 4, 9, ?, 0, false, "Cyrix 5x86"}, + + +// IBM ID=15h Top (65 KB JPG) and Bottom (104 KB JPG) +// IBM ID=17h Top (71 KB JPG) and Bottom (110 KB JPG) +// Cyrix ID=17h Top (63 KB JPG) and Bottom (102 KB JPG) +// IBM ID=22h Top (82 KB JPG) and Bottom (99 KB JPG) +// {"CyrixInstead", 5, 0, ?, 0, false, "Cyrix M1 (6x86)"}, //Grzegorz + {"CyrixInstead", 5, 2, 0, 0, false, "Cyrix M1 (6x86)"}, //Early Models (L / non-L versions???? (LV too)) +// {"CyrixInstead", 5, 2, ?, 0, false, "Cyrix M1 (6x86)"}, //Early Models (L / non-L versions???? (LV too)) + {"CyrixInstead", 5, 3, 0, 0, false, "Cyrix M1 (6x86)"}, //1.0x Bus Ratio + {"CyrixInstead", 5, 3, 1, 0, false, "Cyrix M1 (6x86)"}, //2.0x Bus Ratio + {"CyrixInstead", 5, 3, 2, 0, false, "Cyrix M1 (6x86)"}, //1.0x Bus Ratio + {"CyrixInstead", 5, 3, 3, 0, false, "Cyrix M1 (6x86)"}, //2.0x Bus Ratio + {"CyrixInstead", 5, 3, 4, 0, false, "Cyrix M1 (6x86)"}, //3.0x Bus Ratio + {"CyrixInstead", 5, 3, 5, 0, false, "Cyrix M1 (6x86)"}, //4.0x Bus Ratio + {"CyrixInstead", 5, 3, 6, 0, false, "Cyrix M1 (6x86)"}, //3.0x Bus Ratio + {"CyrixInstead", 5, 3, 7, 0, false, "Cyrix M1 (6x86)"}, //4.0x Bus Ratio +// {"CyrixInstead", 5, 4, ?, 0, false, "Cyrix MediaGX MMX"}, + + +// ID=02h Top (73 KB JPG) and Bottom (100 KB JPG) +// ID=04h Top (79 KB JPG) and Bottom (106 KB JPG) +// ID=08h Top (66 KB JPG) and Bottom (101 KB JPG) +// ID=53 07 + {"CyrixInstead", 6, 0, 0, 0, false, "Cyrix MII (6x86MX)"}, +// {"CyrixInstead", 6, 0, ?, 0, "Cyrix MII (6x86MX)"}, + + //These guys are actualy a Cyrix M2 with minor enhancemets (3DNow! / better FPU), but who cares, + //they were never taken into procuvtion. Although VIA C3 probalby stands for Cyrix M3 and not, + //Centaur WinChip 3. THey got a WinChip 4 core. Josua was nOT released! Start with samual and Samual 2 then Ezra and Ezra-T + // {"CyrixInstead", 6, 5, 1, 0, false, "VIA Cyrix III 'Joshua'"}, //2.0x Bus Ratio + + //Other names heard: Cyrix M-III 'Mojave' (Chase, so reliable never produced!) + // Cayenne / Gobi / Jalapeno + // Cayenne, then Gobi, then Joshua + + //THE VIA Series!!!!! + //New models : C4 'Nehemia' Has SSE instead of #dnOW! newer modles will be Esther + // CZA is a P4 clone + + /************************************************************************************************/ + + + + + +// I'm not sure about the CNs +// {"RiseRiseRise", 5, 0, ?, 0, "Rise mP6 iDragon '6401?' (Model 0)"}, //0.25 +// {"RiseRiseRise", 5, 0, 4, 0, "Rise mP6 iDragon '6401?' (Model 0)"}, //0.25 +// {"RiseRiseRise", 5, 1, ?, 0, "Rise mP6 iDragon 'Kirin?' (Model 1)"}, +// {"RiseRiseRise", 5, 2, ?, 0, "Rise mP6 iDragon 'Lynx?' (Model 2)"}, //0.18 +// {"RiseRiseRise", 5, 8, ?, 0, "Rise mP6 iDragon II"}, +// {"RiseRiseRise", 5, 9, ?, 0, "Rise mP6 iDragon II"}, +// Rise Tiger = MMX+SSE Unknown Nmae + + +#endif /* 0 */ + +typedef struct __CPU___PROCINFORMATION__ +{ + bool pCertified; + char *pName; + + uint32_t vFamily; + uint32_t vModel; + uint32_t vStepping; + uint32_t vType; + uint32_t vBrand; + char vVendor[13]; + char *vName; + + bool iFloatingPoint; + bool iTranscedental; + bool iCompareExchange64; + bool iConditionalMove; + bool iCLFLUSH; + bool iMMX; + bool iSSE; + bool iSSE2; + bool iSSE3; + bool iMonitor; + bool iFastSystemCall; + bool iFXSR; + bool fVirtualModeExtensions; + bool fDebuggingExtensions; + bool fPageSizeExtensions; + bool fTimeStampCounter; + bool fModelSpecificRegisters; + bool fPhysicalAddressExtension; + bool fMachineCheckException; + bool fLocalAPIC; + bool fMemoryTypeRangeRegisters; + bool fPageGlobalEnable; + bool fMachineCheckArchitecture; + bool fPageAttributeTable; + bool fPageSizeExtension; + bool fProcessorSerialNumber; + bool fDebugStore; + bool fACPI; + bool fSelfSnoop; + bool fHyperThreading; + bool fThermalMonitor; + bool fIA64; + bool fSignalBreakOnFERR; + bool fQualifiedDebugStore; + bool fThermalMonitor2; + bool fContextID; + + uint32_t cLineSize; + uint32_t cL1CodeCacheSize; + uint32_t cL1CodeCacheAssociativity; + uint32_t cL1CodeCacheLineSize; + uint32_t cL1CodeCacheLinesPerTag; + uint32_t cL1DataCacheSize; + uint32_t cL1DataCacheAssociativity; + uint32_t cL1DataCacheLineSize; + uint32_t cL1DataCacheLinesPerTag; + uint32_t cL1UnifiedCacheSize; + uint32_t cL1UnifiedCacheAssociativity; + uint32_t cL1UnifiedCacheLineSize; + uint32_t cL1UnifiedCacheLinesPerTag; + uint32_t cL1CodeTLB4KEntries; + uint32_t cL1CodeTLB2MEntries; + uint32_t cL1DataTLB2MEntries; + uint32_t cL1CodeTLB4MEntries; + uint32_t cL1DataTLB4KEntries; + uint32_t cL1DataTLB4MEntries; + uint32_t cL2UnifiedCacheSize; + uint32_t cL2UnifiedCacheAssociativity; + uint32_t cL2UnifiedCacheLineSize; + uint32_t cL2UnifiedCacheLinesPerTag; + uint32_t cL2CodeTLB4KEntries; + uint32_t cL2CodeTLB2MEntries; + uint32_t cL2CodeTLB4MEntries; + uint32_t cL2DataTLB4KEntries; + uint32_t cL2DataTLB2MEntries; + uint32_t cL2DataTLB4MEntries; + uint32_t cL2UnifiedTLB4KEntries; + uint32_t cL2UnifiedTLB2MEntries; + uint32_t cL2UnifiedTLB4MEntries; + uint32_t cL3UnifiedCacheSize; + uint32_t cL3UnifiedCacheAssociativity; + uint32_t cL3UnifiedCacheLineSize; + uint32_t cL3UnifiedCacheLinesPerTag; + + int32_t cL1CodeTLB4KAssociativity; + int32_t cL1CodeTLB2MAssociativity; + int32_t cL1CodeTLB4MAssociativity; + int32_t cL1DataTLB4KAssociativity; + int32_t cL1DataTLB2MAssocitivity; + int32_t cL1DataTLB4MAssociativity; + int32_t cL2CodeTLB4KAssociativity; + int32_t cL2CodeTLB2MAssociativity; + int32_t cL2CodeTLB4MAssociativity; + int32_t cL2DataTLB4KAssociativity; + int32_t cL2DataTLB2MAssociativity; + int32_t cL2DataTLB4MAssociativity; + int32_t cL2UnifiedTLB4KAssociativity; + int32_t cL2UnifiedTLB2MAssociativity; + int32_t cL2UnifiedTLB4MAssociativity; + + bool cTraceCachePresent; + + uint32_t cTraceCacheMicroOps; + uint32_t cTraceCacheAssociativity; + uint32_t uOnChipFPU; + uint32_t uLogicalProcessorCount; + uint32_t uAPICID; + + bool rFeature10; + bool rFeature20; + bool rFeature33; + bool rFeature34; + bool rFeature37; + bool rFeature38; + bool rFeature39; + bool rFeature41; + bool rFeature42; + bool rFeature43; + bool rFeature44; + bool rFeature45; + bool rFeature46; + bool rFeature47; + bool rFeature48; + bool rFeature49; + bool rFeature50; + bool rFeature51; + bool rFeature52; + bool rFeature53; + bool rFeature54; + bool rFeature55; + bool rFeature56; + bool rFeature57; + bool rFeature58; + bool rFeature59; + bool rFeature60; + bool rFeature61; + bool rFeature62; + bool rFeature63; + +} prcInformation; + +void prcInit(void); +void prcIdentify(uint64_t processor, prcInformation* information); +void prcCPUID(uint64_t processor, uint32_t function, uint32_t *a, uint32_t *b, uint32_t *c, uint32_t *d); +void IdentifyIntelCache(prcInformation* information, int descriptor); +void IdentifyProcessor(prcInformation* information, int Extra); + +typedef union __CPU___PROCINFORMATIONDATA__ +{ + unsigned int d; + unsigned short w[2]; + unsigned char b[4]; +} prcIdentificationData; + +void printf(const char *fmt, ...); + +void init_cpu(void) +{ + prcInformation information; + prcIdentify(0, &information); + //logStatus(logSuccess); + //logSubItem("Processor #0", information.pName); + //logSubItem("MMX", information.iMMX ? "Yes" : "No"); + printf("Proccessor: %s MMX %s", information.pName, information.iMMX ? "Yes" : "No"); +} + +void prcIdentify(uint64_t processor, prcInformation* information) +{ + uint32_t a, b, c, d; + uint32_t highestStandard, highestExtended; + int i, n, Extra; + + /*** 0x00000000 - Vendor **********************/ + prcCPUID(processor, 0x00000000, &a, &b, &c, &d); + + highestStandard = a; + + *((uint32_t*)(information->vVendor + 0)) = b; + *((uint32_t*)(information->vVendor + 4)) = d; + *((uint32_t*)(information->vVendor + 8)) = c; + information->vVendor[12] = '\0'; + + + /*** 0x00000001 - Version and Features ********/ + prcCPUID(processor, 0x00000001, &a, &b, &c, &d); + + information->vStepping = (a & 0x0000000F) >> 0; + information->vModel = (a & 0x000000F0) >> 4; + information->vFamily = (a & 0x00000F00) >> 8; + information->vType = (a & 0x00003000) >> 12; + + if(information->vModel == 0xF) information->vModel += (a & 0x000F0000) >> 16; + if(information->vFamily == 0xF) information->vFamily += (a & 0x0FF00000) >> 20; + + information->uOnChipFPU = (d >> 0) & 0x00000001; + information->fVirtualModeExtensions = (d >> 1) & 0x00000001; + information->fDebuggingExtensions = (d >> 2) & 0x00000001; + information->fPageSizeExtension = (d >> 3) & 0x00000001; + information->fTimeStampCounter = (d >> 4) & 0x00000001; + information->fModelSpecificRegisters = (d >> 5) & 0x00000001; + information->fPhysicalAddressExtension = (d >> 6) & 0x00000001; + information->fMachineCheckException = (d >> 7) & 0x00000001; + information->iCompareExchange64 = (d >> 8) & 0x00000001; + information->fLocalAPIC = (d >> 9) & 0x00000001; + information->rFeature10 = (d >> 10) & 0x00000001; + information->iFastSystemCall = (d >> 11) & 0x00000001; + information->fMemoryTypeRangeRegisters = (d >> 12) & 0x00000001; + information->fPageGlobalEnable = (d >> 13) & 0x00000001; + information->fMachineCheckArchitecture = (d >> 14) & 0x00000001; + information->iConditionalMove = (d >> 15) & 0x00000001; + information->fPageAttributeTable = (d >> 16) & 0x00000001; + information->fPageSizeExtension = (d >> 17) & 0x00000001; + information->fProcessorSerialNumber = (d >> 18) & 0x00000001; + information->iCLFLUSH = (d >> 19) & 0x00000001; + information->rFeature20 = (d >> 20) & 0x00000001; + information->fDebugStore = (d >> 21) & 0x00000001; + information->fACPI = (d >> 22) & 0x00000001; + information->iMMX = (d >> 23) & 0x00000001; + information->iFXSR = (d >> 24) & 0x00000001; + information->iSSE = (d >> 25) & 0x00000001; + information->iSSE2 = (d >> 26) & 0x00000001; + information->fSelfSnoop = (d >> 27) & 0x00000001; + information->fHyperThreading = (d >> 28) & 0x00000001; + information->fThermalMonitor = (d >> 29) & 0x00000001; + information->fIA64 = (d >> 30) & 0x00000001; + information->fSignalBreakOnFERR = (d >> 31) & 0x00000001; + + information->iSSE3 = (c >> 0) & 0x00000001; + information->rFeature33 = (c >> 1) & 0x00000001; + information->rFeature34 = (c >> 2) & 0x00000001; + information->iMonitor = (c >> 3) & 0x00000001; + information->fQualifiedDebugStore = (c >> 4) & 0x00000001; + information->rFeature37 = (c >> 5) & 0x00000001; + information->rFeature38 = (c >> 6) & 0x00000001; + information->rFeature39 = (c >> 7) & 0x00000001; + information->fThermalMonitor2 = (c >> 8) & 0x00000001; + information->rFeature41 = (c >> 9) & 0x00000001; + information->fContextID = (c >> 10) & 0x00000001; + information->rFeature43 = (c >> 11) & 0x00000001; + information->rFeature44 = (c >> 12) & 0x00000001; + information->rFeature45 = (c >> 13) & 0x00000001; + information->rFeature46 = (c >> 14) & 0x00000001; + information->rFeature47 = (c >> 15) & 0x00000001; + information->rFeature48 = (c >> 16) & 0x00000001; + information->rFeature49 = (c >> 17) & 0x00000001; + information->rFeature50 = (c >> 18) & 0x00000001; + information->rFeature51 = (c >> 19) & 0x00000001; + information->rFeature52 = (c >> 20) & 0x00000001; + information->rFeature53 = (c >> 21) & 0x00000001; + information->rFeature54 = (c >> 22) & 0x00000001; + information->rFeature55 = (c >> 23) & 0x00000001; + information->rFeature56 = (c >> 24) & 0x00000001; + information->rFeature57 = (c >> 25) & 0x00000001; + information->rFeature58 = (c >> 26) & 0x00000001; + information->rFeature59 = (c >> 27) & 0x00000001; + information->rFeature60 = (c >> 28) & 0x00000001; + information->rFeature61 = (c >> 29) & 0x00000001; + information->rFeature62 = (c >> 30) & 0x00000001; + information->rFeature63 = (c >> 31) & 0x00000001; + + information->vBrand = (b & 0x000000FF) >> 0; + if(information->iCLFLUSH) + information->cLineSize = (b & 0x0000FF00) >> 8; + if(information->fHyperThreading) + information->uLogicalProcessorCount = (b & 0x00FF0000) >> 16; + if(information->vFamily >= 0xF) + information->uAPICID = (b & 0xFF000000) >> 24; + + /*** 0x00000002 - Cache Descriptors ***********/ + n = 1; + + for(i = 0; i < n; i++) + { + prcCPUID(processor, 0x00000002, &a, &b, &c, &d); + + n = a & 0x000000FF; + + if(!(a & 0x80000000)) + { + IdentifyIntelCache(information, (a >> 8) & 0x000000FF); + IdentifyIntelCache(information, (a >> 16) & 0x000000FF); + IdentifyIntelCache(information, (a >> 24) & 0x000000FF); + } + + if(!(b & 0x80000000)) + { + IdentifyIntelCache(information, (b >> 0) & 0x000000FF); + IdentifyIntelCache(information, (b >> 8) & 0x000000FF); + IdentifyIntelCache(information, (b >> 16) & 0x000000FF); + IdentifyIntelCache(information, (b >> 24) & 0x000000FF); + } + + if(!(c & 0x80000000)) + { + IdentifyIntelCache(information, (c >> 0) & 0x000000FF); + IdentifyIntelCache(information, (c >> 8) & 0x000000FF); + IdentifyIntelCache(information, (c >> 16) & 0x000000FF); + IdentifyIntelCache(information, (c >> 24) & 0x000000FF); + } + + if(!(d & 0x80000000)) + { + IdentifyIntelCache(information, (d >> 0) & 0x000000FF); + IdentifyIntelCache(information, (d >> 8) & 0x000000FF); + IdentifyIntelCache(information, (d >> 16) & 0x000000FF); + IdentifyIntelCache(information, (d >> 24) & 0x000000FF); + } + } + + /*** 0x00000003 - Serial Number ***************/ + + /*** 0x00000004 - Cache Parameters ************/ + + /*** 0x00000005 - Monitor *********************/ + + /** + * THE EXTRA NUMBER + * Type + * Pentium II + III Cache + * Pentium III + 4 Brand ID + * Athlon Multi Processing / Cache + */ + + Extra = information->vType; + + if(!strcmp(information->vVendor, "GenuineIntel") + && information->vFamily == 6 + && information->vModel >= 3 + && information->vModel <= 7) + { + Extra = information->cL2UnifiedCacheSize; + } + + if(!strcmp(information->vVendor, "GenuineIntel") + && information->vFamily == 6 + && information->vModel >= 8) + { + Extra = information->vBrand; + } + + if(!strcmp(information->vVendor, "GenuineIntel") + && information->vFamily == 0xF) + { + Extra = information->vBrand; + } + + if(!strcmp(information->vVendor, "AuthenticAMD") + && information->vFamily == 6) + { + Extra = 0; + } + + IdentifyProcessor(information, Extra); +} + +void prcCPUID(uint64_t processor, uint32_t function, uint32_t *a, uint32_t *b, uint32_t *c, uint32_t *d) +{ + asm + ( + "cpuid" + : "=a" (*a), "=b" (*b), "=c" (*c), "=d" (*d) + : "a" (function) + ); +} + +void IdentifyIntelCache(prcInformation* information, int descriptor) +{ + switch(descriptor) + { + case 0x00: + return; + case 0x40: + return; + case 0x01: + information->cL1CodeTLB4KEntries = 32; + information->cL1CodeTLB4KAssociativity = 4; + return; + case 0x02: + information->cL1CodeTLB4MEntries = 2; + information->cL1CodeTLB4MAssociativity = -1; + return; + case 0x03: + information->cL1DataTLB4KEntries = 64; + information->cL1DataTLB4KAssociativity = 4; + return; + case 0x04: + information->cL1DataTLB4MEntries = 8; + information->cL1DataTLB4MAssociativity = 4; + return; + case 0x06: + information->cL1CodeCacheSize = 8; + information->cL1CodeCacheAssociativity = 4; + information->cL1CodeCacheLineSize = 32; + information->cL1CodeCacheLinesPerTag = -1; + return; + case 0x08: + information->cL1CodeCacheSize = 16; + information->cL1CodeCacheAssociativity = 4; + information->cL1CodeCacheLineSize = 32; + information->cL1CodeCacheLinesPerTag = -1; + return; + case 0x0A: + information->cL1DataCacheSize = 8; + information->cL1DataCacheAssociativity = 2; + information->cL1DataCacheLineSize = 32; + information->cL1DataCacheLinesPerTag = -1; + return; + case 0x0C: + information->cL1DataCacheSize = 16; + information->cL1DataCacheAssociativity = 4; + information->cL1DataCacheLineSize = 32; + information->cL1DataCacheLinesPerTag = -1; + return; + case 0x22: + information->cL3UnifiedCacheSize = 512; + information->cL3UnifiedCacheAssociativity = 4; + information->cL3UnifiedCacheLineSize = 64; + information->cL3UnifiedCacheLinesPerTag = -1; + return; + case 0x23: + information->cL3UnifiedCacheSize = 1024; + information->cL3UnifiedCacheAssociativity = 8; + information->cL3UnifiedCacheLineSize = 64; + information->cL3UnifiedCacheLinesPerTag = -1; + return; + case 0x25: + information->cL3UnifiedCacheSize = 2048; + information->cL3UnifiedCacheAssociativity = 8; + information->cL3UnifiedCacheLineSize = 64; + information->cL3UnifiedCacheLinesPerTag = -1; + return; + case 0x29: + information->cL3UnifiedCacheSize = 4096; + information->cL3UnifiedCacheAssociativity = 8; + information->cL3UnifiedCacheLineSize = 64; + information->cL3UnifiedCacheLinesPerTag = -1; + return; + case 0x39: + information->cL2UnifiedCacheSize = 128; + information->cL2UnifiedCacheAssociativity = 4; + information->cL2UnifiedCacheLineSize = 64; + information->cL2UnifiedCacheLinesPerTag = -1; + return; + case 0x3B: + information->cL2UnifiedCacheSize = 128; + information->cL2UnifiedCacheAssociativity = 2; + information->cL2UnifiedCacheLineSize = 64; + information->cL2UnifiedCacheLinesPerTag = -1; + return; + case 0x3C: + information->cL2UnifiedCacheSize = 256; + information->cL2UnifiedCacheAssociativity = 4; + information->cL2UnifiedCacheLineSize = 64; + information->cL2UnifiedCacheLinesPerTag = -1; + return; + case 0x41: + information->cL2UnifiedCacheSize = 128; + information->cL2UnifiedCacheAssociativity = 4; + information->cL2UnifiedCacheLineSize = 32; + information->cL2UnifiedCacheLinesPerTag = -1; + return; + case 0x42: + information->cL2UnifiedCacheSize = 256; + information->cL2UnifiedCacheAssociativity = 4; + information->cL2UnifiedCacheLineSize = 32; + information->cL2UnifiedCacheLinesPerTag = -1; + return; + case 0x43: + information->cL2UnifiedCacheSize = 512; + information->cL2UnifiedCacheAssociativity = 4; + information->cL2UnifiedCacheLineSize = 32; + information->cL2UnifiedCacheLinesPerTag = -1; + return; + case 0x44: + information->cL2UnifiedCacheSize = 1024; + information->cL2UnifiedCacheAssociativity = 4; + information->cL2UnifiedCacheLineSize = 32; + information->cL2UnifiedCacheLinesPerTag = -1; + return; + case 0x45: + information->cL2UnifiedCacheSize = 2048; + information->cL2UnifiedCacheAssociativity = 4; + information->cL2UnifiedCacheLineSize = 32; + information->cL2UnifiedCacheLinesPerTag = -1; + return; + case 0x50: + information->cL1CodeTLB4KEntries = 64; + information->cL1CodeTLB4KAssociativity = -1; + information->cL1CodeTLB2MEntries = 64; + information->cL1CodeTLB2MAssociativity = -1; + information->cL1CodeTLB4MEntries = 64; + information->cL1CodeTLB4MAssociativity = -1; + return; + case 0x51: + information->cL1CodeTLB4KEntries = 128; + information->cL1CodeTLB4KAssociativity = -1; + information->cL1CodeTLB2MEntries = 128; + information->cL1CodeTLB2MAssociativity = -1; + information->cL1CodeTLB4MEntries = 128; + information->cL1CodeTLB4MAssociativity = -1; + return; + case 0x52: + information->cL1CodeTLB4KEntries = 256; + information->cL1CodeTLB4KAssociativity = -1; + information->cL1CodeTLB2MEntries = 256; + information->cL1CodeTLB2MAssociativity = -1; + information->cL1CodeTLB4MEntries = 256; + information->cL1CodeTLB4MAssociativity = -1; + return; + case 0x5B: + information->cL1DataTLB4KEntries = 64; + information->cL1DataTLB4KAssociativity = -1; + information->cL1DataTLB4MEntries = 64; + information->cL1DataTLB4MAssociativity = -1; + return; + case 0x5C: + information->cL1DataTLB4KEntries = 128; + information->cL1DataTLB4KAssociativity = -1; + information->cL1DataTLB4MEntries = 128; + information->cL1DataTLB4MAssociativity = -1; + return; + case 0x5D: + information->cL1DataTLB4KEntries = 256; + information->cL1DataTLB4KAssociativity = -1; + information->cL1DataTLB4MEntries = 256; + information->cL1DataTLB4MAssociativity = -1; + return; + case 0x66: + information->cL1DataCacheSize = 8; + information->cL1DataCacheAssociativity = 4; + information->cL1DataCacheLineSize = 64; + information->cL1DataCacheLinesPerTag = -1; + return; + case 0x67: + information->cL1DataCacheSize = 16; + information->cL1DataCacheAssociativity = 4; + information->cL1DataCacheLineSize = 64; + information->cL1DataCacheLinesPerTag = -1; + return; + case 0x68: + information->cL1DataCacheSize = 32; + information->cL1DataCacheAssociativity = 4; + information->cL1DataCacheLineSize = 64; + information->cL1DataCacheLinesPerTag = -1; + return; + case 0x70: + information->cTraceCacheMicroOps = 12; + information->cTraceCacheAssociativity = 8; + return; + case 0x71: + information->cTraceCacheMicroOps = 16; + information->cTraceCacheAssociativity = 8; + return; + case 0x72: + information->cTraceCacheMicroOps = 32; + information->cTraceCacheAssociativity = 8; + return; + case 0x77: + information->cL1CodeCacheSize = 16; + information->cL1CodeCacheAssociativity = 4; + information->cL1CodeCacheLineSize = 64; + information->cL1CodeCacheLinesPerTag = -1; + return; + case 0x79: + information->cL2UnifiedCacheSize = 128; + information->cL2UnifiedCacheAssociativity = 8; + information->cL2UnifiedCacheLineSize = 64; + information->cL2UnifiedCacheLinesPerTag = -1; + return; + case 0x7A: + information->cL2UnifiedCacheSize = 256; + information->cL2UnifiedCacheAssociativity = 8; + information->cL2UnifiedCacheLineSize = 64; + information->cL2UnifiedCacheLinesPerTag = -1; + return; + case 0x7B: + information->cL2UnifiedCacheSize = 512; + information->cL2UnifiedCacheAssociativity = 8; + information->cL2UnifiedCacheLineSize = 64; + information->cL2UnifiedCacheLinesPerTag = -1; + return; + case 0x7C: + information->cL2UnifiedCacheSize = 1024; + information->cL2UnifiedCacheAssociativity = 8; + information->cL2UnifiedCacheLineSize = 64; + information->cL2UnifiedCacheLinesPerTag = -1; + return; + case 0x7E: + information->cL2UnifiedCacheSize = 256; + information->cL2UnifiedCacheAssociativity = 8; + information->cL2UnifiedCacheLineSize = 128; + information->cL2UnifiedCacheLinesPerTag = -1; + return; + case 0x82: + information->cL2UnifiedCacheSize = 128; + information->cL2UnifiedCacheAssociativity = 8; + information->cL2UnifiedCacheLineSize = 32; + information->cL2UnifiedCacheLinesPerTag = -1; + return; + case 0x83: + information->cL2UnifiedCacheSize = 256; + information->cL2UnifiedCacheAssociativity = 8; + information->cL2UnifiedCacheLineSize = 32; + information->cL2UnifiedCacheLinesPerTag = -1; + return; + case 0x84: + information->cL2UnifiedCacheSize = 512; + information->cL2UnifiedCacheAssociativity = 8; + information->cL2UnifiedCacheLineSize = 32; + information->cL2UnifiedCacheLinesPerTag = -1; + return; + case 0x85: + information->cL2UnifiedCacheSize = 1024; + information->cL2UnifiedCacheAssociativity = 8; + information->cL2UnifiedCacheLineSize = 32; + information->cL2UnifiedCacheLinesPerTag = -1; + return; + case 0x8D: + information->cL3UnifiedCacheSize = 3072; + information->cL3UnifiedCacheAssociativity = 12; + information->cL3UnifiedCacheLineSize = 128; + information->cL3UnifiedCacheLinesPerTag = -1; + return; + } + + /*printf("Unknown Intel Cache Descriptor: %x\n", CacheDescriptor);*/ +} + +int AMDAssociativity(int Value) +{ + switch (Value) + { + case 0x00: return 0; + case 0x01: return 1; + case 0x02: return 2; + case 0x04: return 4; + case 0x06: return 8; + case 0x08: return 16; + case 0x0F: return -1; + } + + /*puts("Unknown AMD Cache Descriptor");*/ + return -1; +} + +void IdentifyProcessor(prcInformation* information, int Extra) +{ + int i; + + for(i = 0; i < (sizeof(ProcessorList) / sizeof(PROCLIST)); i++) + { + if(ProcessorList[i].id == 0x02000000 + (information->vFamily << 16) + (information->vModel << 8) + Extra) + { + information->pName = ProcessorList[i].name; + information->pCertified = ProcessorList[i].verified; + return; + } + } + + for(i = 0; i < (sizeof(ProcessorList) / sizeof(PROCLIST)); i++) + { + if(ProcessorList[i].id == 0x020000FF + (information->vFamily << 16) + (information->vModel << 8)) + { + information->pName = ProcessorList[i].name; + information->pCertified = ProcessorList[i].verified; + return; + } + } + + for(i = 0; i < (sizeof(ProcessorList) / sizeof(PROCLIST)); i++) + { + if(ProcessorList[i].id == 0x0200FFFF + (information->vFamily << 16)) + { + information->pName = ProcessorList[i].name; + information->pCertified = ProcessorList[i].verified; + return; + } + } + + for(i = 0; i < (sizeof(ProcessorList) / sizeof(PROCLIST)); i++) + { + if(ProcessorList[i].id == 0x02FFFFFF) + { + information->pName = ProcessorList[i].name; + information->pCertified = ProcessorList[i].verified; + return; + } + } + + information->pName = "Unknown Processor"; + information->pCertified = false; +} diff --git a/Dump/hybos/src/kernel/debug.c b/Dump/hybos/src/kernel/debug.c new file mode 100644 index 0000000..c253857 --- /dev/null +++ b/Dump/hybos/src/kernel/debug.c @@ -0,0 +1,54 @@ +/*============================================================================ +DEBUG FUNCTIONS + +EXPORTS: +void dump_regs(regs_t *regs); +============================================================================*/ +#include "_krnl.h" + +/* IMPORTS +from MAIN.C */ +void printf(const char *fmt, ...); +/***************************************************************************** +*****************************************************************************/ +#define BPERL 16 /* byte/line for dump */ + +void dump(unsigned char *data, unsigned count) +{ + unsigned char byte1, byte2; + + while(count != 0) + { + for(byte1 = 0; byte1 < BPERL; byte1++) + { + if(count == 0) + break; + printf("%02X ", data[byte1]); + count--; + } + printf("\t"); + for(byte2 = 0; byte2 < byte1; byte2++) + { + if(data[byte2] < ' ') + printf("%c", '.'); + else + printf("%c", data[byte2]); + } + printf("\n"); + data += BPERL; + } +} +/***************************************************************************** +*****************************************************************************/ +void dump_regs(regs_t *regs) +{ + printf("EDI=%08X ESI=%08X EBP=%08X ESP=%08X\n", + regs->edi, regs->esi, regs->ebp, regs->esp); + printf("EBX=%08X EDX=%08X ECX=%08X EAX=%08X\n", + regs->ebx, regs->edx, regs->ecx, regs->eax); + printf(" DS=%08X ES=%08X FS=%08X GS=%08X\n", + regs->ds, regs->es, regs->fs, regs->gs); + printf("int=%08X err=%08X EIP=%08X CS=%08X\n", + regs->which_int, regs->err_code, regs->eip, regs->cs); + printf("uSP=%08X uSS=%08X\n", regs->user_esp, regs->user_ss); +} diff --git a/Dump/hybos/src/kernel/keyboard.c b/Dump/hybos/src/kernel/keyboard.c new file mode 100644 index 0000000..495f98a --- /dev/null +++ b/Dump/hybos/src/kernel/keyboard.c @@ -0,0 +1,585 @@ +/** + * keyboard.c + * + * Main keyboard handling routines. + * + * Exports: + * keyboard_irq(); + * init_keyboard(); + * + * Imports: + * video.c console_t _vc[]; + * video.c select_vc(); + * video.c putch(); + * main.c printf(); + * main.c printk(); + */ + +//#include /* key scancode definitions */ +#include +#include /* outportb, inportb(), etc */ +#include +#include /* shell commands */ +#include "_krnl.h" /* MAX_VC */ +#include "bootlog.h" /* klog() */ + +#define KBD_BUF_SIZE 64 + +/** + * Imports + */ +extern console_t _vc[]; +void select_vc(unsigned which_vc); +void putch(unsigned c); +void printf(const char *fmt, ...); +void printk(int type, const char *fmt, ...); +void dumpheapk(void); +void testheap(void); + +unsigned get_current_vc(); + +static int rawkey, keys[128]; +static int numkeysbuffer; + +static char szInBuf[KBD_BUF_SIZE]; + +/** + * 0 if not set + * 1 if make code + * 2 if break code + */ +static int makebreak; + +/** + * reboot() + * + */ +static void reboot(void) +{ + unsigned temp; + + disable(); + + /** + * flush the keyboard controller + */ + do + { + temp = inportb(0x64); + if((temp & 0x01) != 0) + { + (void)inportb(0x60); + continue; + } + } while((temp & 0x02) != 0); + + /** + * now pulse the cpu reset line + */ + outportb(0x64, 0xFE); + + /** + * if that didn't work, just halt + */ + while(1); +} + +/** + * XXX + * + * I'm not even sure if we need the following functions yet, + * however they are here just in case. Leave them alone. + */ + +/** + * _write_kb() + * + */ +static void _write_kb(unsigned adr, unsigned d) +{ + unsigned long t; + unsigned s; + + for(t = 5000000L; t != 0; t--) + { + s = inportb(0x64); + + /** + * loop until 8042 input buffer is empty + */ + if((s & 0x02) == 0) + break; + } + + if(t != 0) + outportb(adr, d); +} + +/** + * _kb_wait() + * + */ +static inline void _kb_wait(void) +{ + int i; + + for(i = 0; i < 0x1000000; i++) + if((inportb(0x64) & 0x02) == 0) + return; + + printk(0, "Keyboard timeout\n"); +} + +/** + * _kb_send() + * + */ +static inline void _kb_send(unsigned char c) +{ + _kb_wait(); + outportb(c, 0x64); +} + +/** + * _translate_sc() + * + * Translates a scancode from the keyboard + */ +unsigned _translate_sc(unsigned k) +{ + unsigned c; + static unsigned altk; + unsigned donefirst = 0; + + if(k == KEY_BKSPACE) + { + if(numkeysbuffer - 1 < 0) + { + numkeysbuffer = 0; + return 0; + } + } + + switch(k) + { + case 0xE0: + altk = 1; c = 0; donefirst = 1; break; + case KEY_TILDA: /* ` or ~ */ + c = (keys[KEY_LSHIFT] || keys[KEY_RSHIFT]) ? 126 : 126; break; + case KEY_END: c = 0; if(keys[KEYP_NUMLCK] && altk == 0) c = 49; break; + case KEY_1: + c = (keys[KEY_LSHIFT] || keys[KEY_RSHIFT]) ? 33 : 49; break; + case KEY_DOWN: c = 0; if(keys[KEYP_NUMLCK] && altk == 0) c = 50; break; + case KEY_2: + c = (keys[KEY_LSHIFT] || keys[KEY_RSHIFT]) ? 64 : 50; break; + case KEY_PGDOWN: c = 0; if(keys[KEYP_NUMLCK] && altk == 0) c = 51; break; + case KEY_3: + c = (keys[KEY_LSHIFT] || keys[KEY_RSHIFT]) ? 35 : 51; break; + case KEY_LEFT: c = 0; if(keys[KEYP_NUMLCK] && altk == 0) c = 52; break; + case KEY_4: + c = (keys[KEY_LSHIFT] || keys[KEY_RSHIFT]) ? 36 : 52; break; + case KEYP_5: c = 0; if(keys[KEYP_NUMLCK] && altk == 0) c = 53; break; + case KEY_5: + c = (keys[KEY_LSHIFT] || keys[KEY_RSHIFT]) ? 35 : 53; break; + case KEY_RIGHT: c = 0; if(keys[KEYP_NUMLCK] && altk == 0) c = 54; break; + case KEY_6: + c = (keys[KEY_LSHIFT] || keys[KEY_RSHIFT]) ? 94 : 54; break; + case KEY_HOME: c = 0; if(keys[KEYP_NUMLCK] && altk == 0) c = 55; break; + case KEY_7: + c = (keys[KEY_LSHIFT] || keys[KEY_RSHIFT]) ? 38 : 55; break; + case KEY_UP: c = 0; if(keys[KEYP_NUMLCK] && altk == 0) c = 56; break; + case KEYP_ASTERISK: c = 42; break; + case KEY_8: + c = (keys[KEY_LSHIFT] || keys[KEY_RSHIFT]) ? 42 : 56; break; + case KEY_PGUP: c = 0; if(keys[KEYP_NUMLCK] && altk == 0) c = 57; break; + case KEY_9: + c = (keys[KEY_LSHIFT] || keys[KEY_RSHIFT]) ? 40 : 57; break; + case KEY_INSERT: c = 0; if(keys[KEYP_NUMLCK] && altk == 0) c = 48; break; + case KEY_0: + c = (keys[KEY_LSHIFT] || keys[KEY_RSHIFT]) ? 41 : 48; break; + case KEYP_MINUS: c = 45; break; + case KEY_MINUS: + c = (keys[KEY_LSHIFT] || keys[KEY_RSHIFT]) ? 95 : 45; break; + case KEYP_PLUS: c = 43; break; + case KEY_PLUS: + c = (keys[KEY_LSHIFT] || keys[KEY_RSHIFT]) ? 61 : 43; break; + case KEY_BKSLASH: + c = (keys[KEY_LSHIFT] || keys[KEY_RSHIFT]) ? 124 : 92; break; + case KEY_Q: + c = (keys[KEY_LSHIFT] || keys[KEY_RSHIFT]) ? 81 : 113; break; + case KEY_W: + c = (keys[KEY_LSHIFT] || keys[KEY_RSHIFT]) ? 87 : 119; break; + case KEY_E: + c = (keys[KEY_LSHIFT] || keys[KEY_RSHIFT]) ? 69 : 101; break; + case KEY_R: + c = (keys[KEY_LSHIFT] || keys[KEY_RSHIFT]) ? 82 : 114; break; + case KEY_T: + c = (keys[KEY_LSHIFT] || keys[KEY_RSHIFT]) ? 84 : 116; break; + case KEY_Y: + c = (keys[KEY_LSHIFT] || keys[KEY_RSHIFT]) ? 89 : 121; break; + case KEY_U: + c = (keys[KEY_LSHIFT] || keys[KEY_RSHIFT]) ? 85 : 117; break; + case KEY_I: + c = (keys[KEY_LSHIFT] || keys[KEY_RSHIFT]) ? 73 : 105; break; + case KEY_O: + c = (keys[KEY_LSHIFT] || keys[KEY_RSHIFT]) ? 79 : 111; break; + case KEY_P: + c = (keys[KEY_LSHIFT] || keys[KEY_RSHIFT]) ? 80 : 112; break; + case KEY_LBRACKET: + c = (keys[KEY_LSHIFT] || keys[KEY_RSHIFT]) ? 123 : 91; break; + case KEY_RBRACKET: + c = (keys[KEY_LSHIFT] || keys[KEY_RSHIFT]) ? 125 : 93; break; + case KEY_ENTER: + c = (keys[KEY_LSHIFT] || keys[KEY_RSHIFT]) ? 10 : 10; break; + case KEY_A: + c = (keys[KEY_LSHIFT] || keys[KEY_RSHIFT]) ? 65 : 97; break; + case KEY_S: + c = (keys[KEY_LSHIFT] || keys[KEY_RSHIFT]) ? 83 : 115; break; + case KEY_D: + c = (keys[KEY_LSHIFT] || keys[KEY_RSHIFT]) ? 68 : 100; break; + case KEY_F: + c = (keys[KEY_LSHIFT] || keys[KEY_RSHIFT]) ? 70 : 102; break; + case KEY_G: + c = (keys[KEY_LSHIFT] || keys[KEY_RSHIFT]) ? 71 : 103; break; + case KEY_H: + c = (keys[KEY_LSHIFT] || keys[KEY_RSHIFT]) ? 72 : 104; break; + case KEY_J: + c = (keys[KEY_LSHIFT] || keys[KEY_RSHIFT]) ? 74 : 106; break; + case KEY_K: + c = (keys[KEY_LSHIFT] || keys[KEY_RSHIFT]) ? 75 : 107; break; + case KEY_L: + c = (keys[KEY_LSHIFT] || keys[KEY_RSHIFT]) ? 76 : 108; break; + case KEY_SEMICOLON: + c = (keys[KEY_LSHIFT] || keys[KEY_RSHIFT]) ? 58 : 59; break; + case KEY_QUOTE: + c = (keys[KEY_LSHIFT] || keys[KEY_RSHIFT]) ? 34 : 39; break; + case KEY_Z: + c = (keys[KEY_LSHIFT] || keys[KEY_RSHIFT]) ? 90 : 122; break; + case KEY_X: + c = (keys[KEY_LSHIFT] || keys[KEY_RSHIFT]) ? 88 : 120; break; + case KEY_C: + c = (keys[KEY_LSHIFT] || keys[KEY_RSHIFT]) ? 67 : 99; break; + case KEY_V: + c = (keys[KEY_LSHIFT] || keys[KEY_RSHIFT]) ? 86 : 118; break; + case KEY_B: + c = (keys[KEY_LSHIFT] || keys[KEY_RSHIFT]) ? 66 : 98; break; + case KEY_N: + c = (keys[KEY_LSHIFT] || keys[KEY_RSHIFT]) ? 78 : 110; break; + case KEY_M: + c = (keys[KEY_LSHIFT] || keys[KEY_RSHIFT]) ? 77 : 109; break; + case KEY_COMMA: + c = (keys[KEY_LSHIFT] || keys[KEY_RSHIFT]) ? 60 : 44; break; + case KEY_DEL: c = 0; if(keys[KEYP_NUMLCK] && altk == 0) c = 46; break; + case KEY_PERIOD: + c = (keys[KEY_LSHIFT] || keys[KEY_RSHIFT]) ? 62 : 46; break; + case KEY_SLASH: + c = (keys[KEY_LSHIFT] || keys[KEY_RSHIFT]) ? 63 : 47; break; + case KEY_SPACE: + c = (keys[KEY_LSHIFT] || keys[KEY_RSHIFT]) ? 32 : 32; break; + case KEY_BKSPACE: c = '\b'; break; /* just for now */ + default: + c = 0; + } + + if(donefirst == 0) + altk = 0; + + if(keys[KEY_CAPS]) + { + if(keys[KEY_LSHIFT] || keys[KEY_RSHIFT]) + { + if(c >= 'A' && c <= 'Z') + c += 32; + } + else + { + if(c >= 'a' && c <= 'z') + c -= 32; + } + } + + /** + * Simple shell for now + */ + if(c != 0 && c != '\n' && c != '\b') + { + if((numkeysbuffer - 1) == KBD_BUF_SIZE) + { + numkeysbuffer = 0; + szInBuf[0] = '\0'; + + szInBuf[numkeysbuffer] = c; + numkeysbuffer++; + } + else + { + szInBuf[numkeysbuffer] = c; + numkeysbuffer++; + } + } + else if(c == '\n') + { + printf("\n"); + /** + * Make it a real string + */ + szInBuf[numkeysbuffer] = '\0'; + + /** + * Process command + */ + processCommand(&szInBuf[0], numkeysbuffer - 1); + + /** + * Clear buffer + */ + numkeysbuffer = 0; + szInBuf[0] = '\0'; + + /** + * Print "line" + */ + printf("$ "); + + c = 0; + } + else if(c == '\b') + { + szInBuf[numkeysbuffer] = '\0'; + numkeysbuffer--; + printf("\b \b"); + + c = 0; + } + + return c; +} + +/** + * handle_meta_key() + * + * I'll pretty this up later + */ +void handle_meta_key(unsigned k) +{ + int i; + k = k; /* to shut gcc up */ + + /** + * Check for the infamous three finger salute + */ + if((keys[KEY_RCTRL] || keys[KEY_LCTRL]) && + (keys[KEY_RALT] || keys[KEY_LALT]) && + keys[KEY_DEL]) + { + /** + * FIXME + * + * This should call _send_signal() + */ + reboot(); + } + + /** + * Check for Alt + F1-F12 for virtual terminals + */ + for(i = 0; i < 10; i++) + { + if((keys[KEY_LALT] || keys[KEY_RALT]) && keys[i + KEY_F1]) + { + select_vc(i); + return; + } + } + + if((keys[KEY_LALT] || keys[KEY_RALT]) && keys[KEY_F11]) + { + select_vc(10); + return; + } + + if((keys[KEY_LALT] || keys[KEY_RALT]) && keys[KEY_F12]) + { + select_vc(11); + return; + } +} + +/** + * keyboard_irq() + * + * Called when a keyboard interrupt is generated. + */ +void keyboard_irq(void) +{ + register char a; + unsigned c; + unsigned short kbdstat; + + rawkey = inportb(0x60); + outportb(0x61, (a=inportb(0x61)|0x82)); + outportb(0x61, a & 0x7F); + + /** + * If it's less than 0x80 then it's definatelly + * a make code or a repeat code + */ + if(rawkey < 0x80) + { + /** + * We don't want to gunk up the numlock key + * because we will define it's state in the + * break code a bit later + */ + if((rawkey != KEYP_NUMLCK) && (rawkey != KEY_SCRLCK) && (rawkey != KEY_CAPS)) + keys[rawkey] = 1; + + keyDown(rawkey); + } + else /* rawkey >= 0x80 */ + { + if(rawkey == 0xE0) + { + /** + * It's either a make code, break code, or repeat code + */ + rawkey = inportb(0x60); + outportb(0x61, (a=inportb(0x61)|0x82)); + outportb(0x61, a & 0x7F); + + if(rawkey < 0x80) + { + /** + * Ok, it's a make code or repeat code for the numeric + * keypad (gray keys) + */ + + keys[rawkey] = 1; + + keyDown(rawkey); + } + else /* rawkey >= 0x80 */ + { + /** + * It's either a make code for the numeric keypad or + * a break code for the numeric keypad. + */ + if(rawkey == 0x2A) + { + /** + * Ok, we have a make code for the numeric keypad + * and NUMLOCK is on. The second byte is what we + * want since what we have so far is this: + * + * 0xE0 0x2A + */ + rawkey = inportb(0x60); + outportb(0x61, (a=inportb(0x61)|0x82)); + outportb(0x61, a & 0x7F); + + rawkey = inportb(0x60); + outportb(0x61, (a=inportb(0x61)|0x82)); + outportb(0x61, a & 0x7F); + + keys[rawkey] = 1; + + keyDown(rawkey); + } + else + { + /** + * It's a break code from the numeric keypad. + */ + keys[rawkey] = 0; + + keyUp(rawkey); + } + } + } + else /* rawkey != 0xE0 */ + { + /** + * It's a break code + * + * Make sure we toggle the numlock, scroll lock, and caps lock key. + */ + if(((rawkey - 0x80) == KEYP_NUMLCK) || + ((rawkey - 0x80) == KEY_SCRLCK) || + ((rawkey - 0x80) == KEY_CAPS)) + { + keys[rawkey - 0x80] = !keys[rawkey - 0x80]; + + kbdstat = 0; + if(keys[KEY_SCRLCK]) + kbdstat |= 1; + if(keys[KEYP_NUMLCK]) + kbdstat |= 2; + if(keys[KEY_CAPS]) + kbdstat |= 4; + + _write_kb(0x60, 0xED); + _write_kb(0x60, kbdstat); + outportb(0x20, 0x20); + + keyUp(rawkey); + return; + } + + keys[rawkey - 0x80] = 0; + + keyUp(rawkey); + } + } + + c = _translate_sc(rawkey); + + if(c != 0) + printf("%c", c); + else + { + /** + * We need to check for meta-key-crap here + */ + handle_meta_key(rawkey); + } + + //enable(); + outportb(0x20, 0x20); +} + +/** + * init_keyboard() + * + */ +void init_keyboard(void) +{ + static unsigned char buffers[KBD_BUF_SIZE * MAX_VC]; + + int i; + + //klog("init", "keyboard %2u buf, %2ub each", K_KLOG_PENDING, &_vc[0]); + for(i = 0; i < MAX_VC; i++) + { + _vc[i].keystrokes.data = buffers + KBD_BUF_SIZE * i; + _vc[i].keystrokes.size = KBD_BUF_SIZE; + } + + for(i = 0; i < 128; i++) + keys[i] = 0; + + makebreak = 0; + //klog(NULL, K_KLOG_SUCCESS, &_vc[0], NULL); + //kprintf("init_kbd: %u buffers, %u bytes each\n", + // MAX_VC, KBD_BUF_SIZE); + + //kprintf("[ Entering Runlevel 0 ].......................................................Ok"); + _vc[0].attrib = 8; + printf("[ "); + _vc[0].attrib = 15; + printf("init: keyboard %2u buf, %2ub each ", MAX_VC, KBD_BUF_SIZE); + _vc[0].attrib = 8; + printf("]..........................................."); + _vc[0].attrib = 2; + printf("Ok"); + _vc[0].attrib = 7; +} diff --git a/Dump/hybos/src/kernel/kstart.asm b/Dump/hybos/src/kernel/kstart.asm new file mode 100644 index 0000000..371e822 --- /dev/null +++ b/Dump/hybos/src/kernel/kstart.asm @@ -0,0 +1,391 @@ +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; 32-bit kernel startup code +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +%include "asm.inc" + +SECTION .text +;SEGMENT _TEXT USE32 CLASS=CODE +;BITS 32 + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; entry point +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +GLOBAL entry +entry: +; check if data segment linked, located, and loaded properly + mov eax,[ds_magic] + cmp eax,DS_MAGIC + je ds_ok + +; display a blinking white-on-blue 'D' and freeze + mov word [0B8000h],9F44h + jmp short $ +ds_ok: + +; stop using bootloader GDT, and load new GDT + lgdt [gdt_ptr] + + mov ax,LINEAR_DATA_SEL + mov ds,ax + mov es,ax + mov ss,ax + mov fs,ax + mov gs,ax + jmp LINEAR_CODE_SEL:sbat +sbat: + +; zero the C language BSS +; 'bss' and 'end' are defined in the linker script file +EXTERN bss, end + mov edi,bss + mov ecx,end + sub ecx,edi + xor eax,eax + rep stosb + + mov esp,stack + +; set up interrupt handlers, then load IDT register + mov ecx,(idt_end - idt) >> 3 ; number of exception handlers + mov edi,idt + mov esi,isr0 +do_idt: + mov eax,esi ; EAX=offset of entry point + mov [edi],ax ; set low 16 bits of gate offset + shr eax,16 + mov [edi + 6],ax ; set high 16 bits of gate offset + add edi,8 ; 8 bytes/interrupt gate + add esi,(isr1 - isr0) ; bytes/stub + loop do_idt + + lidt [idt_ptr] + +; GRUB 0.90 leaves the NT bit set in EFLAGS. The first IRET we attempt +; will cause a TSS-based task-switch, which will cause Exception 10. +; Let's prevent that: + push dword 2 + popf + +IMP main + call main ; call C code + jmp $ ; freeze + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; Multiboot header for GRUB bootloader. This must be in the first 8K +; of the kernel file. We use the aout kludge so it works with ELF, +; DJGPP COFF, Win32 PE, or other formats. +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +; these are in the linker script file +EXTERN code, bss, end + +ALIGN 4 +mboot: + dd MULTIBOOT_HEADER_MAGIC + dd MULTIBOOT_HEADER_FLAGS + dd MULTIBOOT_CHECKSUM +; aout kludge. These must be PHYSICAL addresses + dd mboot + dd code + dd bss + dd end + dd entry + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; interrupt/exception handlers +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +IMP fault + +; I shouldn't have to do this! +%macro PUSHB 1 + db 6Ah + db %1 +%endmacro + +%macro INTR 1 ; (byte offset from start of stub) +isr%1: + push byte 0 ; ( 0) fake error code + PUSHB %1 ; ( 2) exception number + push gs ; ( 4) push segment registers + push fs ; ( 6) + push es ; ( 8) + push ds ; ( 9) + pusha ; (10) push GP registers + mov ax,LINEAR_DATA_SEL ; (11) put known-good values... + mov ds,eax ; (15) ...in segment registers + mov es,eax ; (17) + mov fs,eax ; (19) + mov gs,eax ; (21) + mov eax,esp ; (23) + push eax ; (25) push pointer to regs_t +.1: +; setvect() changes the operand of the CALL instruction at run-time, +; so we need its location = 27 bytes from start of stub. We also want +; the CALL to use absolute addressing instead of EIP-relative, so: + mov eax,fault ; (26) + call eax ; (31) + jmp all_ints ; (33) +%endmacro ; (38) + +%macro INTR_EC 1 +isr%1: + nop ; error code already pushed + nop ; nop+nop=same length as push byte + PUSHB %1 ; ( 2) exception number + push gs ; ( 4) push segment registers + push fs ; ( 6) + push es ; ( 8) + push ds ; ( 9) + pusha ; (10) push GP registers + mov ax,LINEAR_DATA_SEL ; (11) put known-good values... + mov ds,eax ; (15) ...in segment registers + mov es,eax ; (17) + mov fs,eax ; (19) + mov gs,eax ; (21) + mov eax,esp ; (23) + push eax ; (25) push pointer to regs_t +.1: +; setvect() changes the operand of the CALL instruction at run-time, +; so we need its location = 27 bytes from start of stub. We also want +; the CALL to use absolute addressing instead of EIP-relative, so: + mov eax,fault ; (26) + call eax ; (31) + jmp all_ints ; (33) +%endmacro ; (38) + +; the vector within the stub (operand of the CALL instruction) +; is at (isr0.1 - isr0 + 1) + +all_ints: + pop eax + popa ; pop GP registers + pop ds ; pop segment registers + pop es + pop fs + pop gs + add esp,8 ; drop exception number and error code + iret + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; name: getvect +; action: reads interrupt vector +; in: [EBP + 12] = vector number +; out: vector stored at address given by [EBP + 8] +; modifies: EAX, EDX +; minimum CPU: '386+ +; notes: C prototype: +; typedef struct +; { unsigned access_byte, eip; } vector_t; +; getvect(vector_t *v, unsigned vect_num); +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +EXP getvect + push ebp + mov ebp,esp + push esi + push ebx + mov esi,[ebp + 8] + +; get access byte from IDT[i] + xor ebx,ebx + mov bl,[ebp + 12] + shl ebx,3 + mov al,[idt + ebx + 5] + mov [esi + 0],eax + +; get handler address from stub + mov eax,isr1 + sub eax,isr0 ; assume stub size < 256 bytes + mul byte [ebp + 12] + mov ebx,eax + add ebx,isr0 + mov eax,[ebx + (isr0.1 - isr0 + 1)] + mov [esi + 4],eax + pop ebx + pop esi + pop ebp + ret + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; name: setvect +; action: writes interrupt vector +; in: [EBP + 12] = vector number, +; vector stored at address given by [EBP + 8] +; out: (nothing) +; modifies: EAX, EDX +; minimum CPU: '386+ +; notes: C prototype: +; typedef struct +; { unsigned access_byte, eip; } vector_t; +; getvect(vector_t *v, unsigned vect_num); +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +EXP setvect + push ebp + mov ebp,esp + push esi + push ebx + mov esi,[ebp + 8] + +; store access byte in IDT[i] + mov eax,[esi + 0] + xor ebx,ebx + mov bl,[ebp + 12] + shl ebx,3 + mov [idt + ebx + 5],al + +; store handler address in stub + mov eax,isr1 + sub eax,isr0 ; assume stub size < 256 bytes + mul byte [ebp + 12] + mov ebx,eax + add ebx,isr0 + mov eax,[esi + 4] + mov [ebx + (isr0.1 - isr0 + 1)],eax + pop ebx + pop esi + pop ebp + ret + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; interrupt/exception stubs +; *** CAUTION: these must be consecutive, and must all be the same size. +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + + INTR 0 ; zero divide (fault) + INTR 1 ; debug/single step + INTR 2 ; non-maskable interrupt (trap) + INTR 3 ; INT3 (trap) + INTR 4 ; INTO (trap) + INTR 5 ; BOUND (fault) + INTR 6 ; invalid opcode (fault) + INTR 7 ; coprocessor not available (fault) + INTR_EC 8 ; double fault (abort w/ error code) + INTR 9 ; coproc segment overrun (abort; 386/486SX only) + INTR_EC 0Ah ; bad TSS (fault w/ error code) + INTR_EC 0Bh ; segment not present (fault w/ error code) + INTR_EC 0Ch ; stack fault (fault w/ error code) + INTR_EC 0Dh ; GPF (fault w/ error code) + INTR_EC 0Eh ; page fault + INTR 0Fh ; reserved + INTR 10h ; FP exception/coprocessor error (trap) + INTR 11h ; alignment check (trap; 486+ only) + INTR 12h ; machine check (Pentium+ only) + INTR 13h + INTR 14h + INTR 15h + INTR 16h + INTR 17h + INTR 18h + INTR 19h + INTR 1Ah + INTR 1Bh + INTR 1Ch + INTR 1Dh + INTR 1Eh + INTR 1Fh + +; isr20 through isr2F are hardware interrupts. The 8259 programmable +; interrupt controller (PIC) chips must be reprogrammed to make these work. + INTR 20h ; IRQ 0/timer interrupt + INTR 21h ; IRQ 1/keyboard interrupt + INTR 22h + INTR 23h + INTR 24h + INTR 25h + INTR 26h ; IRQ 6/floppy interrupt + INTR 27h + INTR 28h ; IRQ 8/real-time clock interrupt + INTR 29h + INTR 2Ah + INTR 2Bh + INTR 2Ch + INTR 2Dh ; IRQ 13/math coprocessor interrupt + INTR 2Eh ; IRQ 14/primary ATA ("IDE") drive interrupt + INTR 2Fh ; IRQ 15/secondary ATA drive interrupt + +; syscall software interrupt + INTR 30h + +; the other 207 vectors are undefined + +%assign i 31h +%rep (0FFh - 30h) + + INTR i + +%assign i (i + 1) +%endrep + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +SECTION .data +;SEGMENT _DATA USE32 CLASS=DATA + +ds_magic: + dd DS_MAGIC + +gdt: +; NULL descriptor + dw 0 ; limit 15:0 + dw 0 ; base 15:0 + db 0 ; base 23:16 + db 0 ; type + db 0 ; limit 19:16, flags + db 0 ; base 31:24 + +; unused descriptor + dw 0 + dw 0 + db 0 + db 0 + db 0 + db 0 + +LINEAR_DATA_SEL equ $-gdt + dw 0FFFFh + dw 0 + db 0 + db 92h ; present, ring 0, data, expand-up, writable + db 0CFh ; page-granular (4 gig limit), 32-bit + db 0 + +LINEAR_CODE_SEL equ $-gdt + dw 0FFFFh + dw 0 + db 0 + db 9Ah ; present,ring 0,code,non-conforming,readable + db 0CFh ; page-granular (4 gig limit), 32-bit + db 0 +gdt_end: + +gdt_ptr: + dw gdt_end - gdt - 1 + dd gdt + +; 256 ring 0 interrupt gates + +idt: +%rep 256 + dw 0 ; offset 15:0 + dw LINEAR_CODE_SEL ; selector + db 0 ; (always 0 for interrupt gates) + db 8Eh ; present,ring 0,'386 interrupt gate + dw 0 ; offset 31:16 +%endrep +idt_end: + +idt_ptr: + dw idt_end - idt - 1 ; IDT limit + dd idt ; linear adr of IDT + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +SECTION .bss +;SEGMENT _BSS USE32 CLASS=BSS + + resd 1024 +stack: diff --git a/Dump/hybos/src/kernel/main.c b/Dump/hybos/src/kernel/main.c new file mode 100644 index 0000000..4965644 --- /dev/null +++ b/Dump/hybos/src/kernel/main.c @@ -0,0 +1,728 @@ +/** + * main.c + * + * Main code for HybOS. + * + * I spent a lot of time cleaning this damned thing up, so if you + * are even REMOTELY thinking of modifying it, you better make + * sure you follow the same design pattern as you see now. I am sick + * of cleaning up c-style comments because some dumbass is too fucking + * lazy to use the PROPER c89-style comments. This is C people, not C++. + * + * Exports: + * void printf(const char *fmt, ...); + * int main(void); + * + * Imports: + * kstart.asm getvect(); + * kstart.asm setvect(); + * video.c console_t _vc[]; + * video.c blink(); + * video.c init_video(); + * kbd.c keyboard_irq(); + * kbd.c kbd_hw_init(); + * kbd.c init_keyboard(); + * sched.c schedule(); + * sched.c init_tasks(); + * debug.c dump_regs(); + * + * FIXME: + * needs to be renamed to kernel.c + */ +#include /* va_list, va_start(), va_end() */ +/*#include */ /* NULL */ +#include /* NULL */ +#include /* disable() */ +#include <_printf.h> /* do_printf() */ +#include <_malloc.h> +#include +#include +#include +#include "_krnl.h" /* regs_t */ +#include "bootlog.h" /* klog() */ + +/** + * FIXME + * + * These externs and declares are a fucking mess and + * need to be ported to their own headers for portability + */ + +/** + * Imports + */ +void getvect(vector_t *v, unsigned vect_num); +void setvect(vector_t *v, unsigned vect_num); +extern console_t _vc[]; +void blink(void); +void putch(unsigned c); +void init_video(void); +void keyboard_irq(void); +//void kbd_hw_int(void); +void init_keyboard(void); +void schedule(void); +void init_tasks(void); +void dump_regs(regs_t *regs); + +void _mm_physical_init(void); +unsigned _mm_physical_alloc(void); +void _mm_physical_free(unsigned page); +void _mm_page_copy_byte(uint32_t dest, uint32_t src); +void _mm_page_copy_word(uint32_t dest, uint32_t src); +void _mm_page_copy_dword(uint32_t dest, uint32_t src); + +/*void init_cpu(void);*/ + +/** + * printf/kprintf helper + */ +static int kprintf_help(unsigned c, void **ptr) +{ + /** + * Leave this for now + */ + ptr = ptr; + + putch(c); + return 0; +} + +/** + * Format output and print it to stdout (vtty0) + * Just like on any other operating system + */ +/*void printf(const char *fmt, ...) +{ + va_list args; + + va_start(args, fmt); + (void)do_printf(fmt, args, kprintf_help, NULL); + va_end(args); +}*/ + +void kprintf(const char *fmt, ...) +{ + va_list args; + + va_start(args, fmt); + (void)do_printf(fmt, args, kprintf_help, NULL); + va_end(args); +} + +/** + * Format output and print it to stdout (vtty0) + * Just like on any other operating system + */ +void printk(const char *fmt, ...) +{ + va_list args; + + /** + * TODO + * + * Select vtty0 + */ + va_start(args, fmt); + (void)do_printf(fmt, args, kprintf_help, NULL); + va_end(args); +} + +/** + * Oh yeah, the fun function ;) + */ +void panic(const char *fmt, ...) +{ + va_list args; + + disable(); /* interrupts off */ + va_start(args, fmt); + _vc[0].attrib = 15; + printf("\n\npanic: "); + (void)do_printf(fmt, args, kprintf_help, NULL); + + printf("\n\nSystem halted."); + __asm__ __volatile__ ("hlt"); + + while(1) + /* freeze */; +} + +/** + * Called when a kernel fault is detected. This does not + * (normally) get called when something goes awry in + * user-space, therefore it is designed for kernel-space + */ +void fault(regs_t *regs) +{ + struct exception + { + char *message; + int signal; + int processor; + }; + + static const struct exception ex[] = + { + {"Divide error", SIGFPE, 86}, + {"Debug exception", SIGTRAP, 86}, + {"Nonmaskable interrupt (NMI)", SIGBUS, 86}, + {"Breakpoint (INT3)", SIGEMT, 86}, + {"Overflow (INTO)", SIGFPE, 186}, + {"Bounds check", SIGFPE, 186}, + {"Invalid opcode", SIGILL, 186}, + {"Coprocessor not available", SIGFPE, 186}, + {"Double fault", SIGBUS, 286}, + {"Coprocessor segment overrun", SIGSEGV, 286}, + {"Invalid TSS", SIGSEGV, 286}, + {"Segment not present", SIGSEGV, 286}, + {"Stack exception", SIGSEGV, 286}, + {"General Protection Fault", SIGSEGV, 286}, + {"Page fault", SIGSEGV, 386}, + {NULL, SIGILL, 0}, + {"Coprocessor error", SIGFPE, 386}, + {"Alignment check",0,0}, + {"??",0,0}, + {"??",0,0}, + {"??",0,0}, + {"??",0,0}, + {"??",0,0}, + {"??",0,0}, + {"??",0,0}, + {"??",0,0}, + {"??",0,0}, + {"??",0,0}, + {"??",0,0}, + {"??",0,0}, + {"??",0,0}, + {"??",0,0}, + {"IRQ0",0,0}, + {"IRQ1",0,0}, + {"IRQ2",0,0}, + {"IRQ3",0,0}, + {"IRQ4",0,0}, + {"IRQ5",0,0}, + {"IRQ6",0,0}, + {"IRQ7",0,0}, + {"IRQ8",0,0}, + {"IRQ9",0,0}, + {"IRQ10",0,0}, + {"IRQ11",0,0}, + {"IRQ12",0,0}, + {"IRQ13",0,0}, + {"IRQ14",0,0}, + {"IRQ15",0,0}, + {"syscall",0,0} + }; + + + switch(regs->which_int) + { + /** + * this handler installed at compile-time + * Keyboard handler is installed at run-time (see below) + */ + case 0x20: /* timer IRQ 0 */ + //blink(); + /** + * reset hardware interrupt at 8259 chip + */ + outportb(0x20, 0x20); + break; + default: + _vc[0].attrib = 15; + printf("\n\npanic: Exception 0x%08X", regs->which_int); + if(regs->which_int <= sizeof(ex) / sizeof(ex[0].message)) + printf(" (%s)", ex[regs->which_int].message); + printf("\n"); + dump_regs(regs); + printf("\n\nSystem halted."); + __asm__ __volatile__ ("hlt"); + break; + } +} + +/** + * ?? + */ +static void init_8259s(void) +{ + static const unsigned irq0_int = 0x20, irq8_int = 0x28; + + /** + * Initialization Control Word #1 (ICW1) + */ + outportb(0x20, 0x11); + outportb(0xA0, 0x11); + + /** + * ICW2: + * route IRQs 0-7 to INTs 20h-27h + */ + outportb(0x21, irq0_int); + + /** + * route IRQs 8-15 to INTs 28h-2Fh + */ + outportb(0xA1, irq8_int); + + /** + * ICW3 + */ + outportb(0x21, 0x04); + outportb(0xA1, 0x02); + + /** + * ICW4 + */ + outportb(0x21, 0x01); + outportb(0xA1, 0x01); + + /** + * enable IRQ0 (timer) and IRQ1 (keyboard) + */ + outportb(0x21, ~0x03); + outportb(0xA1, ~0x00); +} + +/** + * MinGW32 + */ +#ifdef __WIN32__ +#if __GNUC__<3 +#error Do not use MinGW GCC 2.x with NASM +#endif + int __main(void) { return 0; } + void _alloca(void) { } +#endif + +/** + * malloc, realloc, free, etc + */ +static char *g_heap_bot, *g_kbrk, *g_heap_top; +static void dump_heap(void) +{ + unsigned blks_used = 0, blks_free = 0; + size_t bytes_used = 0, bytes_free = 0; + malloc_t *m; + int total; + + kprintf("===============================================\n"); + for(m = (malloc_t *)g_heap_bot; m != NULL; m = m->next) + { + printk("block %5p: %6u bytes %s\n", m, + m->size, m->used ? "used" : "free"); + if(m->used) + { + blks_used++; + bytes_used += m->size; + } + else + { + blks_free++; + bytes_free += m->size; + } + } + kprintf("blocks: %6u used, %6u free, %6u total\n", blks_used, + blks_free, blks_used + blks_free); + kprintf(" bytes: %6u used, %6u free, %6u total\n", bytes_used, + bytes_free, bytes_used + bytes_free); + kprintf("g_heap_bot=0x%p, g_kbrk=0x%p, g_heap_top=0x%p\n", + g_heap_bot, g_kbrk, g_heap_top); + total = (bytes_used + bytes_free) + + (blks_used + blks_free) * sizeof(malloc_t); + if(total != g_kbrk - g_heap_bot) + kprintf("*** some heap memory is not accounted for\n"); + kprintf("===============================================\n"); +} + +void dumpheapk(void) +{ + dump_heap(); +} + +/** + * POSIX sbrk() looks like this + * void *sbrk(int incr); + * + * Mine is a bit different so I can signal the calling function + * if more memory than desired was allocated (e.g. in a system with paging) + * If your kbrk()/sbrk() always allocates the amount of memory you ask for, + * this code can be easily changed. + * + * int brk( void *sbrk( void *kbrk( + * function void *adr); int delta); int *delta); + * ---------------------- ------------ ------------ ------------- + * POSIX? yes yes NO + * return value if error -1 -1 NULL + * get break value . sbrk(0) int x=0; kbrk(&x); + * set break value to X brk(X) sbrk(X - sbrk(0)) int x=X, y=0; kbrk(&x) - kbrk(&y); + * enlarge heap by N bytes . sbrk(+N) int x=N; kbrk(&x); + * shrink heap by N bytes . sbrk(-N) int x=-N; kbrk(&x); + * can you tell if you're + * given more memory + * than you wanted? no no yes + */ +static void *kbrk(int *delta) +{ + static char heap[HEAP_SIZE]; + char *new_brk, *old_brk; + + /** + * heap doesn't exist yet + */ + if(g_heap_bot == NULL) + { + g_heap_bot = g_kbrk = heap; + g_heap_top = g_heap_bot + HEAP_SIZE; + } + new_brk = g_kbrk + (*delta); + + /** + * too low: return NULL + */ + if(new_brk < g_heap_bot) + return NULL; + + /** + * too high: return NULL + */ + if(new_brk >= g_heap_top) + return NULL; + + /** + * success: adjust brk value... + */ + old_brk = g_kbrk; + g_kbrk = new_brk; + + /** + * ...return actual delta... (for this sbrk(), they are the same) + * (*delta) = (*delta); + * ...return old brk value + */ + return old_brk; +} + +/** + * malloc() and free() use g_heap_bot, but not g_kbrk nor g_heap_top + */ +void *kmalloc(size_t size) +{ + unsigned total_size; + malloc_t *m, *n; + int delta; + + if(size == 0) + return NULL; + total_size = size + sizeof(malloc_t); + + /** + * search heap for free block (FIRST FIT) + */ + m = (malloc_t *)g_heap_bot; + + /** + * g_heap_bot == 0 == NULL if heap does not yet exist + */ + if(m != NULL) + { + if(m->magic != MALLOC_MAGIC) + { + /*printf("*** kernel heap is corrupt in kmalloc()\n");*/ + panic("kernel heap is corrupt in malloc()"); + return NULL; + } + for(; m->next != NULL; m = m->next) + { + if(m->used) + continue; + + /** + * size == m->size is a perfect fit + */ + if(size == m->size) + m->used = 1; + else + { + /** + * otherwise, we need an extra sizeof(malloc_t) bytes for the header + * of a second, free block + */ + if(total_size > m->size) + continue; + + /** + * create a new, smaller free block after this one + */ + n = (malloc_t *)((char *)m + total_size); + n->size = m->size - total_size; + n->next = m->next; + n->magic = MALLOC_MAGIC; + n->used = 0; + + /** + * reduce the size of this block and mark it used + */ + m->size = size; + m->next = n; + m->used = 1; + } + return (char *)m + sizeof(malloc_t); + } + } + + /** + * use kbrk() to enlarge (or create!) heap + */ + delta = total_size; + n = kbrk(&delta); + + /** + * uh-oh + */ + if(n == NULL) + return NULL; + + if(m != NULL) + m->next = n; + + n->size = size; + n->magic = MALLOC_MAGIC; + n->used = 1; + + /** + * did kbrk() return the exact amount of memory we wanted? + * cast to make "gcc -Wall -W ..." shut the hell up + */ + if((int)total_size == delta) + n->next = NULL; + else + { + + /** + * it returned more than we wanted (it will never return less): + * create a new, free block + */ + m = (malloc_t *)((char *)n + total_size); + m->size = delta - total_size - sizeof(malloc_t); + m->next = NULL; + m->magic = MALLOC_MAGIC; + m->used = 0; + + n->next = m; + } + return (char *)n + sizeof(malloc_t); +} + +void kfree(void *blk) +{ + malloc_t *m, *n; + + /** + * get address of header + */ + m = (malloc_t *)((char *)blk - sizeof(malloc_t)); + if(m->magic != MALLOC_MAGIC) + { + /*printf("*** attempt to kfree() block at 0x%p with bad magic value\n", blk);*/ + panic("attempt to free() block at 0x%p with bad magic value", blk); + return; + } + + /** + * find this block in the heap + */ + n = (malloc_t *)g_heap_bot; + if(n->magic != MALLOC_MAGIC) + { + /*printf("*** kernel heap is corrupt in kfree()\n");*/ + panic("kernel heap is corrupt in free()"); + return; + } + for(; n != NULL; n = n->next) + { + if(n == m) + break; + } + + /** + * not found? bad pointer or no heap or something else? + */ + if(n == NULL) + { + /*printf("*** attempt to kfree() block at 0x%p that is not in the heap\n", blk);*/ + panic("attempt to free() block at 0x%p that is not in the heap", blk); + return; + } + + /** + * free the block + */ + m->used = 0; + + /** + * coalesce adjacent free blocks + * Hard to spell, hard to do + */ + for(m = (malloc_t *)g_heap_bot; m != NULL; m = m->next) + { + while(!m->used && m->next != NULL && !m->next->used) + { + /** + * resize this block + */ + m->size += sizeof(malloc_t) + m->next->size; + + /** + * merge with next block + */ + m->next = m->next->next; + } + } +} + +void testheap(void) +{ + //int i; + //char *t; + //kprintf("before char *t = kmalloc((size_t *)25):\n"); + //dump_heap(); + //t = kmalloc(25); + //strcpy(t, "123456789012345678901234"); + //kprintf("after char *t = kmalloc((size_t *)25):\n"); + //dump_heap(); + //kfree(t); + //kprintf("after kfree(t):\n"); + //dump_heap(); + //kprintf("before char *t = kmalloc((size_t *)25):\n"); + + kprintf("Unable to run testheap -- kmalloc() is broken.\n"); +} + +void *krealloc(void *blk, size_t size) +{ + void *new_blk; + malloc_t *m; + + /** + * size == 0: free block + */ + if(size == 0) + { + if(blk != NULL) + kfree(blk); + new_blk = NULL; + } + else + { + /** + * allocate new block + */ + new_blk = kmalloc(size); + + /** + * if allocation OK, and if old block exists, copy old block to new + */ + if(new_blk != NULL && blk != NULL) + { + m = (malloc_t *)((char *)blk - sizeof(malloc_t)); + if(m->magic != MALLOC_MAGIC) + { + /*printf("*** attempt to krealloc() block at 0x%p with bad magic value\n", blk);*/ + panic("attempt to realloc() block at 0x%p with bad magic value", blk); + return NULL; + } + + /** + * copy minimum of old and new block sizes + */ + if(size > m->size) + size = m->size; + memcpy(new_blk, blk, size); + + /** + * free the old block + */ + kfree(blk); + } + } + return new_blk; +} + +void keyboardISR(void); + +int main(void) +{ + /** + * keyboard interrupt init + */ + vector_t v; + unsigned i; + + init_video(); + init_keyboard(); + init_8259s(); + + /** + * XXX: + * i know this is a very ugly way of doing this, + * however it is the only way it can be done for now. + * in the future, i will implement a kprintf function + * whose sole purpose will be writing boot messages. + * + * Also, the color codes need to be mapped to constants + * in order to make using them a hell of a lot easier. + */ + + klog("init", "Installing keyboard interrupt handler", K_KLOG_PENDING, &_vc[0]); + /* we don't save the old vector */ + v.eip = (unsigned)keyboard_irq; + v.access_byte = 0x8E; /* present, ring 0, '386 interrupt gate */ + setvect(&v, 0x21); + klog(NULL, NULL, K_KLOG_SUCCESS, &_vc[0]); + + /*init_tasks();*/ + + klog("init", "Enabling hardware interrupts", K_KLOG_PENDING, &_vc[0]); + enable(); + /*for(i = 0; i < 0xFFFFFFF; i++);*/ + klog(NULL, NULL, K_KLOG_SUCCESS, &_vc[0]); + + /** + * Initialize memory management + */ + /*_mm_init();*/ + + /** + * finished init, time for some gooey ;) + */ + printf(" _ _ _ _ ____ _____ ___ "); + printf(" ( )_( )( \\/ )( _ \\( _ )/ __) "); + printf(" ) _ ( \\ / ) _ < )(_)( \\__ \\ "); + printf(" (_) (_) (__) (____/(_____)(___/ \n"); + + printf(" Hybrid Operating System (HybOS) \n"); + + /** + * XXX: debug only + */ + printf("ALT + F1 - F8 for virtual terminals\n"); + printf("Three finger salute to restart\n"); + printf("More work needs to be done\n"); + printf("$ "); + + /** + * fork (kfork()) control over to a shell + */ + /*init_shell();*/ + + /** + * idle task/thread + */ + while(1) + { + schedule(); + } + + return 0; +} diff --git a/Dump/hybos/src/kernel/sched.c b/Dump/hybos/src/kernel/sched.c new file mode 100644 index 0000000..ed1b60f --- /dev/null +++ b/Dump/hybos/src/kernel/sched.c @@ -0,0 +1,189 @@ +/** + * schedule.c + * + * Task creation and scheduling + * + * Exports: + * task_t *_current_task; + * schedule(); + * init_tasks(); + * + * Imports: + * main.c printf(); + * video.c console_t _vc[]; + */ + +#include /* setjmp(), longjmp() */ +#include +#include "_krnl.h" /* console_t */ +#include "bootlog.h" /* klog() */ + +/** + * Imports + */ +void printf(const char *fmt, ...); +extern console_t _vc[]; +void task1(void); +void task2(void); +void task3(void); +void task4(void); + +#define MAX_TASK 16 +#define USER_STACK_SIZE 512 + +/** + * jmp_buf (E)IP and (E)SP register names for various environments + */ + +/** + * Tinylib (default) + * These should work for most compilers - The HybOS + * compiler (modified gcc) uses this as the default. + * Your mileage may vary. + */ +#define JMPBUF_IP eip +#define JMPBUF_SP esp +#define JMPBUF_FLAGS eflags + +#if 0 +/** + * TurboC + * + * These should work with all versions of TurboC's + * compiler. + */ +#define JMPBUF_IP j_ip +#define JMPBUF_SP j_sp +#define JMPBUF_FLAGS j_flag + +/** + * DJGPP + * + * These should work with the DJGPP compiler + */ +#define JMPBUF_IP __eip +#define JMPBUF_SP __esp +#define JMPBUF_FLAGS __eflags + +#define JMPBUF_IP __pc +#define JMPBUF_SP __sp +#define JMPBUF_FLAGS ???????? + +/** + * glibc5 + * + * I have no idea what the register name is + * for JMPBUF_FLAGS. Good luck. + */ +#define JMPBUF_IP eip +#define JMPBUF_SP esp +#define JMPBUF_FLAGS eflags +#endif /* 0 */ + +task_t *_curr_task; +static task_t _tasks[MAX_TASK]; + +/** + * schedule() + * + */ +void schedule(void) +{ + static unsigned current; + + /** + * If setjmp() returns non-zero it means that we came here through + * hyperspace from our call to longjmp() below, so just return + */ +/** UBU + if(setjmp(_curr_task->state) != 0) + return; +**/ + + /** + * Try to find the next runnable task + */ + do + { + current++; + if(current >= MAX_TASK) + current = 0; + _curr_task = _tasks + current; + } while(_curr_task->status != TS_RUNNABLE); + + /** + * Jump to the new task + */ + longjmp(_curr_task->state, 1); +} +/***************************************************************************** +*****************************************************************************/ +#define NUM_TASKS 0 + +/** + * init_tasks() + * + */ +void init_tasks(void) +{ + static unsigned char stacks[NUM_TASKS][USER_STACK_SIZE]; + /*static unsigned entry[NUM_TASKS] = + { + 0, (unsigned)task1, + (unsigned)task2, (unsigned)task3, + (unsigned)task4 + };*/ + static unsigned entry[NUM_TASKS]; + + unsigned adr, i; + + klog("init", "task handler", K_KLOG_PENDING, &_vc[0]); + + /** + * For user taskes, initialize the saved state + */ + for(i = 1; i < NUM_TASKS; i++) + { + (void)setjmp(_tasks[i].state); + + /** + * especially the stack pointer + */ + adr = (unsigned)(stacks[i] + USER_STACK_SIZE); + _tasks[i].state[0].JMPBUF_SP = adr; + + /** + * and program counter + */ + _tasks[i].state[0].JMPBUF_IP = entry[i]; + + /** + * enable interrupts (by setting EFLAGS value) + */ + _tasks[i].state[0].JMPBUF_FLAGS = 0x200; + + /** + * allocate a virtual console to this task + */ + _tasks[i].vc = _vc + i; + + /** + * and mark it as runnable + */ + _tasks[i].status = TS_RUNNABLE; + } + + /** + * mark task 0 runnable (idle task) + */ + _tasks[0].status = TS_RUNNABLE; + + /** + * set _curr_task so schedule() will save state + * of task 0 + */ + _curr_task = _tasks + 0; + + klog(NULL, NULL, K_KLOG_SUCCESS, &_vc[0]); +} + diff --git a/Dump/hybos/src/kernel/tasks.c b/Dump/hybos/src/kernel/tasks.c new file mode 100644 index 0000000..12f6ac3 --- /dev/null +++ b/Dump/hybos/src/kernel/tasks.c @@ -0,0 +1,136 @@ +/** + * tasks.c + * + * ?? + * + * Exports: + * task1() + * task2() + * task3() + * task4() + * + * Imports: + * video.c putch_help(); + * sched.c task_t *_curr_task; + */ + +#include "_krnl.h" + +/** + * Imports + */ +void putch_help(console_t *con, unsigned c); +extern task_t *_curr_task; +void schedule(void); + +/** + * write() + * + */ +static int write(const unsigned char *str, unsigned len) +{ + unsigned i; + + for(i = 0; i < len; i++) + { + putch_help(_curr_task->vc, *str); + str++; + } + return i; +} + +/** + * yield() + * + */ +static void yield(void) +{ + schedule(); +} + +#define WAIT 0xFFFFFL + +/** + * wait() + */ +static void wait(void) +{ + unsigned long wait; + + for(wait = WAIT; wait != 0; wait--) + /* nothing */; +} + +/** + * task1() + * + */ +void task1(void) +{ + //static const unsigned char msg_a[] = "root@hybos $ "; +/**/ + + //write(msg_a, sizeof(msg_a)); + wait(); + while(1) + { + /* so we can process other events */ + yield(); + wait(); + } +} + +/** + * task2() + * + */ +void task2(void) +{ + //static const unsigned char msg_a[] = "root@hybos $ "; +/**/ + + //write(msg_a, sizeof(msg_a)); + wait(); + while(1) + { + yield(); + wait(); + } +} + +/** + * task3() + * + */ +void task3(void) +{ + //static const unsigned char msg_a[] = "root@hybos $ "; +/**/ + + //write(msg_a, sizeof(msg_a)); + wait(); + while(1) + { + yield(); + wait(); + } +} + +/** + * task4() + * + */ +void task4(void) +{ + //static const unsigned char msg_a[] = "root@hybos $ "; +/**/ + + //write(msg_a, sizeof(msg_a)); + wait(); + while(1) + { + yield(); + wait(); + } +} + diff --git a/Dump/hybos/src/kernel/video.c b/Dump/hybos/src/kernel/video.c new file mode 100644 index 0000000..b192ebc --- /dev/null +++ b/Dump/hybos/src/kernel/video.c @@ -0,0 +1,445 @@ +/** + * video.c + * + * Text video routines + * + * Exports: + * blink(); + * select_vc() + * putch_help() + * putch() + * init_video(); + * + * Imports: + * main.c printf(); + */ + +/** + * TODO + * + * Fuck me with a blind melon...when the screen scrolls + * too much, it generates a panic of type invalid opcode. + */ + +#include /* memcpy(), memsetw() */ +#include /* isdigit() */ +#include /* outportb(), inportb() */ +#include +#include "_krnl.h" /* MAX_VC, console_t */ + +/** + * Imports + */ +void printf(const char *fmt, ...); + +#define VGA_MISC_READ 0x3CC + +console_t _vc[MAX_VC]; +static unsigned _num_vcs; +static console_t *_curr_vc; + +static unsigned short *_vga_fb_adr; +static unsigned _crtc_io_adr, _vc_width, _vc_height; + +unsigned curr_vtty; + +/** + * blink() + * + */ +void blink(void) +{ + (*(unsigned char *)_vga_fb_adr)++; +} + +/** + * get_current_vc() + * + */ +unsigned get_current_vc() +{ + return curr_vtty; +} + +/** + * scroll() + * + */ +static void scroll(console_t *con) +{ + unsigned short *fb_adr; + unsigned blank, temp; + + blank = 0x20 | ((unsigned)con->attrib << 8); + fb_adr = con->fb_adr; + + /** + * scroll up + */ + if(con->csr_y >= _vc_height) + { + temp = con->csr_y - _vc_height + 1; + memcpy(fb_adr, fb_adr + temp * _vc_width, + (_vc_height - temp) * _vc_width * 2); + + /** + * blank bottom line of screen + */ + memsetw(fb_adr + (_vc_height - temp) * _vc_width, + blank, _vc_width); + con->csr_y = _vc_height - 1; + } + + //for(i = 0; i < 0x1000000; i++) ; +} + +/** + * set_attrib() + * + */ +static void set_attrib(console_t *con, unsigned att) +{ + static const unsigned ansi_to_vga[] = + { + 0, 4, 2, 6, 1, 5, 3, 7 + }; + + unsigned new_att; + + new_att = con->attrib; + if(att == 0) + new_att &= ~0x08; /* bold off */ + else if(att == 1) + new_att |= 0x08; /* bold on */ + else if(att >= 30 && att <= 37) + { + att = ansi_to_vga[att - 30]; + new_att = (new_att & ~0x07) | att;/* fg color */ + } + else if(att >= 40 && att <= 47) + { + att = ansi_to_vga[att - 40] << 4; + new_att = (new_att & ~0x70) | att;/* bg color */ + } + con->attrib = new_att; +} + +/** + * move_csr() + * + */ +static void move_csr(void) +{ + unsigned temp; + + temp = (_curr_vc->csr_y * _vc_width + _curr_vc->csr_x) + + (_curr_vc->fb_adr - _vga_fb_adr); + outportb(_crtc_io_adr + 0, 14); + outportb(_crtc_io_adr + 1, temp >> 8); + outportb(_crtc_io_adr + 0, 15); + outportb(_crtc_io_adr + 1, temp); +} + + +/** + * select_vc() + * + */ +void select_vc(unsigned which_vc) +{ + unsigned i; + + if(which_vc >= _num_vcs) + return; + _curr_vc = _vc + which_vc; + i = _curr_vc->fb_adr - _vga_fb_adr; + outportb(_crtc_io_adr + 0, 12); + outportb(_crtc_io_adr + 1, i >> 8); + outportb(_crtc_io_adr + 0, 13); + outportb(_crtc_io_adr + 1, i); + + curr_vtty = which_vc; + + move_csr(); +} + +/** + * putch_help() + * + */ +void putch_help(console_t *con, unsigned c) +{ + unsigned short *fb_adr; + unsigned att; + + att = (unsigned)con->attrib << 8; + fb_adr = con->fb_adr; + + /** + * state machine to handle escape sequences + * + * ESC + */ + if(con->esc == 1) + { + if(c == '[') + { + con->esc++; + con->esc1 = 0; + return; + } + /* else fall-through: zero esc and print c */ + } + + /** + * ESC[ + */ + else if(con->esc == 2) + { + if(isdigit(c)) + { + con->esc1 = con->esc1 * 10 + c - '0'; + return; + } + else if(c == ';') + { + con->esc++; + con->esc2 = 0; + return; + } + + /** + * ESC[2J (clear screen) + */ + else if(c == 'J') + { + if(con->esc1 == 2) + { + memsetw(fb_adr, ' ' | att, + _vc_height * _vc_width); + con->csr_x = con->csr_y = 0; + } + } + + /** + * ESC[num1m (set attribute num1) + */ + else if(c == 'm') + set_attrib(con, con->esc1); + con->esc = 0; /* anything else with one numeric arg */ + return; + } + + /** + * ESC[num1 + */ + else if(con->esc == 3) + { + if(isdigit(c)) + { + con->esc2 = con->esc2 * 10 + c - '0'; + return; + } + else if(c == ';') + { + con->esc++; /* ESC[num1;num2; */ + con->esc3 = 0; + return; + } + + /** + * ESC[num1;num2H (move cursor to num1,num2) + */ + else if(c == 'H') + { + if(con->esc2 < _vc_width) + con->csr_x = con->esc2; + if(con->esc1 < _vc_height) + con->csr_y = con->esc1; + } + + /** + * ESC[num1;num2m (set attributes num1,num2) + */ + else if(c == 'm') + { + set_attrib(con, con->esc1); + set_attrib(con, con->esc2); + } + con->esc = 0; + return; + } + /** + * ESC[num1;num2;num3 + */ + else if(con->esc == 4) + { + if(isdigit(c)) + { + con->esc3 = con->esc3 * 10 + c - '0'; + return; + } + /** + * ESC[num1;num2;num3m (set attributes num1,num2,num3) + */ + else if(c == 'm') + { + set_attrib(con, con->esc1); + set_attrib(con, con->esc2); + set_attrib(con, con->esc3); + } + con->esc = 0; + return; + } + con->esc = 0; + + /** + * escape character + */ + if(c == 0x1B) + { + con->esc = 1; + return; + } + /** + * backspace + */ + if(c == 0x08) + { + if(con->csr_x != 0) + con->csr_x--; + } + /** + * tab + */ + else if(c == 0x09) + con->csr_x = (con->csr_x + 8) & ~(8 - 1); + /** + * carriage return + */ + else if(c == '\r') /* 0x0D */ + con->csr_x = 0; + /** + * line feed + */ +/* else if(c == '\n') *//* 0x0A */ +/* con->csr_y++;*/ + /** + * CR/LF + */ + else if(c == '\n') /* ### - 0x0A again */ + { + con->csr_x = 0; + con->csr_y++; + } + /** + * printable ASCII + */ + else if(c >= ' ') + { + unsigned short *where; + + where = fb_adr + (con->csr_y * _vc_width + con->csr_x); + *where = (c | att); + con->csr_x++; + } + if(con->csr_x >= _vc_width) + { + con->csr_x = 0; + con->csr_y++; + } + scroll(con); + + /** + * move cursor only if the VC we're writing is the current VC + */ + if(_curr_vc == con) + move_csr(); +} + +/** + * putch() + * + */ +void putch(unsigned c) +{ +/* all kernel messages to VC #0 */ +// putch_help(_vc + 0, c); +/* all kernel messages to current VC */ + putch_help(_curr_vc, c); +} + +/** + * init_video() + * + */ +void init_video(void) +{ + unsigned i; + + /** + * check for monochrome or color VGA emulation + */ + if((inportb(VGA_MISC_READ) & 0x01) != 0) + { + _vga_fb_adr = (unsigned short *)0xB8000L; + _crtc_io_adr = 0x3D4; + } + else + { + _vga_fb_adr = (unsigned short *)0xB0000L; + _crtc_io_adr = 0x3B4; + } + + /** + * read current screen size from BIOS data segment (addresses 400-4FF) + */ + _vc_width = *(unsigned short *)0x44A; + _vc_height = *(unsigned char *)0x484 + 1; + + /** + * figure out how many VCs we can have with 32K of display memory. + * Use INTEGER division to round down. + */ + _num_vcs = 32768L / (_vc_width * _vc_height * 2); + if(_num_vcs > MAX_VC) + _num_vcs = MAX_VC; + + /** + * init VCs, with a different foreground color for each + */ + for(i = 0; i < _num_vcs; i++) + { + _curr_vc = _vc + i; + //_curr_vc->attrib = i + 1; + + /* terminal foreground color */ + _curr_vc->attrib = 7; + _curr_vc->fb_adr = _vga_fb_adr + + _vc_width * _vc_height * i; + + /** + * ESC[2J clears the screen + */ + //kprintf("\x1B[2J this is VC#%u (of 0-%u)\n", + // i, _num_vcs - 1); + printf("\x1B[2J"); + + if(i != 0) + printf("$ "); + } + select_vc(0); + curr_vtty = 0; + + _curr_vc->attrib = 8; + printf("[ "); + _curr_vc->attrib = 15; + printf("init: video %5s emulation, %2ux%2u, framebuffer at 0x%1X ", + (_crtc_io_adr == 0x3D4) ? "color" : "mono", + _vc_width, _vc_height, _vga_fb_adr); + _curr_vc->attrib = 8; + printf("]................"); + _curr_vc->attrib = 2; + printf("Ok"); + _curr_vc->attrib = 7; +} diff --git a/Dump/hybos/src/keymaps/us-std.h b/Dump/hybos/src/keymaps/us-std.h new file mode 100644 index 0000000..2ee2ccf --- /dev/null +++ b/Dump/hybos/src/keymaps/us-std.h @@ -0,0 +1,136 @@ +/* Keymap for US MF-2 keyboard. */ +#include + +uint16_t keymap[NR_SCAN_CODES * MAP_COLS] = { + +/* scan-code !Shift Shift Alt1 Alt2 Alt+Sh Ctrl */ +/* ==================================================================== */ +/* 00 - none */ 0, 0, 0, 0, 0, 0, +/* 01 - ESC */ C('['), C('['), CA('['),CA('['),CA('['),C('['), +/* 02 - '1' */ '1', '!', A('1'), A('1'), A('!'), C('A'), +/* 03 - '2' */ '2', '@', A('2'), A('2'), A('@'), C('@'), +/* 04 - '3' */ '3', '#', A('3'), A('3'), A('#'), C('C'), +/* 05 - '4' */ '4', '$', A('4'), A('4'), A('$'), C('D'), +/* 06 - '5' */ '5', '%', A('5'), A('5'), A('%'), C('E'), +/* 07 - '6' */ '6', '^', A('6'), A('6'), A('^'), C('^'), +/* 08 - '7' */ '7', '&', A('7'), A('7'), A('&'), C('G'), +/* 09 - '8' */ '8', '*', A('8'), A('8'), A('*'), C('H'), +/* 10 - '9' */ '9', '(', A('9'), A('9'), A('('), C('I'), +/* 11 - '0' */ '0', ')', A('0'), A('0'), A(')'), C('@'), +/* 12 - '-' */ '-', '_', A('-'), A('-'), A('_'), C('_'), +/* 13 - '=' */ '=', '+', A('='), A('='), A('+'), C('@'), +/* 14 - BS */ C('H'), C('H'), CA('H'),CA('H'),CA('H'),0177, +/* 15 - TAB */ C('I'), C('I'), CA('I'),CA('I'),CA('I'),C('I'), +/* 16 - 'q' */ L('q'), 'Q', A('q'), A('q'), A('Q'), C('Q'), +/* 17 - 'w' */ L('w'), 'W', A('w'), A('w'), A('W'), C('W'), +/* 18 - 'e' */ L('e'), 'E', A('e'), A('e'), A('E'), C('E'), +/* 19 - 'r' */ L('r'), 'R', A('r'), A('r'), A('R'), C('R'), +/* 20 - 't' */ L('t'), 'T', A('t'), A('t'), A('T'), C('T'), +/* 21 - 'y' */ L('y'), 'Y', A('y'), A('y'), A('Y'), C('Y'), +/* 22 - 'u' */ L('u'), 'U', A('u'), A('u'), A('U'), C('U'), +/* 23 - 'i' */ L('i'), 'I', A('i'), A('i'), A('I'), C('I'), +/* 24 - 'o' */ L('o'), 'O', A('o'), A('o'), A('O'), C('O'), +/* 25 - 'p' */ L('p'), 'P', A('p'), A('p'), A('P'), C('P'), +/* 26 - '[' */ '[', '{', A('['), A('['), A('{'), C('['), +/* 27 - ']' */ ']', '}', A(']'), A(']'), A('}'), C(']'), +/* 28 - CR/LF */ C('M'), C('M'), CA('M'),CA('M'),CA('M'),C('J'), +/* 29 - Ctrl */ CTRL, CTRL, CTRL, CTRL, CTRL, CTRL, +/* 30 - 'a' */ L('a'), 'A', A('a'), A('a'), A('A'), C('A'), +/* 31 - 's' */ L('s'), 'S', A('s'), A('s'), A('S'), C('S'), +/* 32 - 'd' */ L('d'), 'D', A('d'), A('d'), A('D'), C('D'), +/* 33 - 'f' */ L('f'), 'F', A('f'), A('f'), A('F'), C('F'), +/* 34 - 'g' */ L('g'), 'G', A('g'), A('g'), A('G'), C('G'), +/* 35 - 'h' */ L('h'), 'H', A('h'), A('h'), A('H'), C('H'), +/* 36 - 'j' */ L('j'), 'J', A('j'), A('j'), A('J'), C('J'), +/* 37 - 'k' */ L('k'), 'K', A('k'), A('k'), A('K'), C('K'), +/* 38 - 'l' */ L('l'), 'L', A('l'), A('l'), A('L'), C('L'), +/* 39 - ';' */ ';', ':', A(';'), A(';'), A(':'), C('@'), +/* 40 - '\'' */ '\'', '"', A('\''),A('\''),A('"'), C('@'), +/* 41 - '`' */ '`', '~', A('`'), A('`'), A('~'), C('@'), +/* 42 - l. SHIFT*/ SHIFT, SHIFT, SHIFT, SHIFT, SHIFT, SHIFT, +/* 43 - '\\' */ '\\', '|', A('\\'),A('\\'),A('|'), C('\\'), +/* 44 - 'z' */ L('z'), 'Z', A('z'), A('z'), A('Z'), C('Z'), +/* 45 - 'x' */ L('x'), 'X', A('x'), A('x'), A('X'), C('X'), +/* 46 - 'c' */ L('c'), 'C', A('c'), A('c'), A('C'), C('C'), +/* 47 - 'v' */ L('v'), 'V', A('v'), A('v'), A('V'), C('V'), +/* 48 - 'b' */ L('b'), 'B', A('b'), A('b'), A('B'), C('B'), +/* 49 - 'n' */ L('n'), 'N', A('n'), A('n'), A('N'), C('N'), +/* 50 - 'm' */ L('m'), 'M', A('m'), A('m'), A('M'), C('M'), +/* 51 - ',' */ ',', '<', A(','), A(','), A('<'), C('@'), +/* 52 - '.' */ '.', '>', A('.'), A('.'), A('>'), C('@'), +/* 53 - '/' */ '/', '?', A('/'), A('/'), A('?'), C('@'), +/* 54 - r. SHIFT*/ SHIFT, SHIFT, SHIFT, SHIFT, SHIFT, SHIFT, +/* 55 - '*' */ '*', '*', A('*'), A('*'), A('*'), C('@'), +/* 56 - ALT */ ALT, ALT, ALT, ALT, ALT, ALT, +/* 57 - ' ' */ ' ', ' ', A(' '), A(' '), A(' '), C('@'), +/* 58 - CapsLck */ CALOCK, CALOCK, CALOCK, CALOCK, CALOCK, CALOCK, +/* 59 - F1 */ F1, SF1, AF1, AF1, ASF1, CF1, +/* 60 - F2 */ F2, SF2, AF2, AF2, ASF2, CF2, +/* 61 - F3 */ F3, SF3, AF3, AF3, ASF3, CF3, +/* 62 - F4 */ F4, SF4, AF4, AF4, ASF4, CF4, +/* 63 - F5 */ F5, SF5, AF5, AF5, ASF5, CF5, +/* 64 - F6 */ F6, SF6, AF6, AF6, ASF6, CF6, +/* 65 - F7 */ F7, SF7, AF7, AF7, ASF7, CF7, +/* 66 - F8 */ F8, SF8, AF8, AF8, ASF8, CF8, +/* 67 - F9 */ F9, SF9, AF9, AF9, ASF9, CF9, +/* 68 - F10 */ F10, SF10, AF10, AF10, ASF10, CF10, +/* 69 - NumLock */ NLOCK, NLOCK, NLOCK, NLOCK, NLOCK, NLOCK, +/* 70 - ScrLock */ SLOCK, SLOCK, SLOCK, SLOCK, SLOCK, SLOCK, +/* 71 - Home */ HOME, '7', AHOME, AHOME, A('7'), CHOME, +/* 72 - CurUp */ UP, '8', AUP, AUP, A('8'), CUP, +/* 73 - PgUp */ PGUP, '9', APGUP, APGUP, A('9'), CPGUP, +/* 74 - '-' */ NMIN, '-', ANMIN, ANMIN, A('-'), CNMIN, +/* 75 - Left */ LEFT, '4', ALEFT, ALEFT, A('4'), CLEFT, +/* 76 - MID */ MID, '5', AMID, AMID, A('5'), CMID, +/* 77 - Right */ RIGHT, '6', ARIGHT, ARIGHT, A('6'), CRIGHT, +/* 78 - '+' */ PLUS, '+', APLUS, APLUS, A('+'), CPLUS, +/* 79 - End */ END, '1', AEND, AEND, A('1'), CEND, +/* 80 - Down */ DOWN, '2', ADOWN, ADOWN, A('2'), CDOWN, +/* 81 - PgDown */ PGDN, '3', APGDN, APGDN, A('3'), CPGDN, +/* 82 - Insert */ INSRT, '0', AINSRT, AINSRT, A('0'), CINSRT, +/* 83 - Delete */ 0177, '.', A(0177),A(0177),A('.'), 0177, +/* 84 - Enter */ C('M'), C('M'), CA('M'),CA('M'),CA('M'),C('J'), +/* 85 - ??? */ 0, 0, 0, 0, 0, 0, +/* 86 - ??? */ '<', '>', A('<'), A('|'), A('>'), C('@'), +/* 87 - F11 */ F11, SF11, AF11, AF11, ASF11, CF11, +/* 88 - F12 */ F12, SF12, AF12, AF12, ASF12, CF12, +/* 89 - ??? */ 0, 0, 0, 0, 0, 0, +/* 90 - ??? */ 0, 0, 0, 0, 0, 0, +/* 91 - ??? */ 0, 0, 0, 0, 0, 0, +/* 92 - ??? */ 0, 0, 0, 0, 0, 0, +/* 93 - ??? */ 0, 0, 0, 0, 0, 0, +/* 94 - ??? */ 0, 0, 0, 0, 0, 0, +/* 95 - ??? */ 0, 0, 0, 0, 0, 0, +/* 96 - EXT_KEY */ EXTKEY, EXTKEY, EXTKEY, EXTKEY, EXTKEY, EXTKEY, +/* 97 - ??? */ 0, 0, 0, 0, 0, 0, +/* 98 - ??? */ 0, 0, 0, 0, 0, 0, +/* 99 - ??? */ 0, 0, 0, 0, 0, 0, +/*100 - ??? */ 0, 0, 0, 0, 0, 0, +/*101 - ??? */ 0, 0, 0, 0, 0, 0, +/*102 - ??? */ 0, 0, 0, 0, 0, 0, +/*103 - ??? */ 0, 0, 0, 0, 0, 0, +/*104 - ??? */ 0, 0, 0, 0, 0, 0, +/*105 - ??? */ 0, 0, 0, 0, 0, 0, +/*106 - ??? */ 0, 0, 0, 0, 0, 0, +/*107 - ??? */ 0, 0, 0, 0, 0, 0, +/*108 - ??? */ 0, 0, 0, 0, 0, 0, +/*109 - ??? */ 0, 0, 0, 0, 0, 0, +/*110 - ??? */ 0, 0, 0, 0, 0, 0, +/*111 - ??? */ 0, 0, 0, 0, 0, 0, +/*112 - ??? */ 0, 0, 0, 0, 0, 0, +/*113 - ??? */ 0, 0, 0, 0, 0, 0, +/*114 - ??? */ 0, 0, 0, 0, 0, 0, +/*115 - ??? */ 0, 0, 0, 0, 0, 0, +/*116 - ??? */ 0, 0, 0, 0, 0, 0, +/*117 - ??? */ 0, 0, 0, 0, 0, 0, +/*118 - ??? */ 0, 0, 0, 0, 0, 0, +/*119 - ??? */ 0, 0, 0, 0, 0, 0, +/*120 - ??? */ 0, 0, 0, 0, 0, 0, +/*121 - ??? */ 0, 0, 0, 0, 0, 0, +/*122 - ??? */ 0, 0, 0, 0, 0, 0, +/*123 - ??? */ 0, 0, 0, 0, 0, 0, +/*124 - ??? */ 0, 0, 0, 0, 0, 0, +/*125 - ??? */ 0, 0, 0, 0, 0, 0, +/*126 - ??? */ 0, 0, 0, 0, 0, 0, +/*127 - ??? */ 0, 0, 0, 0, 0, 0 +}; diff --git a/Dump/hybos/src/krnl1m.ld b/Dump/hybos/src/krnl1m.ld new file mode 100644 index 0000000..8f957cb --- /dev/null +++ b/Dump/hybos/src/krnl1m.ld @@ -0,0 +1,55 @@ +/* let the linker use its 'native' format (ELF/COFF/PE) +OUTPUT_FORMAT("coff-go32") */ +/* no leading underscore for symbols handled in asm: */ +ENTRY(entry) +LS_Phys = 0x100000; /* 1 meg = load (physical) address */ +LS_Virt = 0x100000; /* 1 meg = virtual address */ +/*LS_Phys = 0x300000;*/ /* 3 meg = load (physical) address */ +/*LS_Virt = 0x300000;*/ /* 3 meg = virtual address */ + +SECTIONS +{ + .text LS_Virt : AT(LS_Phys) + { + LS_Code = .; +/* symbols to mark start of code segment */ + code = .; _code = .; +/* kernel code */ + *(.text) +/* .rodata is the ELF constant data section */ + *(.rodata*) + . = ALIGN(4096); + } + .data : AT(LS_Phys + (LS_Data - LS_Code)) + { + LS_Data = .; +/* symbols to mark start of data segment */ + data = .; _data = .; +/* kernel data */ +/* OLD: . = ALIGN(4096) */ + *(.data) + . = ALIGN(4096); + } + .bss : AT(LS_Phys + (LS_Bss - LS_Code)) + { + LS_Bss = .; +/* symbols to mark start of BSS segment */ + bss = .; _bss = .; +/* kernel BSS */ + *(.bss) + *(COMMON) /* "common" variables */ + . = ALIGN(4096); + } +/* bug in MinGW? I get a bad executable file unless these +sections are here... */ + .stab : + { + *(.stab) + } + .stabstr : + { + *(.stabstr) + } +/* symbols to mark end of kernel */ + end = .; _end = .; +} diff --git a/Dump/hybos/src/mm/Makefile b/Dump/hybos/src/mm/Makefile new file mode 100644 index 0000000..d0329f1 --- /dev/null +++ b/Dump/hybos/src/mm/Makefile @@ -0,0 +1,34 @@ +.SUFFIXES: .asm + +# defines +MAKEFILE =Makefile +MAKEDEP =$(MAKEFILE) +INCDIR =../../include +LDSCRIPT =../../krnl1m.ld +NASM =nasm -f win32 -dUNDERBARS=1 -i$(INCDIR)/ +CC =gcc -g -Wall -W -O2 -nostdinc -fno-builtin -I$(INCDIR) +LD =ld -g -T $(LDSCRIPT) -nostdlib +LIBC =../../lib/libc.a + +OBJS =memory.o + +OBJS_DEP =*.o + +OBJ_DIR =objects + +# targets +all: $(OBJS) $(MAKEDEP) + +clean: + del ..\$(OBJ_DIR)\memory.o + +# implicit rules +.asm.o: + $(NASM) -o../$(OBJ_DIR)/$@ $< + +.c.o: + $(CC) -c -o../$(OBJ_DIR)/$@ $< + +# dependencies +memory.o: memory.c $(MAKEDEP) + diff --git a/Dump/hybos/src/mm/memory.c b/Dump/hybos/src/mm/memory.c new file mode 100644 index 0000000..921531d --- /dev/null +++ b/Dump/hybos/src/mm/memory.c @@ -0,0 +1,118 @@ +#include +#include "../kernel/bootlog.h" + +extern console_t _vc[]; + +unsigned *buffer; +unsigned *bufferIterator; + +#define PAGESIZE 4096 + +char ts[4096*3]; +char td[4096*3]; + +void _mm_physical_init(void); +unsigned _mm_physical_alloc(void); +void _mm_physical_free(unsigned page); +void _mm_page_copy_byte(uint32_t dest, uint32_t src); +void _mm_page_copy_word(uint32_t dest, uint32_t src); +void _mm_page_copy_dword(uint32_t dest, uint32_t src); +void _mm_virtual_init(void); + +void _mm_init(void) +{ + klog("init", "Initializing memory management", K_KLOG_PENDING, &_vc[0]); + _mm_physical_init(); + _mm_virtual_init(); + klog((void *)0, (void *)0, K_KLOG_SUCCESS, &_vc[0]); +} + +void _mm_physical_init(void) +{ + unsigned i; + unsigned size = 16 * 1024 * 1024; + + size /= PAGESIZE; + size++; + size /= 32; + + buffer = (unsigned *)0x40000; + bufferIterator = (unsigned *)0x40000; + + for(i = 0; i < 72; i++) + buffer[i] = 0xFFFFFFFF; + + for(i = 72; i < size; i++) + buffer[i] = 0x00000000; +} + +unsigned _mm_physical_alloc(void) +{ + unsigned mask = 0x00000001; + unsigned bit = 0; + + /** + * Search for a free space + */ + while(*bufferIterator == 0xFFFFFFFF) + bufferIterator++; + + /** + * Search for a bit that indicates a free page + */ + while(*bufferIterator & mask) + { + mask <<= 1; + bit++; + } + + *bufferIterator |= mask; + + return 32 * (bufferIterator - buffer) + bit; +} + +void _mm_physical_free(unsigned page) +{ + buffer[page >> 5] &= ~(1 << (page & 0x1F)); /* confused yet?!? */ +} + +void _mm_virtual_init(void) +{ +} + +void _mm_page_copy_byte(uint32_t dest, uint32_t src) +{ + __asm__ __volatile__ + ( + "cld;" + "rep; movsb;" + : + : "c" (1024*1024), "D" (dest), "S" (src) + : "memory" + ); +} + +void _mm_page_copy_word(uint32_t dest, uint32_t src) +{ + __asm__ __volatile__ + ( + "cld;" + "rep; movsw;" + : + : "c" (512*1024), "D" (dest), "S" (src) + : "memory" + ); +} + +void _mm_page_copy_dword(uint32_t dest, uint32_t src) +{ + __asm__ __volatile__ + ( + "cld;" + "rep; movsl;" + : + : "c" (256*1024), "D" (dest), "S" (src) + : "memory" + ); +} + diff --git a/Dump/hybos/src/objects/kernel.dis b/Dump/hybos/src/objects/kernel.dis new file mode 100644 index 0000000..0152ca3 --- /dev/null +++ b/Dump/hybos/src/objects/kernel.dis @@ -0,0 +1,12860 @@ + +../../boot/kernel.bin: file format elf32-i386-freebsd + +Disassembly of section .text: + +00100000 : +#include "_krnl.h" +#include "bootlog.h" + +void klog(char *proc, char *entry, KLOGRESULT result, console_t *vtty0) +{ + 100000: 55 push %ebp + 100001: 89 e5 mov %esp,%ebp + 100003: 57 push %edi + 100004: 56 push %esi + 100005: 53 push %ebx + 100006: 83 ec 0c sub $0xc,%esp + 100009: 8b 45 10 mov 0x10(%ebp),%eax + 10000c: 8b 5d 14 mov 0x14(%ebp),%ebx + unsigned oldattrib; + int i = 0; + 10000f: 31 f6 xor %esi,%esi + int offset = 69; /* -4 for the "[ ]" part, -2 for the ": " part, -1 for space at end, and -4 for the status */ + char status[4]; + va_list args; + + args = args; + status[0] = '\0'; + + /** + * Save our old color attributes + */ + oldattrib = vtty0->attrib; + + if(result == K_KLOG_SUCCESS) + 100011: 85 c0 test %eax,%eax + 100013: c7 45 f0 45 00 00 00 movl $0x45,0xfffffff0(%ebp) + 10001a: 8b 7b 18 mov 0x18(%ebx),%edi + 10001d: 0f 84 d5 00 00 00 je 1000f8 + { + /** + * Successfull initialization of something. + * Write "..Ok" then leave + */ + vtty0->attrib = 8; + printf("\b\b\b\b.."); + vtty0->attrib = 2; + printf("Ok\n"); + vtty0->attrib = oldattrib; + + return; + } + else if(result == K_KLOG_FAILURE) + 100023: 83 f8 02 cmp $0x2,%eax + 100026: 0f 84 b8 00 00 00 je 1000e4 + { + /** + * Unsuccessfull initialization of something. + * Write "Fail" then leave + */ + vtty0->attrib = 4; + printf("\b\b\b\bFail\n"); + vtty0->attrib = oldattrib; + + return; + } + + /** + * FIXME + * + * Should "wrap" the line instead + */ + if(strlen(entry) + 8 > 80) + 10002c: 83 ec 0c sub $0xc,%esp + 10002f: ff 75 0c pushl 0xc(%ebp) + 100032: e8 21 51 00 00 call 105158 + 100037: 83 c0 08 add $0x8,%eax + 10003a: 83 c4 10 add $0x10,%esp + 10003d: 83 f8 50 cmp $0x50,%eax + 100040: 76 0a jbe 10004c + return; + + vtty0->attrib = 8; + printf("[ "); + vtty0->attrib = 15; + printf("%s: %s", proc, entry); + vtty0->attrib = 8; + printf(" ]"); + + offset -= strlen(proc); + offset -= strlen(entry); + + for(i = 0; i < offset; i++) + printf("."); + + vtty0->attrib = 8; + printf("Wait"); + + vtty0->attrib = oldattrib; +} + 100042: 8d 65 f4 lea 0xfffffff4(%ebp),%esp + 100045: 5b pop %ebx + 100046: 5e pop %esi + 100047: 5f pop %edi + 100048: c9 leave + 100049: c3 ret + 10004a: 89 f6 mov %esi,%esi + 10004c: 83 ec 0c sub $0xc,%esp + 10004f: c7 43 18 08 00 00 00 movl $0x8,0x18(%ebx) + 100056: 68 b6 51 10 00 push $0x1051b6 + 10005b: e8 74 50 00 00 call 1050d4 + 100060: 83 c4 0c add $0xc,%esp + 100063: c7 43 18 0f 00 00 00 movl $0xf,0x18(%ebx) + 10006a: ff 75 0c pushl 0xc(%ebp) + 10006d: ff 75 08 pushl 0x8(%ebp) + 100070: 68 b9 51 10 00 push $0x1051b9 + 100075: e8 5a 50 00 00 call 1050d4 + 10007a: c7 43 18 08 00 00 00 movl $0x8,0x18(%ebx) + 100081: c7 04 24 c0 51 10 00 movl $0x1051c0,(%esp,1) + 100088: e8 47 50 00 00 call 1050d4 + 10008d: 5a pop %edx + 10008e: ff 75 08 pushl 0x8(%ebp) + 100091: e8 c2 50 00 00 call 105158 + 100096: 29 45 f0 sub %eax,0xfffffff0(%ebp) + 100099: 58 pop %eax + 10009a: ff 75 0c pushl 0xc(%ebp) + 10009d: e8 b6 50 00 00 call 105158 + 1000a2: 29 45 f0 sub %eax,0xfffffff0(%ebp) + 1000a5: 83 c4 10 add $0x10,%esp + 1000a8: 3b 75 f0 cmp 0xfffffff0(%ebp),%esi + 1000ab: 7d 16 jge 1000c3 + 1000ad: 8b 75 f0 mov 0xfffffff0(%ebp),%esi + 1000b0: 83 ec 0c sub $0xc,%esp + 1000b3: 68 1a 63 10 00 push $0x10631a + 1000b8: e8 17 50 00 00 call 1050d4 + 1000bd: 83 c4 10 add $0x10,%esp + 1000c0: 4e dec %esi + 1000c1: 75 ed jne 1000b0 + 1000c3: 83 ec 0c sub $0xc,%esp + 1000c6: c7 43 18 08 00 00 00 movl $0x8,0x18(%ebx) + 1000cd: 68 c3 51 10 00 push $0x1051c3 + 1000d2: 89 f6 mov %esi,%esi + 1000d4: e8 fb 4f 00 00 call 1050d4 + 1000d9: 89 7b 18 mov %edi,0x18(%ebx) + 1000dc: e9 61 ff ff ff jmp 100042 + 1000e1: 8d 76 00 lea 0x0(%esi),%esi + 1000e4: 83 ec 0c sub $0xc,%esp + 1000e7: c7 43 18 04 00 00 00 movl $0x4,0x18(%ebx) + 1000ee: 68 c8 51 10 00 push $0x1051c8 + 1000f3: eb df jmp 1000d4 + 1000f5: 8d 76 00 lea 0x0(%esi),%esi + 1000f8: 83 ec 0c sub $0xc,%esp + 1000fb: c7 43 18 08 00 00 00 movl $0x8,0x18(%ebx) + 100102: 68 d2 51 10 00 push $0x1051d2 + 100107: e8 c8 4f 00 00 call 1050d4 + 10010c: c7 43 18 02 00 00 00 movl $0x2,0x18(%ebx) + 100113: c7 04 24 d9 51 10 00 movl $0x1051d9,(%esp,1) + 10011a: eb b8 jmp 1000d4 + +0010011c : +*****************************************************************************/ +#define BPERL 16 /* byte/line for dump */ + +void dump(unsigned char *data, unsigned count) +{ + 10011c: 55 push %ebp + 10011d: 89 e5 mov %esp,%ebp + 10011f: 57 push %edi + 100120: 56 push %esi + 100121: 53 push %ebx + 100122: 83 ec 0c sub $0xc,%esp + 100125: 8b 75 0c mov 0xc(%ebp),%esi + unsigned char byte1, byte2; + + while(count != 0) + 100128: 85 f6 test %esi,%esi + 10012a: 0f 84 86 00 00 00 je 1001b6 + { + for(byte1 = 0; byte1 < BPERL; byte1++) + 100130: 31 ff xor %edi,%edi + 100132: 8b 5d 08 mov 0x8(%ebp),%ebx + 100135: 8d 76 00 lea 0x0(%esi),%esi + { + if(count == 0) + 100138: 85 f6 test %esi,%esi + 10013a: 74 1d je 100159 + break; + printf("%02X ", data[byte1]); + 10013c: 83 ec 08 sub $0x8,%esp + 10013f: 0f b6 03 movzbl (%ebx),%eax + 100142: 50 push %eax + 100143: 68 dd 51 10 00 push $0x1051dd + 100148: 47 inc %edi + 100149: e8 86 4f 00 00 call 1050d4 + 10014e: 89 f8 mov %edi,%eax + count--; + 100150: 4e dec %esi + 100151: 83 c4 10 add $0x10,%esp + 100154: 43 inc %ebx + 100155: 3c 0f cmp $0xf,%al + 100157: 76 df jbe 100138 + } + printf("\t"); + 100159: 83 ec 0c sub $0xc,%esp + 10015c: 68 e3 51 10 00 push $0x1051e3 + 100161: e8 6e 4f 00 00 call 1050d4 + for(byte2 = 0; byte2 < byte1; byte2++) + 100166: 31 db xor %ebx,%ebx + 100168: 89 fa mov %edi,%edx + 10016a: 83 c4 10 add $0x10,%esp + 10016d: 38 d3 cmp %dl,%bl + 10016f: 73 29 jae 10019a + 100171: 8d 76 00 lea 0x0(%esi),%esi + { + if(data[byte2] < ' ') + 100174: 0f b6 c3 movzbl %bl,%eax + 100177: 8b 55 08 mov 0x8(%ebp),%edx + 10017a: 8a 04 10 mov (%eax,%edx,1),%al + 10017d: 3c 1f cmp $0x1f,%al + 10017f: 77 3f ja 1001c0 + printf("%c", '.'); + 100181: 83 ec 08 sub $0x8,%esp + 100184: 6a 2e push $0x2e + 100186: 68 e5 51 10 00 push $0x1051e5 + 10018b: e8 44 4f 00 00 call 1050d4 + 100190: 43 inc %ebx + 100191: 89 f8 mov %edi,%eax + else + printf("%c", data[byte2]); + 100193: 83 c4 10 add $0x10,%esp + 100196: 38 c3 cmp %al,%bl + 100198: 72 da jb 100174 + } + printf("\n"); + 10019a: 83 ec 0c sub $0xc,%esp + 10019d: 68 f8 5a 10 00 push $0x105af8 + 1001a2: e8 2d 4f 00 00 call 1050d4 + data += BPERL; + 1001a7: 83 45 08 10 addl $0x10,0x8(%ebp) + 1001ab: 83 c4 10 add $0x10,%esp + 1001ae: 85 f6 test %esi,%esi + 1001b0: 0f 85 7a ff ff ff jne 100130 + } +} + 1001b6: 8d 65 f4 lea 0xfffffff4(%ebp),%esp + 1001b9: 5b pop %ebx + 1001ba: 5e pop %esi + 1001bb: 5f pop %edi + 1001bc: c9 leave + 1001bd: c3 ret + 1001be: 89 f6 mov %esi,%esi + 1001c0: 83 ec 08 sub $0x8,%esp + 1001c3: 0f b6 c0 movzbl %al,%eax + 1001c6: 50 push %eax + 1001c7: eb bd jmp 100186 + 1001c9: 8d 76 00 lea 0x0(%esi),%esi + +001001cc : +/***************************************************************************** +*****************************************************************************/ +void dump_regs(regs_t *regs) +{ + 1001cc: 55 push %ebp + 1001cd: 89 e5 mov %esp,%ebp + 1001cf: 53 push %ebx + 1001d0: 83 ec 10 sub $0x10,%esp + 1001d3: 8b 5d 08 mov 0x8(%ebp),%ebx + printf("EDI=%08X ESI=%08X EBP=%08X ESP=%08X\n", + 1001d6: ff 73 0c pushl 0xc(%ebx) + 1001d9: ff 73 08 pushl 0x8(%ebx) + 1001dc: ff 73 04 pushl 0x4(%ebx) + 1001df: ff 33 pushl (%ebx) + 1001e1: 68 00 52 10 00 push $0x105200 + 1001e6: e8 e9 4e 00 00 call 1050d4 + regs->edi, regs->esi, regs->ebp, regs->esp); + printf("EBX=%08X EDX=%08X ECX=%08X EAX=%08X\n", + 1001eb: 83 c4 14 add $0x14,%esp + 1001ee: ff 73 1c pushl 0x1c(%ebx) + 1001f1: ff 73 18 pushl 0x18(%ebx) + 1001f4: ff 73 14 pushl 0x14(%ebx) + 1001f7: ff 73 10 pushl 0x10(%ebx) + 1001fa: 68 40 52 10 00 push $0x105240 + 1001ff: e8 d0 4e 00 00 call 1050d4 + regs->ebx, regs->edx, regs->ecx, regs->eax); + printf(" DS=%08X ES=%08X FS=%08X GS=%08X\n", + 100204: 83 c4 14 add $0x14,%esp + 100207: ff 73 2c pushl 0x2c(%ebx) + 10020a: ff 73 28 pushl 0x28(%ebx) + 10020d: ff 73 24 pushl 0x24(%ebx) + 100210: ff 73 20 pushl 0x20(%ebx) + 100213: 68 80 52 10 00 push $0x105280 + 100218: e8 b7 4e 00 00 call 1050d4 + regs->ds, regs->es, regs->fs, regs->gs); + printf("int=%08X err=%08X EIP=%08X CS=%08X\n", + 10021d: 83 c4 14 add $0x14,%esp + 100220: ff 73 3c pushl 0x3c(%ebx) + 100223: ff 73 38 pushl 0x38(%ebx) + 100226: ff 73 34 pushl 0x34(%ebx) + 100229: ff 73 30 pushl 0x30(%ebx) + 10022c: 68 c0 52 10 00 push $0x1052c0 + 100231: e8 9e 4e 00 00 call 1050d4 + regs->which_int, regs->err_code, regs->eip, regs->cs); + printf("uSP=%08X uSS=%08X\n", regs->user_esp, regs->user_ss); + 100236: 83 c4 1c add $0x1c,%esp + 100239: ff 73 48 pushl 0x48(%ebx) + 10023c: ff 73 44 pushl 0x44(%ebx) + 10023f: 68 e8 51 10 00 push $0x1051e8 + 100244: e8 8b 4e 00 00 call 1050d4 +} + 100249: 8b 5d fc mov 0xfffffffc(%ebp),%ebx + 10024c: c9 leave + 10024d: c3 ret + ... + +00100250 : + * + * @return void + */ +void keyDown(unsigned key) +{ + 100250: 55 push %ebp + 100251: 89 e5 mov %esp,%ebp + key = key; /* to shut gcc up */ +} + 100253: c9 leave + 100254: c3 ret + 100255: 8d 76 00 lea 0x0(%esi),%esi + +00100258 : + +/** + * keyUp() + * + * This function is called when a key is released. + * + * @param unsigned Which key was released. See keyboard.h + * + * @return void + */ +void keyUp(unsigned key) +{ + 100258: 55 push %ebp + 100259: 89 e5 mov %esp,%ebp + key = key; /* to shut gcc up */ +} + 10025b: c9 leave + 10025c: c3 ret + 10025d: 8d 76 00 lea 0x0(%esi),%esi + +00100260 : + +void initCommands(void) +{ + 100260: 55 push %ebp + 100261: 89 e5 mov %esp,%ebp + 100263: 83 ec 10 sub $0x10,%esp + eshCommands[0].minparams = 0; + eshCommands[0].maxparams = 0; + strcpy(eshCommands[0].command, "dumpheap\0"); + 100266: 68 00 53 10 00 push $0x105300 + 10026b: 68 48 3a 18 00 push $0x183a48 + 100270: c7 05 40 3a 18 00 00 movl $0x0,0x183a40 + 100277: 00 00 00 + 10027a: c7 05 44 3a 18 00 00 movl $0x0,0x183a44 + 100281: 00 00 00 + 100284: e8 b3 4e 00 00 call 10513c + strcpy(eshCommands[0].params[0], "-h\0"); + 100289: 58 pop %eax + 10028a: 5a pop %edx + 10028b: 68 0a 53 10 00 push $0x10530a + 100290: 68 48 3c 18 00 push $0x183c48 + 100295: e8 a2 4e 00 00 call 10513c + strcpy(eshCommands[0].description, "Print listing of heap usage and status.\0"); + 10029a: 59 pop %ecx + 10029b: 58 pop %eax + 10029c: 68 20 53 10 00 push $0x105320 + 1002a1: 68 48 64 18 00 push $0x186448 + 1002a6: e8 91 4e 00 00 call 10513c + + eshCommands[1].minparams = 1; + eshCommands[1].maxparams = MAX_PARAMS; + strcpy(eshCommands[1].params[0], "-h\0"); + 1002ab: 58 pop %eax + 1002ac: 5a pop %edx + 1002ad: 68 0a 53 10 00 push $0x10530a + 1002b2: 68 50 68 18 00 push $0x186850 + 1002b7: c7 05 48 66 18 00 01 movl $0x1,0x186648 + 1002be: 00 00 00 + 1002c1: c7 05 4c 66 18 00 14 movl $0x14,0x18664c + 1002c8: 00 00 00 + 1002cb: e8 6c 4e 00 00 call 10513c + strcpy(eshCommands[1].command, "echo\0"); + 1002d0: 59 pop %ecx + 1002d1: 58 pop %eax + 1002d2: 68 49 53 10 00 push $0x105349 + 1002d7: 68 50 66 18 00 push $0x186650 + 1002dc: e8 5b 4e 00 00 call 10513c + strcpy(eshCommands[1].description, "Echo a line of text to the terminal.\0"); + 1002e1: 58 pop %eax + 1002e2: 5a pop %edx + 1002e3: 68 60 53 10 00 push $0x105360 + 1002e8: 68 50 90 18 00 push $0x189050 + 1002ed: e8 4a 4e 00 00 call 10513c + + /*this will be called with either "help" or "help command" */ + eshCommands[2].minparams = 0; + eshCommands[2].maxparams = 1; + strcpy(eshCommands[2].params[0], "-h\0"); + 1002f2: 59 pop %ecx + 1002f3: 58 pop %eax + 1002f4: 68 0a 53 10 00 push $0x10530a + 1002f9: 68 58 94 18 00 push $0x189458 + 1002fe: c7 05 50 92 18 00 00 movl $0x0,0x189250 + 100305: 00 00 00 + 100308: c7 05 54 92 18 00 01 movl $0x1,0x189254 + 10030f: 00 00 00 + 100312: e8 25 4e 00 00 call 10513c + strcpy(eshCommands[2].command, "help\0"); + 100317: 58 pop %eax + 100318: 5a pop %edx + 100319: 68 86 53 10 00 push $0x105386 + 10031e: 68 58 92 18 00 push $0x189258 + 100323: e8 14 4e 00 00 call 10513c + strcpy(eshCommands[2].description, "Displays general help menu or help on specific command.\0"); + 100328: 59 pop %ecx + 100329: 58 pop %eax + 10032a: 68 a0 53 10 00 push $0x1053a0 + 10032f: 68 58 bc 18 00 push $0x18bc58 + 100334: e8 03 4e 00 00 call 10513c + + /* -r|-h [time] */ + eshCommands[3].minparams = 1; + eshCommands[3].maxparams = 2; + strcpy(eshCommands[3].command, "shutdown\0"); + 100339: 58 pop %eax + 10033a: 5a pop %edx + 10033b: 68 d9 53 10 00 push $0x1053d9 + 100340: 68 60 be 18 00 push $0x18be60 + 100345: c7 05 58 be 18 00 01 movl $0x1,0x18be58 + 10034c: 00 00 00 + 10034f: c7 05 5c be 18 00 02 movl $0x2,0x18be5c + 100356: 00 00 00 + 100359: e8 de 4d 00 00 call 10513c + strcpy(eshCommands[3].params[0], "-r\0"); + 10035e: 59 pop %ecx + 10035f: 58 pop %eax + 100360: 68 e3 53 10 00 push $0x1053e3 + 100365: 68 60 c0 18 00 push $0x18c060 + 10036a: e8 cd 4d 00 00 call 10513c + strcpy(eshCommands[3].params[1], "-h\0"); + 10036f: 58 pop %eax + 100370: 5a pop %edx + 100371: 68 0a 53 10 00 push $0x10530a + 100376: 68 60 c2 18 00 push $0x18c260 + 10037b: e8 bc 4d 00 00 call 10513c + strcpy(eshCommands[3].params[2], "NOW\0"); + 100380: 59 pop %ecx + 100381: 58 pop %eax + 100382: 68 e7 53 10 00 push $0x1053e7 + 100387: 68 60 c4 18 00 push $0x18c460 + 10038c: e8 ab 4d 00 00 call 10513c + strcpy(eshCommands[3].description, "Halt or restart the system.\0"); + 100391: 58 pop %eax + 100392: 5a pop %edx + 100393: 68 ec 53 10 00 push $0x1053ec + 100398: 68 60 e8 18 00 push $0x18e860 + 10039d: e8 9a 4d 00 00 call 10513c + + /* clear screen */ + eshCommands[4].minparams = 0; + eshCommands[4].maxparams = 0; + strcpy(eshCommands[4].params[0], "-h\0"); + 1003a2: 59 pop %ecx + 1003a3: 58 pop %eax + 1003a4: 68 0a 53 10 00 push $0x10530a + 1003a9: 68 68 ec 18 00 push $0x18ec68 + 1003ae: c7 05 60 ea 18 00 00 movl $0x0,0x18ea60 + 1003b5: 00 00 00 + 1003b8: c7 05 64 ea 18 00 00 movl $0x0,0x18ea64 + 1003bf: 00 00 00 + 1003c2: e8 75 4d 00 00 call 10513c + strcpy(eshCommands[4].command, "cls\0"); + 1003c7: 58 pop %eax + 1003c8: 5a pop %edx + 1003c9: 68 09 54 10 00 push $0x105409 + 1003ce: 68 68 ea 18 00 push $0x18ea68 + 1003d3: e8 64 4d 00 00 call 10513c + strcpy(eshCommands[4].description, "Clears the terminal of all output.\0"); + 1003d8: 59 pop %ecx + 1003d9: 58 pop %eax + 1003da: 68 20 54 10 00 push $0x105420 + 1003df: 68 68 14 19 00 push $0x191468 + 1003e4: e8 53 4d 00 00 call 10513c + + /* print working directory */ + eshCommands[5].minparams = 0; + eshCommands[5].maxparams = 0; + strcpy(eshCommands[5].params[0], "-h\0"); + 1003e9: 58 pop %eax + 1003ea: 5a pop %edx + 1003eb: 68 0a 53 10 00 push $0x10530a + 1003f0: 68 70 18 19 00 push $0x191870 + 1003f5: c7 05 68 16 19 00 00 movl $0x0,0x191668 + 1003fc: 00 00 00 + 1003ff: c7 05 6c 16 19 00 00 movl $0x0,0x19166c + 100406: 00 00 00 + 100409: e8 2e 4d 00 00 call 10513c + strcpy(eshCommands[5].command, "pwd\0"); + 10040e: 59 pop %ecx + 10040f: 58 pop %eax + 100410: 68 44 54 10 00 push $0x105444 + 100415: 68 70 16 19 00 push $0x191670 + 10041a: e8 1d 4d 00 00 call 10513c + strcpy(eshCommands[5].description, "Prints the current working directory.\0"); + 10041f: 58 pop %eax + 100420: 5a pop %edx + 100421: 68 60 54 10 00 push $0x105460 + 100426: 68 70 40 19 00 push $0x194070 + 10042b: e8 0c 4d 00 00 call 10513c +} + 100430: c9 leave + 100431: c3 ret + 100432: 89 f6 mov %esi,%esi + +00100434 : + +/** + * mapCommand() + * + * Used internally by esh to map a command to it's zero-based + * index of commands. + * + * @param char * the entire line of the command + * + * @return int index of command entry if found, otherwise -1 + */ +int mapCommand(char *cmd) +{ + 100434: 55 push %ebp + 100435: 89 e5 mov %esp,%ebp + 100437: 57 push %edi + 100438: 56 push %esi + 100439: 53 push %ebx + 10043a: 81 ec 0c 02 00 00 sub $0x20c,%esp + 100440: 8b 75 08 mov 0x8(%ebp),%esi + int i; /* for our loops */ + int params; /* number of parameters found for the command */ + int previdx; /* previous index */ + char cmdName[MAX_LEN]; /* name of the command */ + + i = 0; + 100443: 31 db xor %ebx,%ebx + 100445: 8d 76 00 lea 0x0(%esi),%esi + previdx = 0; + params = 0; + + /** + * Loop while cmd[i] is not a space + */ + i = 0; + for(i = 0; i < (int)strlen(cmd); i++) + 100448: 83 ec 0c sub $0xc,%esp + 10044b: 56 push %esi + 10044c: e8 07 4d 00 00 call 105158 + 100451: 83 c4 10 add $0x10,%esp + 100454: 39 c3 cmp %eax,%ebx + 100456: 7d 09 jge 100461 + { + if(cmd[i] == ' ') + 100458: 80 3c 33 20 cmpb $0x20,(%ebx,%esi,1) + 10045c: 74 03 je 100461 + 10045e: 43 inc %ebx + 10045f: eb e7 jmp 100448 + break; + } + + strncpy(cmdName, cmd, i); + 100461: 51 push %ecx + 100462: 53 push %ebx + 100463: 56 push %esi + 100464: 8d bd e8 fd ff ff lea 0xfffffde8(%ebp),%edi + 10046a: 57 push %edi + 10046b: e8 04 4d 00 00 call 105174 + cmdName[i] = '\0'; + + for(i = 0; i < COMMAND_COUNT; i++) + 100470: be 48 3a 18 00 mov $0x183a48,%esi + 100475: c6 84 2b e8 fd ff ff movb $0x0,0xfffffde8(%ebx,%ebp,1) + 10047c: 00 + 10047d: 83 c4 10 add $0x10,%esp + 100480: 31 db xor %ebx,%ebx + 100482: 89 f6 mov %esi,%esi + { + if(!strcmp(eshCommands[i].command, cmdName)) + 100484: 83 ec 08 sub $0x8,%esp + 100487: 57 push %edi + 100488: 56 push %esi + 100489: e8 62 4c 00 00 call 1050f0 + 10048e: 83 c4 10 add $0x10,%esp + 100491: 85 c0 test %eax,%eax + 100493: 89 da mov %ebx,%edx + 100495: 74 11 je 1004a8 + 100497: 43 inc %ebx + 100498: 81 c6 08 2c 00 00 add $0x2c08,%esi + 10049e: 83 fb 05 cmp $0x5,%ebx + 1004a1: 7e e1 jle 100484 + return i; + } + + return -1; + 1004a3: ba ff ff ff ff mov $0xffffffff,%edx +} + 1004a8: 8d 65 f4 lea 0xfffffff4(%ebp),%esp + 1004ab: 5b pop %ebx + 1004ac: 5e pop %esi + 1004ad: 89 d0 mov %edx,%eax + 1004af: 5f pop %edi + 1004b0: c9 leave + 1004b1: c3 ret + 1004b2: 89 f6 mov %esi,%esi + +001004b4 : + +/** + * isParam() + * + * Determines if the supplied parameter is valid for the + * given command. + * + * @param int index of command + * @param char * command string + * + * @return bool true if parameter is valid, false otherwise + */ +bool isParam(int argc, char *argv) +{ + 1004b4: 55 push %ebp + 1004b5: 89 e5 mov %esp,%ebp + 1004b7: 57 push %edi + 1004b8: 56 push %esi + 1004b9: 53 push %ebx + 1004ba: 83 ec 0c sub $0xc,%esp + 1004bd: 8b 55 08 mov 0x8(%ebp),%edx + int i; + + for(i = 0; i < MAX_PARAMS; i++) + 1004c0: 8d 04 92 lea (%edx,%edx,4),%eax + 1004c3: 8d 04 42 lea (%edx,%eax,2),%eax + 1004c6: c1 e0 07 shl $0x7,%eax + 1004c9: 01 d0 add %edx,%eax + 1004cb: 8b 7d 0c mov 0xc(%ebp),%edi + 1004ce: 31 f6 xor %esi,%esi + 1004d0: 8d 1c c5 48 3c 18 00 lea 0x183c48(,%eax,8),%ebx + 1004d7: 90 nop + { + if(!strcmp(eshCommands[argc].params[i], argv)) + 1004d8: 83 ec 08 sub $0x8,%esp + 1004db: 57 push %edi + 1004dc: 53 push %ebx + 1004dd: e8 0e 4c 00 00 call 1050f0 + 1004e2: 83 c4 10 add $0x10,%esp + 1004e5: 85 c0 test %eax,%eax + 1004e7: ba 01 00 00 00 mov $0x1,%edx + 1004ec: 74 0e je 1004fc + 1004ee: 46 inc %esi + 1004ef: 81 c3 00 02 00 00 add $0x200,%ebx + 1004f5: 83 fe 13 cmp $0x13,%esi + 1004f8: 7e de jle 1004d8 + return true; + } + + return false; + 1004fa: 31 d2 xor %edx,%edx +} + 1004fc: 8d 65 f4 lea 0xfffffff4(%ebp),%esp + 1004ff: 5b pop %ebx + 100500: 5e pop %esi + 100501: 89 d0 mov %edx,%eax + 100503: 5f pop %edi + 100504: c9 leave + 100505: c3 ret + 100506: 89 f6 mov %esi,%esi + +00100508 : + +/** + * mapParams() + * + * Maps each parameter to the pars struct + * + * @param char * Buffer from the command line + * @param struct Parameter structure + * + * @return int Number of command line parameters (arguments) parsed + */ +int mapParams(char *buf, ESHCURRCOMMAND *pars) +{ + 100508: 55 push %ebp + 100509: 89 e5 mov %esp,%ebp + 10050b: 57 push %edi + 10050c: 56 push %esi + 10050d: 53 push %ebx + 10050e: 83 ec 18 sub $0x18,%esp + 100511: 8b 7d 08 mov 0x8(%ebp),%edi + int i; /* for our loops */ + int previdx; /* previous index */ + int idx; /* current index */ + int j; /* loops */ + + i = 0; + j = 0; + previdx = 0; + pars->count = 0; + 100514: 8b 45 0c mov 0xc(%ebp),%eax + 100517: c7 00 00 00 00 00 movl $0x0,(%eax) + + previdx = mapCommand(buf); + 10051d: 57 push %edi + 10051e: e8 11 ff ff ff call 100434 + 100523: 89 c2 mov %eax,%edx + 100525: 31 f6 xor %esi,%esi + + if(previdx == -1) + 100527: 83 c4 10 add $0x10,%esp + 10052a: 31 c0 xor %eax,%eax + 10052c: 83 fa ff cmp $0xffffffff,%edx + 10052f: 0f 84 0d 01 00 00 je 100642 + return 0; + + strcpy(pars->param[0], eshCommands[previdx].command); + 100535: 8d 04 92 lea (%edx,%edx,4),%eax + 100538: 8d 04 42 lea (%edx,%eax,2),%eax + 10053b: c1 e0 07 shl $0x7,%eax + 10053e: 01 d0 add %edx,%eax + 100540: 83 ec 08 sub $0x8,%esp + 100543: 8d 04 c5 48 3a 18 00 lea 0x183a48(,%eax,8),%eax + 10054a: 50 push %eax + 10054b: 8b 45 0c mov 0xc(%ebp),%eax + 10054e: 83 c0 04 add $0x4,%eax + 100551: 50 push %eax + 100552: e8 e5 4b 00 00 call 10513c + j++; + pars->count++; + 100557: 8b 55 0c mov 0xc(%ebp),%edx + 10055a: ff 02 incl (%edx) + + i = 0; + idx = 0; + + for(i = 0; i < (int)strlen(buf); i++) + 10055c: 83 c4 10 add $0x10,%esp + 10055f: 81 c2 00 02 00 00 add $0x200,%edx + 100565: c7 45 ec 01 00 00 00 movl $0x1,0xffffffec(%ebp) + 10056c: 89 55 e8 mov %edx,0xffffffe8(%ebp) + 10056f: 90 nop + 100570: 83 ec 0c sub $0xc,%esp + 100573: 57 push %edi + 100574: e8 df 4b 00 00 call 105158 + 100579: 83 c4 10 add $0x10,%esp + 10057c: 39 c6 cmp %eax,%esi + 10057e: 0f 8d b9 00 00 00 jge 10063d + { + /* we have encountered a seperator */ + if(buf[i] == ' ') + 100584: 80 3c 3e 20 cmpb $0x20,(%esi,%edi,1) + 100588: 74 06 je 100590 + 10058a: 46 inc %esi + 10058b: eb e3 jmp 100570 + 10058d: 8d 76 00 lea 0x0(%esi),%esi + { + if(j > MAX_PARAMS) + 100590: 83 7d ec 14 cmpl $0x14,0xffffffec(%ebp) + 100594: 0f 8f a3 00 00 00 jg 10063d + break; + + i++; /* skip one space */ + 10059a: 46 inc %esi + + idx = i; + 10059b: 89 75 f0 mov %esi,0xfffffff0(%ebp) + + if(buf[i] == '"') + 10059e: 8a 04 3e mov (%esi,%edi,1),%al + 1005a1: 3c 22 cmp $0x22,%al + 1005a3: 74 57 je 1005fc + 1005a5: 8d 76 00 lea 0x0(%esi),%esi + 1005a8: 3c 20 cmp $0x20,%al + 1005aa: 74 16 je 1005c2 + 1005ac: 83 ec 0c sub $0xc,%esp + 1005af: 57 push %edi + 1005b0: e8 a3 4b 00 00 call 105158 + 1005b5: 83 c4 10 add $0x10,%esp + 1005b8: 39 c6 cmp %eax,%esi + 1005ba: 74 06 je 1005c2 + { + i++; + idx++; + + while(buf[i] != '"' && i != (int)strlen(buf)) + i++; + + strncpy(pars->param[j], &buf[idx], (i - idx)); + pars->param[j][i - idx] = '\0'; + + idx = i; + j++; + pars->count++; + } + else + { + while(buf[i] != ' ' && i != (int)strlen(buf)) + i++; + 1005bc: 46 inc %esi + 1005bd: 8a 04 3e mov (%esi,%edi,1),%al + 1005c0: eb e6 jmp 1005a8 + + strncpy(pars->param[j], &buf[idx], i - idx); + 1005c2: 53 push %ebx + 1005c3: 89 f3 mov %esi,%ebx + 1005c5: 2b 5d f0 sub 0xfffffff0(%ebp),%ebx + 1005c8: 8b 55 f0 mov 0xfffffff0(%ebp),%edx + 1005cb: 53 push %ebx + 1005cc: 8d 04 3a lea (%edx,%edi,1),%eax + 1005cf: 50 push %eax + 1005d0: 8b 45 e8 mov 0xffffffe8(%ebp),%eax + 1005d3: 83 c0 04 add $0x4,%eax + 1005d6: 50 push %eax + 1005d7: e8 98 4b 00 00 call 105174 + pars->param[j][i - idx] = '\0'; + 1005dc: 8b 45 e8 mov 0xffffffe8(%ebp),%eax + 1005df: c6 44 03 04 00 movb $0x0,0x4(%ebx,%eax,1) + i = idx; + 1005e4: 8b 75 f0 mov 0xfffffff0(%ebp),%esi + j++; + 1005e7: 05 00 02 00 00 add $0x200,%eax + pars->count++; + 1005ec: 8b 55 0c mov 0xc(%ebp),%edx + 1005ef: ff 45 ec incl 0xffffffec(%ebp) + 1005f2: 89 45 e8 mov %eax,0xffffffe8(%ebp) + 1005f5: ff 02 incl (%edx) + 1005f7: 83 c4 10 add $0x10,%esp + 1005fa: eb 8e jmp 10058a + 1005fc: 46 inc %esi + 1005fd: ff 45 f0 incl 0xfffffff0(%ebp) + 100600: 80 3c 3e 22 cmpb $0x22,(%esi,%edi,1) + 100604: 74 13 je 100619 + 100606: 83 ec 0c sub $0xc,%esp + 100609: 57 push %edi + 10060a: e8 49 4b 00 00 call 105158 + 10060f: 83 c4 10 add $0x10,%esp + 100612: 39 c6 cmp %eax,%esi + 100614: 74 03 je 100619 + 100616: 46 inc %esi + 100617: eb e7 jmp 100600 + 100619: 89 f3 mov %esi,%ebx + 10061b: 2b 5d f0 sub 0xfffffff0(%ebp),%ebx + 10061e: 8b 55 f0 mov 0xfffffff0(%ebp),%edx + 100621: 50 push %eax + 100622: 53 push %ebx + 100623: 8d 04 3a lea (%edx,%edi,1),%eax + 100626: 50 push %eax + 100627: 8b 45 e8 mov 0xffffffe8(%ebp),%eax + 10062a: 83 c0 04 add $0x4,%eax + 10062d: 50 push %eax + 10062e: e8 41 4b 00 00 call 105174 + 100633: 8b 45 e8 mov 0xffffffe8(%ebp),%eax + 100636: c6 44 03 04 00 movb $0x0,0x4(%ebx,%eax,1) + 10063b: eb aa jmp 1005e7 + } + } + } + + return pars->count; + 10063d: 8b 55 0c mov 0xc(%ebp),%edx + 100640: 8b 02 mov (%edx),%eax +} + 100642: 8d 65 f4 lea 0xfffffff4(%ebp),%esp + 100645: 5b pop %ebx + 100646: 5e pop %esi + 100647: 5f pop %edi + 100648: c9 leave + 100649: c3 ret + 10064a: 89 f6 mov %esi,%esi + +0010064c : + +/** + * processCommand() + * + * This function is called when the user has pressed + * the ENTER key. + * + * @param char * The contents of the current buffer or NULL if empty + * @param int Size of the buffer (number of characters) + * + * @return void + */ +void processCommand(char *line, int count) +{ + 10064c: 55 push %ebp + 10064d: 89 e5 mov %esp,%ebp + 10064f: 57 push %edi + 100650: 56 push %esi + 100651: 53 push %ebx + 100652: 81 ec 1c 50 00 00 sub $0x501c,%esp + 100658: 8b 75 08 mov 0x8(%ebp),%esi + int i; + int cmd; /* stores the numeric index of the command */ + ESHCURRCOMMAND params; + + count = count; /* to shut gcc up */ + + /*for(i = 0; i < MAX_PARAMS; i++) + params.param[i][0] = '\0';*/ + params.param[0][0] = '\0'; + 10065b: c6 85 dc af ff ff 00 movb $0x0,0xffffafdc(%ebp) + + initCommands(); + 100662: e8 f9 fb ff ff call 100260 + + cmd = mapCommand(line); + 100667: 83 ec 0c sub $0xc,%esp + 10066a: 56 push %esi + 10066b: e8 c4 fd ff ff call 100434 + mapParams(line, ¶ms); + 100670: 5f pop %edi + 100671: 89 c3 mov %eax,%ebx + 100673: 8d bd d8 af ff ff lea 0xffffafd8(%ebp),%edi + 100679: 58 pop %eax + 10067a: 57 push %edi + 10067b: 56 push %esi + 10067c: e8 87 fe ff ff call 100508 + + switch(cmd) + 100681: 83 c4 10 add $0x10,%esp + 100684: 83 fb 01 cmp $0x1,%ebx + 100687: 0f 84 13 01 00 00 je 1007a0 + 10068d: 83 fb 01 cmp $0x1,%ebx + 100690: 0f 8e f6 00 00 00 jle 10078c + 100696: 83 fb 02 cmp $0x2,%ebx + 100699: 74 4a je 1006e5 + { + case 0: /* dumpheap */ + dumpheapk(); + //testheap(); + break; + case 1: /* echo */ + for(i = 1; i < params.count; i++) + printf("%s", params.param[i]); + + printf("\n"); + break; + case 2: /* help */ + if(params.count == 1) + { + printf("HybOS EShell Commands:\n"); + for(i = 0; i < COMMAND_COUNT; i++) + if(strlen(eshCommands[i].command) > 0) + printf("%10s %-s\n", eshCommands[i].command, eshCommands[i].description); + } + else + { + cmd = mapCommand(params.param[0]); + mapParams(params.param[1], ¶ms); + + //if(isParam(cmd, params.param[1])) + if(cmd != -1) + { + printf("Usage: %s %s\n", params.param[0], eshCommands[cmd].params[1]); + } + else + printf("esh: '%s' not found.\n", params.param[1]); + } + break; + default: + if(strlen(params.param[0]) > 0 && strcmp(params.param[0], "help")) + 10069b: 83 ec 0c sub $0xc,%esp + 10069e: 8d 9d dc af ff ff lea 0xffffafdc(%ebp),%ebx + 1006a4: 53 push %ebx + 1006a5: e8 ae 4a 00 00 call 105158 + 1006aa: 83 c4 10 add $0x10,%esp + 1006ad: 85 c0 test %eax,%eax + 1006af: 74 15 je 1006c6 + 1006b1: 83 ec 08 sub $0x8,%esp + 1006b4: 68 87 54 10 00 push $0x105487 + 1006b9: 53 push %ebx + 1006ba: e8 31 4a 00 00 call 1050f0 + 1006bf: 83 c4 10 add $0x10,%esp + 1006c2: 85 c0 test %eax,%eax + 1006c4: 75 19 jne 1006df + printf("esh: '%s' not found.\n", params.param[0]); + else + printf("esh: '%s' not found.\n", &line[0]); + 1006c6: 83 ec 08 sub $0x8,%esp + 1006c9: 56 push %esi + 1006ca: 68 8c 54 10 00 push $0x10548c + 1006cf: e8 00 4a 00 00 call 1050d4 + 1006d4: 83 c4 10 add $0x10,%esp + break; + } + + /*for(i = 0; i < params.count; i++) + printf("param[%i]: %s\n", i, params.param[i]);*/ + + //if(isParam(3, ¶ms.param[1])) + // printf("valid parameter\n"); + //else + // printf("invalid parameter\n"); + + return; + + if(!strcmp(line, "dumpheap")) + dumpheapk(); + else if(!strncmp(line, "echo", 4)) + printf("%s\n", line[4] == ' ' ? &line[5] : &line[4]); + else if(!strcmp(line, "help")) + { + printf("HybOS EShell Commands:\n"); + printf("dumpheap\tPrint listing of heap usage and status\n"); + printf("testheap\tTest the heap and print out results\n"); + printf("shutdown -r\tRestart the system.\n"); + printf("pwd\t\tPrint the current working directory.\n"); + } + else if(!strncmp(line, "shutdown", 8)) + { + if(strlen(line) > 9 && !strncmp(&line[9], "-r", 2)) + { + printf("\nSystem shutdown from vtty%u\n", get_current_vc()); + printf("Restarting..."); + //reboot(); + } + else + { + if((strlen(line) > 9) && (strlen(&line[9]) > 0)) + printf("shutdown: Invalid argument \"%s\".\n", &line[9]); + else + printf("Usage: shutdown -r\n"); + } + } + else if((strlen(line) > 0) && (!strcmp(line, "cls"))) + { + printf("\x1B[2J"); + } + else if((strlen(line) >= 8) && (!strcmp(line, "testheap"))) + { + //testheap(); + } + else if((strlen(line) > 0) && (!strcmp(line, "pwd"))) + printf("/\n"); + else if(strlen(line) > 0) + printf("eshell: \"%s\" not found.\n", line); +} + 1006d7: 8d 65 f4 lea 0xfffffff4(%ebp),%esp + 1006da: 5b pop %ebx + 1006db: 5e pop %esi + 1006dc: 5f pop %edi + 1006dd: c9 leave + 1006de: c3 ret + 1006df: 83 ec 08 sub $0x8,%esp + 1006e2: 53 push %ebx + 1006e3: eb e5 jmp 1006ca + 1006e5: 83 bd d8 af ff ff 01 cmpl $0x1,0xffffafd8(%ebp) + 1006ec: 74 4a je 100738 + 1006ee: 83 ec 0c sub $0xc,%esp + 1006f1: 8d 85 dc af ff ff lea 0xffffafdc(%ebp),%eax + 1006f7: 50 push %eax + 1006f8: e8 37 fd ff ff call 100434 + 1006fd: 89 c3 mov %eax,%ebx + 1006ff: 58 pop %eax + 100700: 5a pop %edx + 100701: 57 push %edi + 100702: 8d b5 dc b1 ff ff lea 0xffffb1dc(%ebp),%esi + 100708: 56 push %esi + 100709: e8 fa fd ff ff call 100508 + 10070e: 83 c4 10 add $0x10,%esp + 100711: 83 fb ff cmp $0xffffffff,%ebx + 100714: 74 b0 je 1006c6 + 100716: 50 push %eax + 100717: 8d 04 9b lea (%ebx,%ebx,4),%eax + 10071a: 8d 04 43 lea (%ebx,%eax,2),%eax + 10071d: c1 e0 07 shl $0x7,%eax + 100720: 01 d8 add %ebx,%eax + 100722: 8d 04 c5 48 3e 18 00 lea 0x183e48(,%eax,8),%eax + 100729: 50 push %eax + 10072a: 8d 85 dc af ff ff lea 0xffffafdc(%ebp),%eax + 100730: 50 push %eax + 100731: 68 a2 54 10 00 push $0x1054a2 + 100736: eb 97 jmp 1006cf + 100738: 83 ec 0c sub $0xc,%esp + 10073b: 68 b0 54 10 00 push $0x1054b0 + 100740: e8 8f 49 00 00 call 1050d4 + 100745: 31 ff xor %edi,%edi + 100747: 83 c4 10 add $0x10,%esp + 10074a: be 05 00 00 00 mov $0x5,%esi + 10074f: 90 nop + 100750: 83 ec 0c sub $0xc,%esp + 100753: 8d 9f 48 3a 18 00 lea 0x183a48(%edi),%ebx + 100759: 53 push %ebx + 10075a: e8 f9 49 00 00 call 105158 + 10075f: 83 c4 10 add $0x10,%esp + 100762: 85 c0 test %eax,%eax + 100764: 75 0e jne 100774 + 100766: 81 c7 08 2c 00 00 add $0x2c08,%edi + 10076c: 4e dec %esi + 10076d: 79 e1 jns 100750 + 10076f: e9 63 ff ff ff jmp 1006d7 + 100774: 8d 87 48 64 18 00 lea 0x186448(%edi),%eax + 10077a: 51 push %ecx + 10077b: 50 push %eax + 10077c: 53 push %ebx + 10077d: 68 c8 54 10 00 push $0x1054c8 + 100782: e8 4d 49 00 00 call 1050d4 + 100787: 83 c4 10 add $0x10,%esp + 10078a: eb da jmp 100766 + 10078c: 85 db test %ebx,%ebx + 10078e: 0f 85 07 ff ff ff jne 10069b + 100794: e8 83 38 00 00 call 10401c + 100799: e9 39 ff ff ff jmp 1006d7 + 10079e: 89 f6 mov %esi,%esi + 1007a0: 3b 9d d8 af ff ff cmp 0xffffafd8(%ebp),%ebx + 1007a6: be 01 00 00 00 mov $0x1,%esi + 1007ab: 7d 27 jge 1007d4 + 1007ad: 8d 9d dc b1 ff ff lea 0xffffb1dc(%ebp),%ebx + 1007b3: 90 nop + 1007b4: 83 ec 08 sub $0x8,%esp + 1007b7: 53 push %ebx + 1007b8: 68 bd 51 10 00 push $0x1051bd + 1007bd: 46 inc %esi + 1007be: e8 11 49 00 00 call 1050d4 + 1007c3: 81 c3 00 02 00 00 add $0x200,%ebx + 1007c9: 83 c4 10 add $0x10,%esp + 1007cc: 3b b5 d8 af ff ff cmp 0xffffafd8(%ebp),%esi + 1007d2: 7c e0 jl 1007b4 + 1007d4: 83 ec 0c sub $0xc,%esp + 1007d7: 68 f8 5a 10 00 push $0x105af8 + 1007dc: e9 ee fe ff ff jmp 1006cf + 1007e1: 00 00 add %al,(%eax) + ... + +001007e4 : + * reboot() + * + */ +static void reboot(void) +{ + 1007e4: 55 push %ebp + 1007e5: 89 e5 mov %esp,%ebp + 1007e7: 53 push %ebx + 1007e8: 50 push %eax + unsigned temp; + + disable(); + 1007e9: e8 da 44 00 00 call 104cc8 + + /** + * flush the keyboard controller + */ + do + { + temp = inportb(0x64); + 1007ee: 83 ec 0c sub $0xc,%esp + 1007f1: 6a 64 push $0x64 + 1007f3: e8 1c 48 00 00 call 105014 + if((temp & 0x01) != 0) + 1007f8: 83 c4 10 add $0x10,%esp + 1007fb: a8 01 test $0x1,%al + 1007fd: 89 c3 mov %eax,%ebx + 1007ff: 75 19 jne 10081a + { + (void)inportb(0x60); + continue; + } + } while((temp & 0x02) != 0); + 100801: 83 e3 02 and $0x2,%ebx + 100804: 75 e8 jne 1007ee + + /** + * now pulse the cpu reset line + */ + outportb(0x64, 0xFE); + 100806: 83 ec 08 sub $0x8,%esp + 100809: 68 fe 00 00 00 push $0xfe + 10080e: 6a 64 push $0x64 + 100810: e8 9f 48 00 00 call 1050b4 + + /** + * if that didn't work, just halt + */ + while(1); + 100815: 83 c4 10 add $0x10,%esp + 100818: eb fe jmp 100818 + 10081a: 83 ec 0c sub $0xc,%esp + 10081d: 6a 60 push $0x60 + 10081f: e8 f0 47 00 00 call 105014 + 100824: 83 c4 10 add $0x10,%esp + 100827: eb d8 jmp 100801 + 100829: 8d 76 00 lea 0x0(%esi),%esi + +0010082c <_write_kb>: +} + +/** + * XXX + * + * I'm not even sure if we need the following functions yet, + * however they are here just in case. Leave them alone. + */ + +/** + * _write_kb() + * + */ +static void _write_kb(unsigned adr, unsigned d) +{ + 10082c: 55 push %ebp + 10082d: 89 e5 mov %esp,%ebp + 10082f: 57 push %edi + 100830: 56 push %esi + 100831: 53 push %ebx + 100832: 83 ec 0c sub $0xc,%esp + 100835: 8b 7d 08 mov 0x8(%ebp),%edi + 100838: 8b 75 0c mov 0xc(%ebp),%esi + unsigned long t; + unsigned s; + + for(t = 5000000L; t != 0; t--) + 10083b: bb 40 4b 4c 00 mov $0x4c4b40,%ebx + { + s = inportb(0x64); + 100840: 83 ec 0c sub $0xc,%esp + 100843: 6a 64 push $0x64 + 100845: e8 ca 47 00 00 call 105014 + + /** + * loop until 8042 input buffer is empty + */ + if((s & 0x02) == 0) + 10084a: 83 c4 10 add $0x10,%esp + 10084d: a8 02 test $0x2,%al + 10084f: 74 0b je 10085c <_write_kb+0x30> + 100851: 4b dec %ebx + 100852: 75 ec jne 100840 <_write_kb+0x14> + break; + } + + if(t != 0) + outportb(adr, d); +} + 100854: 8d 65 f4 lea 0xfffffff4(%ebp),%esp + 100857: 5b pop %ebx + 100858: 5e pop %esi + 100859: 5f pop %edi + 10085a: c9 leave + 10085b: c3 ret + 10085c: 85 db test %ebx,%ebx + 10085e: 74 f4 je 100854 <_write_kb+0x28> + 100860: 89 75 0c mov %esi,0xc(%ebp) + 100863: 89 7d 08 mov %edi,0x8(%ebp) + 100866: 8d 65 f4 lea 0xfffffff4(%ebp),%esp + 100869: 5b pop %ebx + 10086a: 5e pop %esi + 10086b: 5f pop %edi + 10086c: c9 leave + 10086d: e9 42 48 00 00 jmp 1050b4 + 100872: 89 f6 mov %esi,%esi + +00100874 <_translate_sc>: + +/** + * _kb_wait() + * + */ +static inline void _kb_wait(void) +{ + int i; + + for(i = 0; i < 0x1000000; i++) + if((inportb(0x64) & 0x02) == 0) + return; + + printk(0, "Keyboard timeout\n"); +} + +/** + * _kb_send() + * + */ +static inline void _kb_send(unsigned char c) +{ + _kb_wait(); + outportb(c, 0x64); +} + +/** + * _translate_sc() + * + * Translates a scancode from the keyboard + */ +unsigned _translate_sc(unsigned k) +{ + 100874: 55 push %ebp + 100875: 89 e5 mov %esp,%ebp + 100877: 83 ec 08 sub $0x8,%esp + 10087a: 8b 45 08 mov 0x8(%ebp),%eax + unsigned c; + static unsigned altk; + unsigned donefirst = 0; + + if(k == KEY_BKSPACE) + 10087d: 83 f8 0e cmp $0xe,%eax + 100880: 0f 84 f2 09 00 00 je 101278 <_translate_sc+0xa04> + { + if(numkeysbuffer - 1 < 0) + { + numkeysbuffer = 0; + return 0; + } + } + + switch(k) + 100886: 3d e0 00 00 00 cmp $0xe0,%eax + 10088b: 0f 87 d3 09 00 00 ja 101264 <_translate_sc+0x9f0> + 100891: ff 24 85 dc 54 10 00 jmp *0x1054dc(,%eax,4) + { + case 0xE0: + altk = 1; c = 0; donefirst = 1; break; + 100898: 31 d2 xor %edx,%edx + 10089a: c7 05 00 80 10 00 01 movl $0x1,0x108000 + 1008a1: 00 00 00 + case KEY_TILDA: /* ` or ~ */ + c = (keys[KEY_LSHIFT] || keys[KEY_RSHIFT]) ? 126 : 126; break; + case KEY_END: c = 0; if(keys[KEYP_NUMLCK] && altk == 0) c = 49; break; + case KEY_1: + c = (keys[KEY_LSHIFT] || keys[KEY_RSHIFT]) ? 33 : 49; break; + case KEY_DOWN: c = 0; if(keys[KEYP_NUMLCK] && altk == 0) c = 50; break; + case KEY_2: + c = (keys[KEY_LSHIFT] || keys[KEY_RSHIFT]) ? 64 : 50; break; + case KEY_PGDOWN: c = 0; if(keys[KEYP_NUMLCK] && altk == 0) c = 51; break; + case KEY_3: + c = (keys[KEY_LSHIFT] || keys[KEY_RSHIFT]) ? 35 : 51; break; + case KEY_LEFT: c = 0; if(keys[KEYP_NUMLCK] && altk == 0) c = 52; break; + case KEY_4: + c = (keys[KEY_LSHIFT] || keys[KEY_RSHIFT]) ? 36 : 52; break; + case KEYP_5: c = 0; if(keys[KEYP_NUMLCK] && altk == 0) c = 53; break; + case KEY_5: + c = (keys[KEY_LSHIFT] || keys[KEY_RSHIFT]) ? 35 : 53; break; + case KEY_RIGHT: c = 0; if(keys[KEYP_NUMLCK] && altk == 0) c = 54; break; + case KEY_6: + c = (keys[KEY_LSHIFT] || keys[KEY_RSHIFT]) ? 94 : 54; break; + case KEY_HOME: c = 0; if(keys[KEYP_NUMLCK] && altk == 0) c = 55; break; + case KEY_7: + c = (keys[KEY_LSHIFT] || keys[KEY_RSHIFT]) ? 38 : 55; break; + case KEY_UP: c = 0; if(keys[KEYP_NUMLCK] && altk == 0) c = 56; break; + case KEYP_ASTERISK: c = 42; break; + case KEY_8: + c = (keys[KEY_LSHIFT] || keys[KEY_RSHIFT]) ? 42 : 56; break; + case KEY_PGUP: c = 0; if(keys[KEYP_NUMLCK] && altk == 0) c = 57; break; + case KEY_9: + c = (keys[KEY_LSHIFT] || keys[KEY_RSHIFT]) ? 40 : 57; break; + case KEY_INSERT: c = 0; if(keys[KEYP_NUMLCK] && altk == 0) c = 48; break; + case KEY_0: + c = (keys[KEY_LSHIFT] || keys[KEY_RSHIFT]) ? 41 : 48; break; + case KEYP_MINUS: c = 45; break; + case KEY_MINUS: + c = (keys[KEY_LSHIFT] || keys[KEY_RSHIFT]) ? 95 : 45; break; + case KEYP_PLUS: c = 43; break; + case KEY_PLUS: + c = (keys[KEY_LSHIFT] || keys[KEY_RSHIFT]) ? 61 : 43; break; + case KEY_BKSLASH: + c = (keys[KEY_LSHIFT] || keys[KEY_RSHIFT]) ? 124 : 92; break; + case KEY_Q: + c = (keys[KEY_LSHIFT] || keys[KEY_RSHIFT]) ? 81 : 113; break; + case KEY_W: + c = (keys[KEY_LSHIFT] || keys[KEY_RSHIFT]) ? 87 : 119; break; + case KEY_E: + c = (keys[KEY_LSHIFT] || keys[KEY_RSHIFT]) ? 69 : 101; break; + case KEY_R: + c = (keys[KEY_LSHIFT] || keys[KEY_RSHIFT]) ? 82 : 114; break; + case KEY_T: + c = (keys[KEY_LSHIFT] || keys[KEY_RSHIFT]) ? 84 : 116; break; + case KEY_Y: + c = (keys[KEY_LSHIFT] || keys[KEY_RSHIFT]) ? 89 : 121; break; + case KEY_U: + c = (keys[KEY_LSHIFT] || keys[KEY_RSHIFT]) ? 85 : 117; break; + case KEY_I: + c = (keys[KEY_LSHIFT] || keys[KEY_RSHIFT]) ? 73 : 105; break; + case KEY_O: + c = (keys[KEY_LSHIFT] || keys[KEY_RSHIFT]) ? 79 : 111; break; + case KEY_P: + c = (keys[KEY_LSHIFT] || keys[KEY_RSHIFT]) ? 80 : 112; break; + case KEY_LBRACKET: + c = (keys[KEY_LSHIFT] || keys[KEY_RSHIFT]) ? 123 : 91; break; + case KEY_RBRACKET: + c = (keys[KEY_LSHIFT] || keys[KEY_RSHIFT]) ? 125 : 93; break; + case KEY_ENTER: + c = (keys[KEY_LSHIFT] || keys[KEY_RSHIFT]) ? 10 : 10; break; + case KEY_A: + c = (keys[KEY_LSHIFT] || keys[KEY_RSHIFT]) ? 65 : 97; break; + case KEY_S: + c = (keys[KEY_LSHIFT] || keys[KEY_RSHIFT]) ? 83 : 115; break; + case KEY_D: + c = (keys[KEY_LSHIFT] || keys[KEY_RSHIFT]) ? 68 : 100; break; + case KEY_F: + c = (keys[KEY_LSHIFT] || keys[KEY_RSHIFT]) ? 70 : 102; break; + case KEY_G: + c = (keys[KEY_LSHIFT] || keys[KEY_RSHIFT]) ? 71 : 103; break; + case KEY_H: + c = (keys[KEY_LSHIFT] || keys[KEY_RSHIFT]) ? 72 : 104; break; + case KEY_J: + c = (keys[KEY_LSHIFT] || keys[KEY_RSHIFT]) ? 74 : 106; break; + case KEY_K: + c = (keys[KEY_LSHIFT] || keys[KEY_RSHIFT]) ? 75 : 107; break; + case KEY_L: + c = (keys[KEY_LSHIFT] || keys[KEY_RSHIFT]) ? 76 : 108; break; + case KEY_SEMICOLON: + c = (keys[KEY_LSHIFT] || keys[KEY_RSHIFT]) ? 58 : 59; break; + case KEY_QUOTE: + c = (keys[KEY_LSHIFT] || keys[KEY_RSHIFT]) ? 34 : 39; break; + case KEY_Z: + c = (keys[KEY_LSHIFT] || keys[KEY_RSHIFT]) ? 90 : 122; break; + case KEY_X: + c = (keys[KEY_LSHIFT] || keys[KEY_RSHIFT]) ? 88 : 120; break; + case KEY_C: + c = (keys[KEY_LSHIFT] || keys[KEY_RSHIFT]) ? 67 : 99; break; + case KEY_V: + c = (keys[KEY_LSHIFT] || keys[KEY_RSHIFT]) ? 86 : 118; break; + case KEY_B: + c = (keys[KEY_LSHIFT] || keys[KEY_RSHIFT]) ? 66 : 98; break; + case KEY_N: + c = (keys[KEY_LSHIFT] || keys[KEY_RSHIFT]) ? 78 : 110; break; + case KEY_M: + c = (keys[KEY_LSHIFT] || keys[KEY_RSHIFT]) ? 77 : 109; break; + case KEY_COMMA: + c = (keys[KEY_LSHIFT] || keys[KEY_RSHIFT]) ? 60 : 44; break; + case KEY_DEL: c = 0; if(keys[KEYP_NUMLCK] && altk == 0) c = 46; break; + case KEY_PERIOD: + c = (keys[KEY_LSHIFT] || keys[KEY_RSHIFT]) ? 62 : 46; break; + case KEY_SLASH: + c = (keys[KEY_LSHIFT] || keys[KEY_RSHIFT]) ? 63 : 47; break; + case KEY_SPACE: + c = (keys[KEY_LSHIFT] || keys[KEY_RSHIFT]) ? 32 : 32; break; + case KEY_BKSPACE: c = '\b'; break; /* just for now */ + default: + c = 0; + } + + if(donefirst == 0) + altk = 0; + + if(keys[KEY_CAPS]) + 1008a4: a1 28 84 10 00 mov 0x108428,%eax + 1008a9: 85 c0 test %eax,%eax + 1008ab: 74 23 je 1008d0 <_translate_sc+0x5c> + { + if(keys[KEY_LSHIFT] || keys[KEY_RSHIFT]) + 1008ad: a1 e8 83 10 00 mov 0x1083e8,%eax + 1008b2: 85 c0 test %eax,%eax + 1008b4: 75 0d jne 1008c3 <_translate_sc+0x4f> + 1008b6: a1 18 84 10 00 mov 0x108418,%eax + 1008bb: 85 c0 test %eax,%eax + 1008bd: 0f 84 bd 00 00 00 je 100980 <_translate_sc+0x10c> + { + if(c >= 'A' && c <= 'Z') + 1008c3: 8d 42 bf lea 0xffffffbf(%edx),%eax + 1008c6: 83 f8 19 cmp $0x19,%eax + 1008c9: 77 05 ja 1008d0 <_translate_sc+0x5c> + c += 32; + 1008cb: 83 c2 20 add $0x20,%edx + 1008ce: 89 f6 mov %esi,%esi + } + else + { + if(c >= 'a' && c <= 'z') + c -= 32; + } + } + + /** + * Simple shell for now + */ + if(c != 0 && c != '\n' && c != '\b') + 1008d0: 85 d2 test %edx,%edx + 1008d2: 74 38 je 10090c <_translate_sc+0x98> + 1008d4: 83 fa 0a cmp $0xa,%edx + 1008d7: 74 63 je 10093c <_translate_sc+0xc8> + 1008d9: 83 fa 08 cmp $0x8,%edx + 1008dc: 74 2e je 10090c <_translate_sc+0x98> + { + if((numkeysbuffer - 1) == KBD_BUF_SIZE) + 1008de: a1 40 85 10 00 mov 0x108540,%eax + 1008e3: 83 f8 41 cmp $0x41,%eax + 1008e6: 74 10 je 1008f8 <_translate_sc+0x84> + { + numkeysbuffer = 0; + szInBuf[0] = '\0'; + + szInBuf[numkeysbuffer] = c; + numkeysbuffer++; + } + else + { + szInBuf[numkeysbuffer] = c; + 1008e8: 88 90 60 85 10 00 mov %dl,0x108560(%eax) + numkeysbuffer++; + 1008ee: 40 inc %eax + 1008ef: a3 40 85 10 00 mov %eax,0x108540 + } + } + else if(c == '\n') + { + printf("\n"); + /** + * Make it a real string + */ + szInBuf[numkeysbuffer] = '\0'; + + /** + * Process command + */ + processCommand(&szInBuf[0], numkeysbuffer - 1); + + /** + * Clear buffer + */ + numkeysbuffer = 0; + szInBuf[0] = '\0'; + + /** + * Print "line" + */ + printf("$ "); + + c = 0; + } + else if(c == '\b') + { + szInBuf[numkeysbuffer] = '\0'; + numkeysbuffer--; + printf("\b \b"); + + c = 0; + } + + return c; + 1008f4: 89 d0 mov %edx,%eax +} + 1008f6: c9 leave + 1008f7: c3 ret + 1008f8: 88 15 60 85 10 00 mov %dl,0x108560 + 1008fe: c7 05 40 85 10 00 01 movl $0x1,0x108540 + 100905: 00 00 00 + 100908: eb ea jmp 1008f4 <_translate_sc+0x80> + 10090a: 89 f6 mov %esi,%esi + 10090c: 83 fa 0a cmp $0xa,%edx + 10090f: 74 2b je 10093c <_translate_sc+0xc8> + 100911: 83 fa 08 cmp $0x8,%edx + 100914: 75 de jne 1008f4 <_translate_sc+0x80> + 100916: a1 40 85 10 00 mov 0x108540,%eax + 10091b: c6 80 60 85 10 00 00 movb $0x0,0x108560(%eax) + 100922: 83 ec 0c sub $0xc,%esp + 100925: 48 dec %eax + 100926: a3 40 85 10 00 mov %eax,0x108540 + 10092b: 68 d2 54 10 00 push $0x1054d2 + 100930: e8 9f 47 00 00 call 1050d4 + 100935: 31 d2 xor %edx,%edx + 100937: 83 c4 10 add $0x10,%esp + 10093a: eb b8 jmp 1008f4 <_translate_sc+0x80> + 10093c: 83 ec 0c sub $0xc,%esp + 10093f: 68 f8 5a 10 00 push $0x105af8 + 100944: e8 8b 47 00 00 call 1050d4 + 100949: a1 40 85 10 00 mov 0x108540,%eax + 10094e: 5a pop %edx + 10094f: 59 pop %ecx + 100950: c6 80 60 85 10 00 00 movb $0x0,0x108560(%eax) + 100957: 48 dec %eax + 100958: 50 push %eax + 100959: 68 60 85 10 00 push $0x108560 + 10095e: e8 e9 fc ff ff call 10064c + 100963: c7 05 40 85 10 00 00 movl $0x0,0x108540 + 10096a: 00 00 00 + 10096d: c6 05 60 85 10 00 00 movb $0x0,0x108560 + 100974: c7 04 24 d6 54 10 00 movl $0x1054d6,(%esp,1) + 10097b: eb b3 jmp 100930 <_translate_sc+0xbc> + 10097d: 8d 76 00 lea 0x0(%esi),%esi + 100980: 8d 42 9f lea 0xffffff9f(%edx),%eax + 100983: 83 f8 19 cmp $0x19,%eax + 100986: 0f 87 44 ff ff ff ja 1008d0 <_translate_sc+0x5c> + 10098c: 83 ea 20 sub $0x20,%edx + 10098f: e9 3c ff ff ff jmp 1008d0 <_translate_sc+0x5c> + 100994: a1 e8 83 10 00 mov 0x1083e8,%eax + 100999: 85 c0 test %eax,%eax + 10099b: 75 09 jne 1009a6 <_translate_sc+0x132> + 10099d: a1 18 84 10 00 mov 0x108418,%eax + 1009a2: 85 c0 test %eax,%eax + 1009a4: 74 15 je 1009bb <_translate_sc+0x147> + 1009a6: ba 21 00 00 00 mov $0x21,%edx + 1009ab: 90 nop + 1009ac: c7 05 00 80 10 00 00 movl $0x0,0x108000 + 1009b3: 00 00 00 + 1009b6: e9 e9 fe ff ff jmp 1008a4 <_translate_sc+0x30> + 1009bb: ba 31 00 00 00 mov $0x31,%edx + 1009c0: eb ea jmp 1009ac <_translate_sc+0x138> + 1009c2: 8b 15 e8 83 10 00 mov 0x1083e8,%edx + 1009c8: 85 d2 test %edx,%edx + 1009ca: 75 09 jne 1009d5 <_translate_sc+0x161> + 1009cc: a1 18 84 10 00 mov 0x108418,%eax + 1009d1: 85 c0 test %eax,%eax + 1009d3: 74 07 je 1009dc <_translate_sc+0x168> + 1009d5: ba 40 00 00 00 mov $0x40,%edx + 1009da: eb d0 jmp 1009ac <_translate_sc+0x138> + 1009dc: ba 32 00 00 00 mov $0x32,%edx + 1009e1: eb c9 jmp 1009ac <_translate_sc+0x138> + 1009e3: a1 e8 83 10 00 mov 0x1083e8,%eax + 1009e8: 85 c0 test %eax,%eax + 1009ea: 75 09 jne 1009f5 <_translate_sc+0x181> + 1009ec: a1 18 84 10 00 mov 0x108418,%eax + 1009f1: 85 c0 test %eax,%eax + 1009f3: 74 07 je 1009fc <_translate_sc+0x188> + 1009f5: ba 23 00 00 00 mov $0x23,%edx + 1009fa: eb b0 jmp 1009ac <_translate_sc+0x138> + 1009fc: ba 33 00 00 00 mov $0x33,%edx + 100a01: eb a9 jmp 1009ac <_translate_sc+0x138> + 100a03: 8b 15 e8 83 10 00 mov 0x1083e8,%edx + 100a09: 85 d2 test %edx,%edx + 100a0b: 75 09 jne 100a16 <_translate_sc+0x1a2> + 100a0d: a1 18 84 10 00 mov 0x108418,%eax + 100a12: 85 c0 test %eax,%eax + 100a14: 74 07 je 100a1d <_translate_sc+0x1a9> + 100a16: ba 24 00 00 00 mov $0x24,%edx + 100a1b: eb 8f jmp 1009ac <_translate_sc+0x138> + 100a1d: ba 34 00 00 00 mov $0x34,%edx + 100a22: eb 88 jmp 1009ac <_translate_sc+0x138> + 100a24: a1 e8 83 10 00 mov 0x1083e8,%eax + 100a29: 85 c0 test %eax,%eax + 100a2b: 75 09 jne 100a36 <_translate_sc+0x1c2> + 100a2d: a1 18 84 10 00 mov 0x108418,%eax + 100a32: 85 c0 test %eax,%eax + 100a34: 74 0a je 100a40 <_translate_sc+0x1cc> + 100a36: ba 23 00 00 00 mov $0x23,%edx + 100a3b: e9 6c ff ff ff jmp 1009ac <_translate_sc+0x138> + 100a40: ba 35 00 00 00 mov $0x35,%edx + 100a45: e9 62 ff ff ff jmp 1009ac <_translate_sc+0x138> + 100a4a: 8b 15 e8 83 10 00 mov 0x1083e8,%edx + 100a50: 85 d2 test %edx,%edx + 100a52: 75 09 jne 100a5d <_translate_sc+0x1e9> + 100a54: a1 18 84 10 00 mov 0x108418,%eax + 100a59: 85 c0 test %eax,%eax + 100a5b: 74 0a je 100a67 <_translate_sc+0x1f3> + 100a5d: ba 5e 00 00 00 mov $0x5e,%edx + 100a62: e9 45 ff ff ff jmp 1009ac <_translate_sc+0x138> + 100a67: ba 36 00 00 00 mov $0x36,%edx + 100a6c: e9 3b ff ff ff jmp 1009ac <_translate_sc+0x138> + 100a71: a1 e8 83 10 00 mov 0x1083e8,%eax + 100a76: 85 c0 test %eax,%eax + 100a78: 75 09 jne 100a83 <_translate_sc+0x20f> + 100a7a: a1 18 84 10 00 mov 0x108418,%eax + 100a7f: 85 c0 test %eax,%eax + 100a81: 74 0a je 100a8d <_translate_sc+0x219> + 100a83: ba 26 00 00 00 mov $0x26,%edx + 100a88: e9 1f ff ff ff jmp 1009ac <_translate_sc+0x138> + 100a8d: ba 37 00 00 00 mov $0x37,%edx + 100a92: e9 15 ff ff ff jmp 1009ac <_translate_sc+0x138> + 100a97: 8b 15 e8 83 10 00 mov 0x1083e8,%edx + 100a9d: 85 d2 test %edx,%edx + 100a9f: 75 09 jne 100aaa <_translate_sc+0x236> + 100aa1: a1 18 84 10 00 mov 0x108418,%eax + 100aa6: 85 c0 test %eax,%eax + 100aa8: 74 0a je 100ab4 <_translate_sc+0x240> + 100aaa: ba 2a 00 00 00 mov $0x2a,%edx + 100aaf: e9 f8 fe ff ff jmp 1009ac <_translate_sc+0x138> + 100ab4: ba 38 00 00 00 mov $0x38,%edx + 100ab9: e9 ee fe ff ff jmp 1009ac <_translate_sc+0x138> + 100abe: a1 e8 83 10 00 mov 0x1083e8,%eax + 100ac3: 85 c0 test %eax,%eax + 100ac5: 75 09 jne 100ad0 <_translate_sc+0x25c> + 100ac7: a1 18 84 10 00 mov 0x108418,%eax + 100acc: 85 c0 test %eax,%eax + 100ace: 74 0a je 100ada <_translate_sc+0x266> + 100ad0: ba 28 00 00 00 mov $0x28,%edx + 100ad5: e9 d2 fe ff ff jmp 1009ac <_translate_sc+0x138> + 100ada: ba 39 00 00 00 mov $0x39,%edx + 100adf: e9 c8 fe ff ff jmp 1009ac <_translate_sc+0x138> + 100ae4: 8b 15 e8 83 10 00 mov 0x1083e8,%edx + 100aea: 85 d2 test %edx,%edx + 100aec: 75 09 jne 100af7 <_translate_sc+0x283> + 100aee: a1 18 84 10 00 mov 0x108418,%eax + 100af3: 85 c0 test %eax,%eax + 100af5: 74 0a je 100b01 <_translate_sc+0x28d> + 100af7: ba 29 00 00 00 mov $0x29,%edx + 100afc: e9 ab fe ff ff jmp 1009ac <_translate_sc+0x138> + 100b01: ba 30 00 00 00 mov $0x30,%edx + 100b06: e9 a1 fe ff ff jmp 1009ac <_translate_sc+0x138> + 100b0b: a1 e8 83 10 00 mov 0x1083e8,%eax + 100b10: 85 c0 test %eax,%eax + 100b12: 75 09 jne 100b1d <_translate_sc+0x2a9> + 100b14: a1 18 84 10 00 mov 0x108418,%eax + 100b19: 85 c0 test %eax,%eax + 100b1b: 74 0a je 100b27 <_translate_sc+0x2b3> + 100b1d: ba 5f 00 00 00 mov $0x5f,%edx + 100b22: e9 85 fe ff ff jmp 1009ac <_translate_sc+0x138> + 100b27: ba 2d 00 00 00 mov $0x2d,%edx + 100b2c: e9 7b fe ff ff jmp 1009ac <_translate_sc+0x138> + 100b31: a1 e8 83 10 00 mov 0x1083e8,%eax + 100b36: 85 c0 test %eax,%eax + 100b38: 75 09 jne 100b43 <_translate_sc+0x2cf> + 100b3a: a1 18 84 10 00 mov 0x108418,%eax + 100b3f: 85 c0 test %eax,%eax + 100b41: 74 0a je 100b4d <_translate_sc+0x2d9> + 100b43: ba 3d 00 00 00 mov $0x3d,%edx + 100b48: e9 5f fe ff ff jmp 1009ac <_translate_sc+0x138> + 100b4d: ba 2b 00 00 00 mov $0x2b,%edx + 100b52: e9 55 fe ff ff jmp 1009ac <_translate_sc+0x138> + 100b57: ba 08 00 00 00 mov $0x8,%edx + 100b5c: e9 4b fe ff ff jmp 1009ac <_translate_sc+0x138> + 100b61: 8b 15 e8 83 10 00 mov 0x1083e8,%edx + 100b67: 85 d2 test %edx,%edx + 100b69: 75 09 jne 100b74 <_translate_sc+0x300> + 100b6b: a1 18 84 10 00 mov 0x108418,%eax + 100b70: 85 c0 test %eax,%eax + 100b72: 74 0a je 100b7e <_translate_sc+0x30a> + 100b74: ba 51 00 00 00 mov $0x51,%edx + 100b79: e9 2e fe ff ff jmp 1009ac <_translate_sc+0x138> + 100b7e: ba 71 00 00 00 mov $0x71,%edx + 100b83: e9 24 fe ff ff jmp 1009ac <_translate_sc+0x138> + 100b88: a1 e8 83 10 00 mov 0x1083e8,%eax + 100b8d: 85 c0 test %eax,%eax + 100b8f: 75 09 jne 100b9a <_translate_sc+0x326> + 100b91: a1 18 84 10 00 mov 0x108418,%eax + 100b96: 85 c0 test %eax,%eax + 100b98: 74 0a je 100ba4 <_translate_sc+0x330> + 100b9a: ba 57 00 00 00 mov $0x57,%edx + 100b9f: e9 08 fe ff ff jmp 1009ac <_translate_sc+0x138> + 100ba4: ba 77 00 00 00 mov $0x77,%edx + 100ba9: e9 fe fd ff ff jmp 1009ac <_translate_sc+0x138> + 100bae: a1 e8 83 10 00 mov 0x1083e8,%eax + 100bb3: 85 c0 test %eax,%eax + 100bb5: 75 09 jne 100bc0 <_translate_sc+0x34c> + 100bb7: a1 18 84 10 00 mov 0x108418,%eax + 100bbc: 85 c0 test %eax,%eax + 100bbe: 74 0a je 100bca <_translate_sc+0x356> + 100bc0: ba 45 00 00 00 mov $0x45,%edx + 100bc5: e9 e2 fd ff ff jmp 1009ac <_translate_sc+0x138> + 100bca: ba 65 00 00 00 mov $0x65,%edx + 100bcf: e9 d8 fd ff ff jmp 1009ac <_translate_sc+0x138> + 100bd4: a1 e8 83 10 00 mov 0x1083e8,%eax + 100bd9: 85 c0 test %eax,%eax + 100bdb: 75 0a jne 100be7 <_translate_sc+0x373> + 100bdd: 8b 0d 18 84 10 00 mov 0x108418,%ecx + 100be3: 85 c9 test %ecx,%ecx + 100be5: 74 0a je 100bf1 <_translate_sc+0x37d> + 100be7: ba 52 00 00 00 mov $0x52,%edx + 100bec: e9 bb fd ff ff jmp 1009ac <_translate_sc+0x138> + 100bf1: ba 72 00 00 00 mov $0x72,%edx + 100bf6: e9 b1 fd ff ff jmp 1009ac <_translate_sc+0x138> + 100bfb: 8b 15 e8 83 10 00 mov 0x1083e8,%edx + 100c01: 85 d2 test %edx,%edx + 100c03: 75 09 jne 100c0e <_translate_sc+0x39a> + 100c05: a1 18 84 10 00 mov 0x108418,%eax + 100c0a: 85 c0 test %eax,%eax + 100c0c: 74 0a je 100c18 <_translate_sc+0x3a4> + 100c0e: ba 54 00 00 00 mov $0x54,%edx + 100c13: e9 94 fd ff ff jmp 1009ac <_translate_sc+0x138> + 100c18: ba 74 00 00 00 mov $0x74,%edx + 100c1d: e9 8a fd ff ff jmp 1009ac <_translate_sc+0x138> + 100c22: a1 e8 83 10 00 mov 0x1083e8,%eax + 100c27: 85 c0 test %eax,%eax + 100c29: 75 09 jne 100c34 <_translate_sc+0x3c0> + 100c2b: a1 18 84 10 00 mov 0x108418,%eax + 100c30: 85 c0 test %eax,%eax + 100c32: 74 0a je 100c3e <_translate_sc+0x3ca> + 100c34: ba 59 00 00 00 mov $0x59,%edx + 100c39: e9 6e fd ff ff jmp 1009ac <_translate_sc+0x138> + 100c3e: ba 79 00 00 00 mov $0x79,%edx + 100c43: e9 64 fd ff ff jmp 1009ac <_translate_sc+0x138> + 100c48: a1 e8 83 10 00 mov 0x1083e8,%eax + 100c4d: 85 c0 test %eax,%eax + 100c4f: 75 09 jne 100c5a <_translate_sc+0x3e6> + 100c51: a1 18 84 10 00 mov 0x108418,%eax + 100c56: 85 c0 test %eax,%eax + 100c58: 74 0a je 100c64 <_translate_sc+0x3f0> + 100c5a: ba 55 00 00 00 mov $0x55,%edx + 100c5f: e9 48 fd ff ff jmp 1009ac <_translate_sc+0x138> + 100c64: ba 75 00 00 00 mov $0x75,%edx + 100c69: e9 3e fd ff ff jmp 1009ac <_translate_sc+0x138> + 100c6e: a1 e8 83 10 00 mov 0x1083e8,%eax + 100c73: 85 c0 test %eax,%eax + 100c75: 75 0a jne 100c81 <_translate_sc+0x40d> + 100c77: 8b 0d 18 84 10 00 mov 0x108418,%ecx + 100c7d: 85 c9 test %ecx,%ecx + 100c7f: 74 0a je 100c8b <_translate_sc+0x417> + 100c81: ba 49 00 00 00 mov $0x49,%edx + 100c86: e9 21 fd ff ff jmp 1009ac <_translate_sc+0x138> + 100c8b: ba 69 00 00 00 mov $0x69,%edx + 100c90: e9 17 fd ff ff jmp 1009ac <_translate_sc+0x138> + 100c95: 8b 15 e8 83 10 00 mov 0x1083e8,%edx + 100c9b: 85 d2 test %edx,%edx + 100c9d: 75 09 jne 100ca8 <_translate_sc+0x434> + 100c9f: a1 18 84 10 00 mov 0x108418,%eax + 100ca4: 85 c0 test %eax,%eax + 100ca6: 74 0a je 100cb2 <_translate_sc+0x43e> + 100ca8: ba 4f 00 00 00 mov $0x4f,%edx + 100cad: e9 fa fc ff ff jmp 1009ac <_translate_sc+0x138> + 100cb2: ba 6f 00 00 00 mov $0x6f,%edx + 100cb7: e9 f0 fc ff ff jmp 1009ac <_translate_sc+0x138> + 100cbc: a1 e8 83 10 00 mov 0x1083e8,%eax + 100cc1: 85 c0 test %eax,%eax + 100cc3: 75 09 jne 100cce <_translate_sc+0x45a> + 100cc5: a1 18 84 10 00 mov 0x108418,%eax + 100cca: 85 c0 test %eax,%eax + 100ccc: 74 0a je 100cd8 <_translate_sc+0x464> + 100cce: ba 50 00 00 00 mov $0x50,%edx + 100cd3: e9 d4 fc ff ff jmp 1009ac <_translate_sc+0x138> + 100cd8: ba 70 00 00 00 mov $0x70,%edx + 100cdd: e9 ca fc ff ff jmp 1009ac <_translate_sc+0x138> + 100ce2: a1 e8 83 10 00 mov 0x1083e8,%eax + 100ce7: 85 c0 test %eax,%eax + 100ce9: 75 09 jne 100cf4 <_translate_sc+0x480> + 100ceb: a1 18 84 10 00 mov 0x108418,%eax + 100cf0: 85 c0 test %eax,%eax + 100cf2: 74 0a je 100cfe <_translate_sc+0x48a> + 100cf4: ba 7b 00 00 00 mov $0x7b,%edx + 100cf9: e9 ae fc ff ff jmp 1009ac <_translate_sc+0x138> + 100cfe: ba 5b 00 00 00 mov $0x5b,%edx + 100d03: e9 a4 fc ff ff jmp 1009ac <_translate_sc+0x138> + 100d08: a1 e8 83 10 00 mov 0x1083e8,%eax + 100d0d: 85 c0 test %eax,%eax + 100d0f: 75 0a jne 100d1b <_translate_sc+0x4a7> + 100d11: 8b 0d 18 84 10 00 mov 0x108418,%ecx + 100d17: 85 c9 test %ecx,%ecx + 100d19: 74 0a je 100d25 <_translate_sc+0x4b1> + 100d1b: ba 7d 00 00 00 mov $0x7d,%edx + 100d20: e9 87 fc ff ff jmp 1009ac <_translate_sc+0x138> + 100d25: ba 5d 00 00 00 mov $0x5d,%edx + 100d2a: e9 7d fc ff ff jmp 1009ac <_translate_sc+0x138> + 100d2f: ba 0a 00 00 00 mov $0xa,%edx + 100d34: e9 73 fc ff ff jmp 1009ac <_translate_sc+0x138> + 100d39: 8b 15 e8 83 10 00 mov 0x1083e8,%edx + 100d3f: 85 d2 test %edx,%edx + 100d41: 75 09 jne 100d4c <_translate_sc+0x4d8> + 100d43: a1 18 84 10 00 mov 0x108418,%eax + 100d48: 85 c0 test %eax,%eax + 100d4a: 74 0a je 100d56 <_translate_sc+0x4e2> + 100d4c: ba 41 00 00 00 mov $0x41,%edx + 100d51: e9 56 fc ff ff jmp 1009ac <_translate_sc+0x138> + 100d56: ba 61 00 00 00 mov $0x61,%edx + 100d5b: e9 4c fc ff ff jmp 1009ac <_translate_sc+0x138> + 100d60: a1 e8 83 10 00 mov 0x1083e8,%eax + 100d65: 85 c0 test %eax,%eax + 100d67: 75 09 jne 100d72 <_translate_sc+0x4fe> + 100d69: a1 18 84 10 00 mov 0x108418,%eax + 100d6e: 85 c0 test %eax,%eax + 100d70: 74 0a je 100d7c <_translate_sc+0x508> + 100d72: ba 53 00 00 00 mov $0x53,%edx + 100d77: e9 30 fc ff ff jmp 1009ac <_translate_sc+0x138> + 100d7c: ba 73 00 00 00 mov $0x73,%edx + 100d81: e9 26 fc ff ff jmp 1009ac <_translate_sc+0x138> + 100d86: a1 e8 83 10 00 mov 0x1083e8,%eax + 100d8b: 85 c0 test %eax,%eax + 100d8d: 75 09 jne 100d98 <_translate_sc+0x524> + 100d8f: a1 18 84 10 00 mov 0x108418,%eax + 100d94: 85 c0 test %eax,%eax + 100d96: 74 0a je 100da2 <_translate_sc+0x52e> + 100d98: ba 44 00 00 00 mov $0x44,%edx + 100d9d: e9 0a fc ff ff jmp 1009ac <_translate_sc+0x138> + 100da2: ba 64 00 00 00 mov $0x64,%edx + 100da7: e9 00 fc ff ff jmp 1009ac <_translate_sc+0x138> + 100dac: a1 e8 83 10 00 mov 0x1083e8,%eax + 100db1: 85 c0 test %eax,%eax + 100db3: 75 0a jne 100dbf <_translate_sc+0x54b> + 100db5: 8b 0d 18 84 10 00 mov 0x108418,%ecx + 100dbb: 85 c9 test %ecx,%ecx + 100dbd: 74 0a je 100dc9 <_translate_sc+0x555> + 100dbf: ba 46 00 00 00 mov $0x46,%edx + 100dc4: e9 e3 fb ff ff jmp 1009ac <_translate_sc+0x138> + 100dc9: ba 66 00 00 00 mov $0x66,%edx + 100dce: e9 d9 fb ff ff jmp 1009ac <_translate_sc+0x138> + 100dd3: 8b 15 e8 83 10 00 mov 0x1083e8,%edx + 100dd9: 85 d2 test %edx,%edx + 100ddb: 75 09 jne 100de6 <_translate_sc+0x572> + 100ddd: a1 18 84 10 00 mov 0x108418,%eax + 100de2: 85 c0 test %eax,%eax + 100de4: 74 0a je 100df0 <_translate_sc+0x57c> + 100de6: ba 47 00 00 00 mov $0x47,%edx + 100deb: e9 bc fb ff ff jmp 1009ac <_translate_sc+0x138> + 100df0: ba 67 00 00 00 mov $0x67,%edx + 100df5: e9 b2 fb ff ff jmp 1009ac <_translate_sc+0x138> + 100dfa: a1 e8 83 10 00 mov 0x1083e8,%eax + 100dff: 85 c0 test %eax,%eax + 100e01: 75 09 jne 100e0c <_translate_sc+0x598> + 100e03: a1 18 84 10 00 mov 0x108418,%eax + 100e08: 85 c0 test %eax,%eax + 100e0a: 74 0a je 100e16 <_translate_sc+0x5a2> + 100e0c: ba 48 00 00 00 mov $0x48,%edx + 100e11: e9 96 fb ff ff jmp 1009ac <_translate_sc+0x138> + 100e16: ba 68 00 00 00 mov $0x68,%edx + 100e1b: e9 8c fb ff ff jmp 1009ac <_translate_sc+0x138> + 100e20: a1 e8 83 10 00 mov 0x1083e8,%eax + 100e25: 85 c0 test %eax,%eax + 100e27: 75 09 jne 100e32 <_translate_sc+0x5be> + 100e29: a1 18 84 10 00 mov 0x108418,%eax + 100e2e: 85 c0 test %eax,%eax + 100e30: 74 0a je 100e3c <_translate_sc+0x5c8> + 100e32: ba 4a 00 00 00 mov $0x4a,%edx + 100e37: e9 70 fb ff ff jmp 1009ac <_translate_sc+0x138> + 100e3c: ba 6a 00 00 00 mov $0x6a,%edx + 100e41: e9 66 fb ff ff jmp 1009ac <_translate_sc+0x138> + 100e46: a1 e8 83 10 00 mov 0x1083e8,%eax + 100e4b: 85 c0 test %eax,%eax + 100e4d: 75 0a jne 100e59 <_translate_sc+0x5e5> + 100e4f: 8b 0d 18 84 10 00 mov 0x108418,%ecx + 100e55: 85 c9 test %ecx,%ecx + 100e57: 74 0a je 100e63 <_translate_sc+0x5ef> + 100e59: ba 4b 00 00 00 mov $0x4b,%edx + 100e5e: e9 49 fb ff ff jmp 1009ac <_translate_sc+0x138> + 100e63: ba 6b 00 00 00 mov $0x6b,%edx + 100e68: e9 3f fb ff ff jmp 1009ac <_translate_sc+0x138> + 100e6d: 8b 15 e8 83 10 00 mov 0x1083e8,%edx + 100e73: 85 d2 test %edx,%edx + 100e75: 75 09 jne 100e80 <_translate_sc+0x60c> + 100e77: a1 18 84 10 00 mov 0x108418,%eax + 100e7c: 85 c0 test %eax,%eax + 100e7e: 74 0a je 100e8a <_translate_sc+0x616> + 100e80: ba 4c 00 00 00 mov $0x4c,%edx + 100e85: e9 22 fb ff ff jmp 1009ac <_translate_sc+0x138> + 100e8a: ba 6c 00 00 00 mov $0x6c,%edx + 100e8f: e9 18 fb ff ff jmp 1009ac <_translate_sc+0x138> + 100e94: a1 e8 83 10 00 mov 0x1083e8,%eax + 100e99: 85 c0 test %eax,%eax + 100e9b: 75 09 jne 100ea6 <_translate_sc+0x632> + 100e9d: a1 18 84 10 00 mov 0x108418,%eax + 100ea2: 85 c0 test %eax,%eax + 100ea4: 74 0a je 100eb0 <_translate_sc+0x63c> + 100ea6: ba 3a 00 00 00 mov $0x3a,%edx + 100eab: e9 fc fa ff ff jmp 1009ac <_translate_sc+0x138> + 100eb0: ba 3b 00 00 00 mov $0x3b,%edx + 100eb5: e9 f2 fa ff ff jmp 1009ac <_translate_sc+0x138> + 100eba: a1 e8 83 10 00 mov 0x1083e8,%eax + 100ebf: 85 c0 test %eax,%eax + 100ec1: 75 09 jne 100ecc <_translate_sc+0x658> + 100ec3: a1 18 84 10 00 mov 0x108418,%eax + 100ec8: 85 c0 test %eax,%eax + 100eca: 74 0a je 100ed6 <_translate_sc+0x662> + 100ecc: ba 22 00 00 00 mov $0x22,%edx + 100ed1: e9 d6 fa ff ff jmp 1009ac <_translate_sc+0x138> + 100ed6: ba 27 00 00 00 mov $0x27,%edx + 100edb: e9 cc fa ff ff jmp 1009ac <_translate_sc+0x138> + 100ee0: ba 7e 00 00 00 mov $0x7e,%edx + 100ee5: e9 c2 fa ff ff jmp 1009ac <_translate_sc+0x138> + 100eea: a1 e8 83 10 00 mov 0x1083e8,%eax + 100eef: 85 c0 test %eax,%eax + 100ef1: 75 0a jne 100efd <_translate_sc+0x689> + 100ef3: 8b 0d 18 84 10 00 mov 0x108418,%ecx + 100ef9: 85 c9 test %ecx,%ecx + 100efb: 74 0a je 100f07 <_translate_sc+0x693> + 100efd: ba 7c 00 00 00 mov $0x7c,%edx + 100f02: e9 a5 fa ff ff jmp 1009ac <_translate_sc+0x138> + 100f07: ba 5c 00 00 00 mov $0x5c,%edx + 100f0c: e9 9b fa ff ff jmp 1009ac <_translate_sc+0x138> + 100f11: a1 e8 83 10 00 mov 0x1083e8,%eax + 100f16: 85 c0 test %eax,%eax + 100f18: 75 0a jne 100f24 <_translate_sc+0x6b0> + 100f1a: 8b 0d 18 84 10 00 mov 0x108418,%ecx + 100f20: 85 c9 test %ecx,%ecx + 100f22: 74 0a je 100f2e <_translate_sc+0x6ba> + 100f24: ba 5a 00 00 00 mov $0x5a,%edx + 100f29: e9 7e fa ff ff jmp 1009ac <_translate_sc+0x138> + 100f2e: ba 7a 00 00 00 mov $0x7a,%edx + 100f33: e9 74 fa ff ff jmp 1009ac <_translate_sc+0x138> + 100f38: 8b 15 e8 83 10 00 mov 0x1083e8,%edx + 100f3e: 85 d2 test %edx,%edx + 100f40: 75 09 jne 100f4b <_translate_sc+0x6d7> + 100f42: a1 18 84 10 00 mov 0x108418,%eax + 100f47: 85 c0 test %eax,%eax + 100f49: 74 0a je 100f55 <_translate_sc+0x6e1> + 100f4b: ba 58 00 00 00 mov $0x58,%edx + 100f50: e9 57 fa ff ff jmp 1009ac <_translate_sc+0x138> + 100f55: ba 78 00 00 00 mov $0x78,%edx + 100f5a: e9 4d fa ff ff jmp 1009ac <_translate_sc+0x138> + 100f5f: a1 e8 83 10 00 mov 0x1083e8,%eax + 100f64: 85 c0 test %eax,%eax + 100f66: 75 09 jne 100f71 <_translate_sc+0x6fd> + 100f68: a1 18 84 10 00 mov 0x108418,%eax + 100f6d: 85 c0 test %eax,%eax + 100f6f: 74 0a je 100f7b <_translate_sc+0x707> + 100f71: ba 43 00 00 00 mov $0x43,%edx + 100f76: e9 31 fa ff ff jmp 1009ac <_translate_sc+0x138> + 100f7b: ba 63 00 00 00 mov $0x63,%edx + 100f80: e9 27 fa ff ff jmp 1009ac <_translate_sc+0x138> + 100f85: a1 e8 83 10 00 mov 0x1083e8,%eax + 100f8a: 85 c0 test %eax,%eax + 100f8c: 75 09 jne 100f97 <_translate_sc+0x723> + 100f8e: a1 18 84 10 00 mov 0x108418,%eax + 100f93: 85 c0 test %eax,%eax + 100f95: 74 0a je 100fa1 <_translate_sc+0x72d> + 100f97: ba 56 00 00 00 mov $0x56,%edx + 100f9c: e9 0b fa ff ff jmp 1009ac <_translate_sc+0x138> + 100fa1: ba 76 00 00 00 mov $0x76,%edx + 100fa6: e9 01 fa ff ff jmp 1009ac <_translate_sc+0x138> + 100fab: a1 e8 83 10 00 mov 0x1083e8,%eax + 100fb0: 85 c0 test %eax,%eax + 100fb2: 75 0a jne 100fbe <_translate_sc+0x74a> + 100fb4: 8b 0d 18 84 10 00 mov 0x108418,%ecx + 100fba: 85 c9 test %ecx,%ecx + 100fbc: 74 0a je 100fc8 <_translate_sc+0x754> + 100fbe: ba 42 00 00 00 mov $0x42,%edx + 100fc3: e9 e4 f9 ff ff jmp 1009ac <_translate_sc+0x138> + 100fc8: ba 62 00 00 00 mov $0x62,%edx + 100fcd: e9 da f9 ff ff jmp 1009ac <_translate_sc+0x138> + 100fd2: 8b 15 e8 83 10 00 mov 0x1083e8,%edx + 100fd8: 85 d2 test %edx,%edx + 100fda: 75 09 jne 100fe5 <_translate_sc+0x771> + 100fdc: a1 18 84 10 00 mov 0x108418,%eax + 100fe1: 85 c0 test %eax,%eax + 100fe3: 74 0a je 100fef <_translate_sc+0x77b> + 100fe5: ba 4e 00 00 00 mov $0x4e,%edx + 100fea: e9 bd f9 ff ff jmp 1009ac <_translate_sc+0x138> + 100fef: ba 6e 00 00 00 mov $0x6e,%edx + 100ff4: e9 b3 f9 ff ff jmp 1009ac <_translate_sc+0x138> + 100ff9: a1 e8 83 10 00 mov 0x1083e8,%eax + 100ffe: 85 c0 test %eax,%eax + 101000: 75 09 jne 10100b <_translate_sc+0x797> + 101002: a1 18 84 10 00 mov 0x108418,%eax + 101007: 85 c0 test %eax,%eax + 101009: 74 0a je 101015 <_translate_sc+0x7a1> + 10100b: ba 4d 00 00 00 mov $0x4d,%edx + 101010: e9 97 f9 ff ff jmp 1009ac <_translate_sc+0x138> + 101015: ba 6d 00 00 00 mov $0x6d,%edx + 10101a: e9 8d f9 ff ff jmp 1009ac <_translate_sc+0x138> + 10101f: a1 e8 83 10 00 mov 0x1083e8,%eax + 101024: 85 c0 test %eax,%eax + 101026: 75 09 jne 101031 <_translate_sc+0x7bd> + 101028: a1 18 84 10 00 mov 0x108418,%eax + 10102d: 85 c0 test %eax,%eax + 10102f: 74 0a je 10103b <_translate_sc+0x7c7> + 101031: ba 3c 00 00 00 mov $0x3c,%edx + 101036: e9 71 f9 ff ff jmp 1009ac <_translate_sc+0x138> + 10103b: ba 2c 00 00 00 mov $0x2c,%edx + 101040: e9 67 f9 ff ff jmp 1009ac <_translate_sc+0x138> + 101045: 8b 15 e8 83 10 00 mov 0x1083e8,%edx + 10104b: 85 d2 test %edx,%edx + 10104d: 75 09 jne 101058 <_translate_sc+0x7e4> + 10104f: a1 18 84 10 00 mov 0x108418,%eax + 101054: 85 c0 test %eax,%eax + 101056: 74 0a je 101062 <_translate_sc+0x7ee> + 101058: ba 3e 00 00 00 mov $0x3e,%edx + 10105d: e9 4a f9 ff ff jmp 1009ac <_translate_sc+0x138> + 101062: ba 2e 00 00 00 mov $0x2e,%edx + 101067: e9 40 f9 ff ff jmp 1009ac <_translate_sc+0x138> + 10106c: a1 e8 83 10 00 mov 0x1083e8,%eax + 101071: 85 c0 test %eax,%eax + 101073: 75 09 jne 10107e <_translate_sc+0x80a> + 101075: a1 18 84 10 00 mov 0x108418,%eax + 10107a: 85 c0 test %eax,%eax + 10107c: 74 0a je 101088 <_translate_sc+0x814> + 10107e: ba 3f 00 00 00 mov $0x3f,%edx + 101083: e9 24 f9 ff ff jmp 1009ac <_translate_sc+0x138> + 101088: ba 2f 00 00 00 mov $0x2f,%edx + 10108d: e9 1a f9 ff ff jmp 1009ac <_translate_sc+0x138> + 101092: ba 2a 00 00 00 mov $0x2a,%edx + 101097: e9 10 f9 ff ff jmp 1009ac <_translate_sc+0x138> + 10109c: ba 20 00 00 00 mov $0x20,%edx + 1010a1: e9 06 f9 ff ff jmp 1009ac <_translate_sc+0x138> + 1010a6: a1 54 84 10 00 mov 0x108454,%eax + 1010ab: 31 d2 xor %edx,%edx + 1010ad: 85 c0 test %eax,%eax + 1010af: 0f 84 f7 f8 ff ff je 1009ac <_translate_sc+0x138> + 1010b5: a1 00 80 10 00 mov 0x108000,%eax + 1010ba: 85 c0 test %eax,%eax + 1010bc: 0f 85 ea f8 ff ff jne 1009ac <_translate_sc+0x138> + 1010c2: ba 37 00 00 00 mov $0x37,%edx + 1010c7: e9 e0 f8 ff ff jmp 1009ac <_translate_sc+0x138> + 1010cc: a1 54 84 10 00 mov 0x108454,%eax + 1010d1: 31 d2 xor %edx,%edx + 1010d3: 85 c0 test %eax,%eax + 1010d5: 0f 84 d1 f8 ff ff je 1009ac <_translate_sc+0x138> + 1010db: 8b 0d 00 80 10 00 mov 0x108000,%ecx + 1010e1: 85 c9 test %ecx,%ecx + 1010e3: 0f 85 c3 f8 ff ff jne 1009ac <_translate_sc+0x138> + 1010e9: ba 38 00 00 00 mov $0x38,%edx + 1010ee: e9 b9 f8 ff ff jmp 1009ac <_translate_sc+0x138> + 1010f3: a1 54 84 10 00 mov 0x108454,%eax + 1010f8: 31 d2 xor %edx,%edx + 1010fa: 85 c0 test %eax,%eax + 1010fc: 0f 84 aa f8 ff ff je 1009ac <_translate_sc+0x138> + 101102: a1 00 80 10 00 mov 0x108000,%eax + 101107: 85 c0 test %eax,%eax + 101109: 0f 85 9d f8 ff ff jne 1009ac <_translate_sc+0x138> + 10110f: ba 39 00 00 00 mov $0x39,%edx + 101114: e9 93 f8 ff ff jmp 1009ac <_translate_sc+0x138> + 101119: ba 2d 00 00 00 mov $0x2d,%edx + 10111e: e9 89 f8 ff ff jmp 1009ac <_translate_sc+0x138> + 101123: a1 54 84 10 00 mov 0x108454,%eax + 101128: 31 d2 xor %edx,%edx + 10112a: 85 c0 test %eax,%eax + 10112c: 0f 84 7a f8 ff ff je 1009ac <_translate_sc+0x138> + 101132: 8b 0d 00 80 10 00 mov 0x108000,%ecx + 101138: 85 c9 test %ecx,%ecx + 10113a: 0f 85 6c f8 ff ff jne 1009ac <_translate_sc+0x138> + 101140: ba 34 00 00 00 mov $0x34,%edx + 101145: e9 62 f8 ff ff jmp 1009ac <_translate_sc+0x138> + 10114a: a1 54 84 10 00 mov 0x108454,%eax + 10114f: 31 d2 xor %edx,%edx + 101151: 85 c0 test %eax,%eax + 101153: 0f 84 53 f8 ff ff je 1009ac <_translate_sc+0x138> + 101159: a1 00 80 10 00 mov 0x108000,%eax + 10115e: 85 c0 test %eax,%eax + 101160: 0f 85 46 f8 ff ff jne 1009ac <_translate_sc+0x138> + 101166: ba 35 00 00 00 mov $0x35,%edx + 10116b: e9 3c f8 ff ff jmp 1009ac <_translate_sc+0x138> + 101170: a1 54 84 10 00 mov 0x108454,%eax + 101175: 31 d2 xor %edx,%edx + 101177: 85 c0 test %eax,%eax + 101179: 0f 84 2d f8 ff ff je 1009ac <_translate_sc+0x138> + 10117f: 8b 0d 00 80 10 00 mov 0x108000,%ecx + 101185: 85 c9 test %ecx,%ecx + 101187: 0f 85 1f f8 ff ff jne 1009ac <_translate_sc+0x138> + 10118d: ba 36 00 00 00 mov $0x36,%edx + 101192: e9 15 f8 ff ff jmp 1009ac <_translate_sc+0x138> + 101197: ba 2b 00 00 00 mov $0x2b,%edx + 10119c: e9 0b f8 ff ff jmp 1009ac <_translate_sc+0x138> + 1011a1: a1 54 84 10 00 mov 0x108454,%eax + 1011a6: 31 d2 xor %edx,%edx + 1011a8: 85 c0 test %eax,%eax + 1011aa: 0f 84 fc f7 ff ff je 1009ac <_translate_sc+0x138> + 1011b0: a1 00 80 10 00 mov 0x108000,%eax + 1011b5: 85 c0 test %eax,%eax + 1011b7: 0f 85 ef f7 ff ff jne 1009ac <_translate_sc+0x138> + 1011bd: ba 31 00 00 00 mov $0x31,%edx + 1011c2: e9 e5 f7 ff ff jmp 1009ac <_translate_sc+0x138> + 1011c7: a1 54 84 10 00 mov 0x108454,%eax + 1011cc: 31 d2 xor %edx,%edx + 1011ce: 85 c0 test %eax,%eax + 1011d0: 0f 84 d6 f7 ff ff je 1009ac <_translate_sc+0x138> + 1011d6: 8b 0d 00 80 10 00 mov 0x108000,%ecx + 1011dc: 85 c9 test %ecx,%ecx + 1011de: 0f 85 c8 f7 ff ff jne 1009ac <_translate_sc+0x138> + 1011e4: ba 32 00 00 00 mov $0x32,%edx + 1011e9: e9 be f7 ff ff jmp 1009ac <_translate_sc+0x138> + 1011ee: a1 54 84 10 00 mov 0x108454,%eax + 1011f3: 31 d2 xor %edx,%edx + 1011f5: 85 c0 test %eax,%eax + 1011f7: 0f 84 af f7 ff ff je 1009ac <_translate_sc+0x138> + 1011fd: a1 00 80 10 00 mov 0x108000,%eax + 101202: 85 c0 test %eax,%eax + 101204: 0f 85 a2 f7 ff ff jne 1009ac <_translate_sc+0x138> + 10120a: ba 33 00 00 00 mov $0x33,%edx + 10120f: e9 98 f7 ff ff jmp 1009ac <_translate_sc+0x138> + 101214: a1 54 84 10 00 mov 0x108454,%eax + 101219: 31 d2 xor %edx,%edx + 10121b: 85 c0 test %eax,%eax + 10121d: 0f 84 89 f7 ff ff je 1009ac <_translate_sc+0x138> + 101223: 8b 0d 00 80 10 00 mov 0x108000,%ecx + 101229: 85 c9 test %ecx,%ecx + 10122b: 0f 85 7b f7 ff ff jne 1009ac <_translate_sc+0x138> + 101231: ba 30 00 00 00 mov $0x30,%edx + 101236: e9 71 f7 ff ff jmp 1009ac <_translate_sc+0x138> + 10123b: a1 54 84 10 00 mov 0x108454,%eax + 101240: 31 d2 xor %edx,%edx + 101242: 85 c0 test %eax,%eax + 101244: 0f 84 62 f7 ff ff je 1009ac <_translate_sc+0x138> + 10124a: 8b 0d 00 80 10 00 mov 0x108000,%ecx + 101250: 85 c9 test %ecx,%ecx + 101252: 0f 85 54 f7 ff ff jne 1009ac <_translate_sc+0x138> + 101258: ba 2e 00 00 00 mov $0x2e,%edx + 10125d: e9 4a f7 ff ff jmp 1009ac <_translate_sc+0x138> + 101262: 89 f6 mov %esi,%esi + 101264: 31 c0 xor %eax,%eax + 101266: 31 d2 xor %edx,%edx + 101268: 85 c0 test %eax,%eax + 10126a: 0f 85 34 f6 ff ff jne 1008a4 <_translate_sc+0x30> + 101270: e9 37 f7 ff ff jmp 1009ac <_translate_sc+0x138> + 101275: 8d 76 00 lea 0x0(%esi),%esi + 101278: 8b 15 40 85 10 00 mov 0x108540,%edx + 10127e: 4a dec %edx + 10127f: 0f 89 01 f6 ff ff jns 100886 <_translate_sc+0x12> + 101285: 31 c0 xor %eax,%eax + 101287: c7 05 40 85 10 00 00 movl $0x0,0x108540 + 10128e: 00 00 00 + 101291: e9 60 f6 ff ff jmp 1008f6 <_translate_sc+0x82> + 101296: 89 f6 mov %esi,%esi + +00101298 : + +/** + * handle_meta_key() + * + * I'll pretty this up later + */ +void handle_meta_key(unsigned k) +{ + 101298: 55 push %ebp + 101299: 89 e5 mov %esp,%ebp + 10129b: 83 ec 08 sub $0x8,%esp + int i; + k = k; /* to shut gcc up */ + + /** + * Check for the infamous three finger salute + */ + if((keys[KEY_RCTRL] || keys[KEY_LCTRL]) && + 10129e: 8b 15 b4 83 10 00 mov 0x1083b4,%edx + 1012a4: 85 d2 test %edx,%edx + 1012a6: 74 69 je 101311 + 1012a8: 8b 15 20 84 10 00 mov 0x108420,%edx + 1012ae: 85 d2 test %edx,%edx + 1012b0: 74 0a je 1012bc + 1012b2: a1 8c 84 10 00 mov 0x10848c,%eax + 1012b7: 85 c0 test %eax,%eax + 1012b9: 75 51 jne 10130c + 1012bb: 90 nop + (keys[KEY_RALT] || keys[KEY_LALT]) && + keys[KEY_DEL]) + { + /** + * FIXME + * + * This should call _send_signal() + */ + reboot(); + } + + /** + * Check for Alt + F1-F12 for virtual terminals + */ + for(i = 0; i < 10; i++) + 1012bc: 31 c0 xor %eax,%eax + 1012be: b9 40 83 10 00 mov $0x108340,%ecx + 1012c3: 90 nop + { + if((keys[KEY_LALT] || keys[KEY_RALT]) && keys[i + KEY_F1]) + 1012c4: 85 d2 test %edx,%edx + 1012c6: 74 0a je 1012d2 + 1012c8: 83 bc 81 ec 00 00 00 cmpl $0x0,0xec(%ecx,%eax,4) + 1012cf: 00 + 1012d0: 75 35 jne 101307 + 1012d2: 40 inc %eax + 1012d3: 83 f8 09 cmp $0x9,%eax + 1012d6: 7e ec jle 1012c4 + { + select_vc(i); + return; + } + } + + if((keys[KEY_LALT] || keys[KEY_RALT]) && keys[KEY_F11]) + 1012d8: 85 d2 test %edx,%edx + 1012da: 74 13 je 1012ef + 1012dc: 8b 15 9c 84 10 00 mov 0x10849c,%edx + 1012e2: 85 d2 test %edx,%edx + 1012e4: 75 18 jne 1012fe + { + select_vc(10); + return; + } + + if((keys[KEY_LALT] || keys[KEY_RALT]) && keys[KEY_F12]) + 1012e6: a1 a0 84 10 00 mov 0x1084a0,%eax + 1012eb: 85 c0 test %eax,%eax + 1012ed: 75 02 jne 1012f1 + { + select_vc(11); + return; + } +} + 1012ef: c9 leave + 1012f0: c3 ret + 1012f1: c7 45 08 0b 00 00 00 movl $0xb,0x8(%ebp) + 1012f8: c9 leave + 1012f9: e9 06 35 00 00 jmp 104804 + 1012fe: c7 45 08 0a 00 00 00 movl $0xa,0x8(%ebp) + 101305: eb f1 jmp 1012f8 + 101307: 89 45 08 mov %eax,0x8(%ebp) + 10130a: eb ec jmp 1012f8 + 10130c: e8 d3 f4 ff ff call 1007e4 + 101311: 8b 15 20 84 10 00 mov 0x108420,%edx + 101317: eb a3 jmp 1012bc + 101319: 8d 76 00 lea 0x0(%esi),%esi + +0010131c : + +/** + * keyboard_irq() + * + * Called when a keyboard interrupt is generated. + */ +void keyboard_irq(void) +{ + 10131c: 55 push %ebp + 10131d: 89 e5 mov %esp,%ebp + 10131f: 53 push %ebx + 101320: 83 ec 10 sub $0x10,%esp + register char a; + unsigned c; + unsigned short kbdstat; + + rawkey = inportb(0x60); + 101323: 6a 60 push $0x60 + 101325: e8 ea 3c 00 00 call 105014 + 10132a: a3 20 83 10 00 mov %eax,0x108320 + outportb(0x61, (a=inportb(0x61)|0x82)); + 10132f: c7 04 24 61 00 00 00 movl $0x61,(%esp,1) + 101336: e8 d9 3c 00 00 call 105014 + 10133b: 83 c8 82 or $0xffffff82,%eax + 10133e: 59 pop %ecx + 10133f: 5b pop %ebx + 101340: 0f be d8 movsbl %al,%ebx + 101343: 53 push %ebx + 101344: 6a 61 push $0x61 + 101346: e8 69 3d 00 00 call 1050b4 + outportb(0x61, a & 0x7F); + 10134b: 58 pop %eax + 10134c: 5a pop %edx + 10134d: 83 e3 7f and $0x7f,%ebx + 101350: 53 push %ebx + 101351: 6a 61 push $0x61 + 101353: e8 5c 3d 00 00 call 1050b4 + + /** + * If it's less than 0x80 then it's definatelly + * a make code or a repeat code + */ + if(rawkey < 0x80) + 101358: 8b 0d 20 83 10 00 mov 0x108320,%ecx + 10135e: 83 c4 10 add $0x10,%esp + 101361: 83 f9 7f cmp $0x7f,%ecx + 101364: 7f 6a jg 1013d0 + { + /** + * We don't want to gunk up the numlock key + * because we will define it's state in the + * break code a bit later + */ + if((rawkey != KEYP_NUMLCK) && (rawkey != KEY_SCRLCK) && (rawkey != KEY_CAPS)) + 101366: 8d 41 bb lea 0xffffffbb(%ecx),%eax + 101369: 83 f8 01 cmp $0x1,%eax + 10136c: 76 10 jbe 10137e + 10136e: 83 f9 3a cmp $0x3a,%ecx + 101371: 74 0b je 10137e + keys[rawkey] = 1; + 101373: c7 04 8d 40 83 10 00 movl $0x1,0x108340(,%ecx,4) + 10137a: 01 00 00 00 + + keyDown(rawkey); + 10137e: 83 ec 0c sub $0xc,%esp + 101381: ff 35 20 83 10 00 pushl 0x108320 + 101387: e8 c4 ee ff ff call 100250 + 10138c: 58 pop %eax + } + else /* rawkey >= 0x80 */ + { + if(rawkey == 0xE0) + { + /** + * It's either a make code, break code, or repeat code + */ + rawkey = inportb(0x60); + outportb(0x61, (a=inportb(0x61)|0x82)); + outportb(0x61, a & 0x7F); + + if(rawkey < 0x80) + { + /** + * Ok, it's a make code or repeat code for the numeric + * keypad (gray keys) + */ + + keys[rawkey] = 1; + + keyDown(rawkey); + } + else /* rawkey >= 0x80 */ + { + /** + * It's either a make code for the numeric keypad or + * a break code for the numeric keypad. + */ + if(rawkey == 0x2A) + { + /** + * Ok, we have a make code for the numeric keypad + * and NUMLOCK is on. The second byte is what we + * want since what we have so far is this: + * + * 0xE0 0x2A + */ + rawkey = inportb(0x60); + outportb(0x61, (a=inportb(0x61)|0x82)); + outportb(0x61, a & 0x7F); + + rawkey = inportb(0x60); + outportb(0x61, (a=inportb(0x61)|0x82)); + outportb(0x61, a & 0x7F); + + keys[rawkey] = 1; + + keyDown(rawkey); + } + else + { + /** + * It's a break code from the numeric keypad. + */ + keys[rawkey] = 0; + + keyUp(rawkey); + } + } + } + else /* rawkey != 0xE0 */ + { + /** + * It's a break code + * + * Make sure we toggle the numlock, scroll lock, and caps lock key. + */ + if(((rawkey - 0x80) == KEYP_NUMLCK) || + ((rawkey - 0x80) == KEY_SCRLCK) || + ((rawkey - 0x80) == KEY_CAPS)) + { + keys[rawkey - 0x80] = !keys[rawkey - 0x80]; + + kbdstat = 0; + if(keys[KEY_SCRLCK]) + kbdstat |= 1; + if(keys[KEYP_NUMLCK]) + kbdstat |= 2; + if(keys[KEY_CAPS]) + kbdstat |= 4; + + _write_kb(0x60, 0xED); + _write_kb(0x60, kbdstat); + outportb(0x20, 0x20); + + keyUp(rawkey); + return; + } + + keys[rawkey - 0x80] = 0; + + keyUp(rawkey); + } + } + + c = _translate_sc(rawkey); + 10138d: ff 35 20 83 10 00 pushl 0x108320 + 101393: e8 dc f4 ff ff call 100874 <_translate_sc> + + if(c != 0) + 101398: 83 c4 10 add $0x10,%esp + 10139b: 85 c0 test %eax,%eax + 10139d: 74 21 je 1013c0 + printf("%c", c); + 10139f: 83 ec 08 sub $0x8,%esp + 1013a2: 50 push %eax + 1013a3: 68 e5 51 10 00 push $0x1051e5 + 1013a8: e8 27 3d 00 00 call 1050d4 + 1013ad: 59 pop %ecx + 1013ae: 5b pop %ebx + else + { + /** + * We need to check for meta-key-crap here + */ + handle_meta_key(rawkey); + } + + //enable(); + outportb(0x20, 0x20); + 1013af: 6a 20 push $0x20 + 1013b1: 6a 20 push $0x20 + 1013b3: e8 fc 3c 00 00 call 1050b4 +} + 1013b8: 8b 5d fc mov 0xfffffffc(%ebp),%ebx + 1013bb: c9 leave + 1013bc: c3 ret + 1013bd: 8d 76 00 lea 0x0(%esi),%esi + 1013c0: 83 ec 0c sub $0xc,%esp + 1013c3: ff 35 20 83 10 00 pushl 0x108320 + 1013c9: e8 ca fe ff ff call 101298 + 1013ce: eb dd jmp 1013ad + 1013d0: 81 f9 e0 00 00 00 cmp $0xe0,%ecx + 1013d6: 0f 84 a5 00 00 00 je 101481 + 1013dc: 8d 81 3b ff ff ff lea 0xffffff3b(%ecx),%eax + 1013e2: 83 f8 01 cmp $0x1,%eax + 1013e5: 76 21 jbe 101408 + 1013e7: 81 f9 ba 00 00 00 cmp $0xba,%ecx + 1013ed: 74 19 je 101408 + 1013ef: 83 ec 0c sub $0xc,%esp + 1013f2: c7 04 8d 40 81 10 00 movl $0x0,0x108140(,%ecx,4) + 1013f9: 00 00 00 00 + 1013fd: 51 push %ecx + 1013fe: e8 55 ee ff ff call 100258 + 101403: eb 87 jmp 10138c + 101405: 8d 76 00 lea 0x0(%esi),%esi + 101408: ba 40 83 10 00 mov $0x108340,%edx + 10140d: 31 c0 xor %eax,%eax + 10140f: 83 bc 8a 00 fe ff ff cmpl $0x0,0xfffffe00(%edx,%ecx,4) + 101416: 00 + 101417: 0f 94 c0 sete %al + 10141a: 89 84 8a 00 fe ff ff mov %eax,0xfffffe00(%edx,%ecx,4) + 101421: a1 58 84 10 00 mov 0x108458,%eax + 101426: 31 db xor %ebx,%ebx + 101428: 85 c0 test %eax,%eax + 10142a: 74 05 je 101431 + 10142c: bb 01 00 00 00 mov $0x1,%ebx + 101431: a1 54 84 10 00 mov 0x108454,%eax + 101436: 85 c0 test %eax,%eax + 101438: 74 03 je 10143d + 10143a: 83 cb 02 or $0x2,%ebx + 10143d: a1 28 84 10 00 mov 0x108428,%eax + 101442: 85 c0 test %eax,%eax + 101444: 74 03 je 101449 + 101446: 83 cb 04 or $0x4,%ebx + 101449: 83 ec 08 sub $0x8,%esp + 10144c: 68 ed 00 00 00 push $0xed + 101451: 6a 60 push $0x60 + 101453: e8 d4 f3 ff ff call 10082c <_write_kb> + 101458: 59 pop %ecx + 101459: 58 pop %eax + 10145a: 0f b7 c3 movzwl %bx,%eax + 10145d: 50 push %eax + 10145e: 6a 60 push $0x60 + 101460: e8 c7 f3 ff ff call 10082c <_write_kb> + 101465: 58 pop %eax + 101466: 5a pop %edx + 101467: 6a 20 push $0x20 + 101469: 6a 20 push $0x20 + 10146b: e8 44 3c 00 00 call 1050b4 + 101470: 58 pop %eax + 101471: ff 35 20 83 10 00 pushl 0x108320 + 101477: e8 dc ed ff ff call 100258 + 10147c: e9 37 ff ff ff jmp 1013b8 + 101481: 83 ec 0c sub $0xc,%esp + 101484: 6a 60 push $0x60 + 101486: e8 89 3b 00 00 call 105014 + 10148b: a3 20 83 10 00 mov %eax,0x108320 + 101490: c7 04 24 61 00 00 00 movl $0x61,(%esp,1) + 101497: e8 78 3b 00 00 call 105014 + 10149c: 83 c8 82 or $0xffffff82,%eax + 10149f: 59 pop %ecx + 1014a0: 5b pop %ebx + 1014a1: 0f be d8 movsbl %al,%ebx + 1014a4: 53 push %ebx + 1014a5: 6a 61 push $0x61 + 1014a7: e8 08 3c 00 00 call 1050b4 + 1014ac: 58 pop %eax + 1014ad: 5a pop %edx + 1014ae: 83 e3 7f and $0x7f,%ebx + 1014b1: 53 push %ebx + 1014b2: 6a 61 push $0x61 + 1014b4: e8 fb 3b 00 00 call 1050b4 + 1014b9: a1 20 83 10 00 mov 0x108320,%eax + 1014be: 83 c4 10 add $0x10,%esp + 1014c1: 83 f8 7f cmp $0x7f,%eax + 1014c4: 0f 8e a2 00 00 00 jle 10156c + 1014ca: 83 f8 2a cmp $0x2a,%eax + 1014cd: 74 14 je 1014e3 + 1014cf: 83 ec 0c sub $0xc,%esp + 1014d2: 50 push %eax + 1014d3: c7 04 85 40 83 10 00 movl $0x0,0x108340(,%eax,4) + 1014da: 00 00 00 00 + 1014de: e9 1b ff ff ff jmp 1013fe + 1014e3: 83 ec 0c sub $0xc,%esp + 1014e6: 6a 60 push $0x60 + 1014e8: e8 27 3b 00 00 call 105014 + 1014ed: a3 20 83 10 00 mov %eax,0x108320 + 1014f2: c7 04 24 61 00 00 00 movl $0x61,(%esp,1) + 1014f9: e8 16 3b 00 00 call 105014 + 1014fe: 83 c8 82 or $0xffffff82,%eax + 101501: 59 pop %ecx + 101502: 5b pop %ebx + 101503: 0f be d8 movsbl %al,%ebx + 101506: 53 push %ebx + 101507: 6a 61 push $0x61 + 101509: e8 a6 3b 00 00 call 1050b4 + 10150e: 58 pop %eax + 10150f: 5a pop %edx + 101510: 83 e3 7f and $0x7f,%ebx + 101513: 53 push %ebx + 101514: 6a 61 push $0x61 + 101516: e8 99 3b 00 00 call 1050b4 + 10151b: c7 04 24 60 00 00 00 movl $0x60,(%esp,1) + 101522: e8 ed 3a 00 00 call 105014 + 101527: a3 20 83 10 00 mov %eax,0x108320 + 10152c: c7 04 24 61 00 00 00 movl $0x61,(%esp,1) + 101533: e8 dc 3a 00 00 call 105014 + 101538: 83 c8 82 or $0xffffff82,%eax + 10153b: 5a pop %edx + 10153c: 59 pop %ecx + 10153d: 0f be d8 movsbl %al,%ebx + 101540: 53 push %ebx + 101541: 6a 61 push $0x61 + 101543: e8 6c 3b 00 00 call 1050b4 + 101548: 59 pop %ecx + 101549: 58 pop %eax + 10154a: 83 e3 7f and $0x7f,%ebx + 10154d: 53 push %ebx + 10154e: 6a 61 push $0x61 + 101550: e8 5f 3b 00 00 call 1050b4 + 101555: a1 20 83 10 00 mov 0x108320,%eax + 10155a: 5a pop %edx + 10155b: c7 04 85 40 83 10 00 movl $0x1,0x108340(,%eax,4) + 101562: 01 00 00 00 + 101566: 50 push %eax + 101567: e9 1b fe ff ff jmp 101387 + 10156c: c7 04 85 40 83 10 00 movl $0x1,0x108340(,%eax,4) + 101573: 01 00 00 00 + 101577: 83 ec 0c sub $0xc,%esp + 10157a: eb ea jmp 101566 + +0010157c : + +/** + * init_keyboard() + * + */ +void init_keyboard(void) +{ + 10157c: 55 push %ebp + 10157d: 89 e5 mov %esp,%ebp + static unsigned char buffers[KBD_BUF_SIZE * MAX_VC]; + + int i; + + //klog("init", "keyboard %2u buf, %2ub each", K_KLOG_PENDING, &_vc[0]); + for(i = 0; i < MAX_VC; i++) + 10157f: b9 20 80 10 00 mov $0x108020,%ecx + 101584: 83 ec 08 sub $0x8,%esp + 101587: 31 d2 xor %edx,%edx + 101589: b8 0b 00 00 00 mov $0xb,%eax + { + _vc[i].keystrokes.data = buffers + KBD_BUF_SIZE * i; + 10158e: 89 8a e0 a2 19 00 mov %ecx,0x19a2e0(%edx) + _vc[i].keystrokes.size = KBD_BUF_SIZE; + 101594: c7 82 e4 a2 19 00 40 movl $0x40,0x19a2e4(%edx) + 10159b: 00 00 00 + 10159e: 83 c1 40 add $0x40,%ecx + 1015a1: 83 c2 34 add $0x34,%edx + 1015a4: 48 dec %eax + 1015a5: 79 e7 jns 10158e + } + + for(i = 0; i < 128; i++) + 1015a7: 31 c0 xor %eax,%eax + 1015a9: 8d 76 00 lea 0x0(%esi),%esi + keys[i] = 0; + 1015ac: c7 04 85 40 83 10 00 movl $0x0,0x108340(,%eax,4) + 1015b3: 00 00 00 00 + 1015b7: 40 inc %eax + 1015b8: 83 f8 7f cmp $0x7f,%eax + 1015bb: 7e ef jle 1015ac + + makebreak = 0; + //klog(NULL, K_KLOG_SUCCESS, &_vc[0], NULL); + //kprintf("init_kbd: %u buffers, %u bytes each\n", + // MAX_VC, KBD_BUF_SIZE); + + //kprintf("[ Entering Runlevel 0 ].......................................................Ok"); + _vc[0].attrib = 8; + printf("[ "); + 1015bd: 83 ec 0c sub $0xc,%esp + 1015c0: 68 b6 51 10 00 push $0x1051b6 + 1015c5: c7 05 a0 85 10 00 00 movl $0x0,0x1085a0 + 1015cc: 00 00 00 + 1015cf: c7 05 f8 a2 19 00 08 movl $0x8,0x19a2f8 + 1015d6: 00 00 00 + 1015d9: e8 f6 3a 00 00 call 1050d4 + _vc[0].attrib = 15; + printf("init: keyboard %2u buf, %2ub each ", MAX_VC, KBD_BUF_SIZE); + 1015de: 83 c4 0c add $0xc,%esp + 1015e1: 6a 40 push $0x40 + 1015e3: 6a 0c push $0xc + 1015e5: 68 60 58 10 00 push $0x105860 + 1015ea: c7 05 f8 a2 19 00 0f movl $0xf,0x19a2f8 + 1015f1: 00 00 00 + 1015f4: e8 db 3a 00 00 call 1050d4 + _vc[0].attrib = 8; + printf("]..........................................."); + 1015f9: c7 04 24 a0 58 10 00 movl $0x1058a0,(%esp,1) + 101600: c7 05 f8 a2 19 00 08 movl $0x8,0x19a2f8 + 101607: 00 00 00 + 10160a: e8 c5 3a 00 00 call 1050d4 + _vc[0].attrib = 2; + printf("Ok"); + 10160f: c7 04 24 d9 54 10 00 movl $0x1054d9,(%esp,1) + 101616: c7 05 f8 a2 19 00 02 movl $0x2,0x19a2f8 + 10161d: 00 00 00 + 101620: e8 af 3a 00 00 call 1050d4 + _vc[0].attrib = 7; + 101625: c7 05 f8 a2 19 00 07 movl $0x7,0x19a2f8 + 10162c: 00 00 00 +} + 10162f: c9 leave + 101630: c3 ret + ... + +00101640 : + 101640: a1 00 70 10 00 mov 0x107000,%eax + 101645: 3d 2a da 44 35 cmp $0x3544da2a,%eax + 10164a: 74 0b je 101657 + 10164c: 66 c7 05 00 80 0b 00 movw $0x9f44,0xb8000 + 101653: 44 9f + 101655: eb fe jmp 101655 + +00101657 : + 101657: 0f 01 15 24 70 10 00 lgdtl 0x107024 + 10165e: 66 b8 10 00 mov $0x10,%ax + 101662: 8e d8 mov %eax,%ds + 101664: 8e c0 mov %eax,%es + 101666: 8e d0 mov %eax,%ss + 101668: 8e e0 mov %eax,%fs + 10166a: 8e e8 mov %eax,%gs + 10166c: ea 73 16 10 00 18 00 ljmp $0x18,$0x101673 + +00101673 : + 101673: bf 00 80 10 00 mov $0x108000,%edi + 101678: b9 00 b0 19 00 mov $0x19b000,%ecx + 10167d: 29 f9 sub %edi,%ecx + 10167f: 31 c0 xor %eax,%eax + 101681: f3 aa repz stos %al,%es:(%edi) + 101683: bc a4 95 10 00 mov $0x1095a4,%esp + 101688: b9 00 01 00 00 mov $0x100,%ecx + 10168d: bf 2a 70 10 00 mov $0x10702a,%edi + 101692: be 6b 17 10 00 mov $0x10176b,%esi + +00101697 : + 101697: 89 f0 mov %esi,%eax + 101699: 66 89 07 mov %ax,(%edi) + 10169c: c1 e8 10 shr $0x10,%eax + 10169f: 66 89 47 06 mov %ax,0x6(%edi) + 1016a3: 81 c7 08 00 00 00 add $0x8,%edi + 1016a9: 81 c6 26 00 00 00 add $0x26,%esi + 1016af: e2 e6 loop 101697 + 1016b1: 0f 01 1d 2a 78 10 00 lidtl 0x10782a + 1016b8: 68 02 00 00 00 push $0x2 + 1016bd: 9d popf + 1016be: e8 61 2c 00 00 call 104324
+ 1016c3: eb fe jmp 1016c3 + 1016c5: 90 nop + 1016c6: 90 nop + 1016c7: 90 nop + +001016c8 : + 1016c8: 02 b0 ad 1b 03 00 add 0x31bad(%eax),%dh + 1016ce: 01 00 add %eax,(%eax) + 1016d0: fb sti + 1016d1: 4f dec %edi + 1016d2: 51 push %ecx + 1016d3: e4 c8 in $0xc8,%al + 1016d5: 16 push %ss + 1016d6: 10 00 adc %al,(%eax) + 1016d8: 00 00 add %al,(%eax) + 1016da: 10 00 adc %al,(%eax) + 1016dc: 00 80 10 00 00 b0 add %al,0xb0000010(%eax) + 1016e2: 19 00 sbb %eax,(%eax) + 1016e4: 40 inc %eax + 1016e5: 16 push %ss + 1016e6: 10 00 adc %al,(%eax) + +001016e8 : + 1016e8: 58 pop %eax + 1016e9: 61 popa + 1016ea: 1f pop %ds + 1016eb: 07 pop %es + 1016ec: 0f a1 pop %fs + 1016ee: 0f a9 pop %gs + 1016f0: 81 c4 08 00 00 00 add $0x8,%esp + 1016f6: cf iret + +001016f7 <_getvect>: + 1016f7: 55 push %ebp + 1016f8: 89 e5 mov %esp,%ebp + 1016fa: 56 push %esi + 1016fb: 53 push %ebx + 1016fc: 8b 75 08 mov 0x8(%ebp),%esi + 1016ff: 31 db xor %ebx,%ebx + 101701: 8a 5d 0c mov 0xc(%ebp),%bl + 101704: c1 e3 03 shl $0x3,%ebx + 101707: 8a 83 2f 70 10 00 mov 0x10702f(%ebx),%al + 10170d: 89 06 mov %eax,(%esi) + 10170f: b8 91 17 10 00 mov $0x101791,%eax + 101714: 2d 6b 17 10 00 sub $0x10176b,%eax + 101719: f6 65 0c mulb 0xc(%ebp) + 10171c: 89 c3 mov %eax,%ebx + 10171e: 81 c3 6b 17 10 00 add $0x10176b,%ebx + 101724: 8b 83 1b 00 00 00 mov 0x1b(%ebx),%eax + 10172a: 89 46 04 mov %eax,0x4(%esi) + 10172d: 5b pop %ebx + 10172e: 5e pop %esi + 10172f: 5d pop %ebp + 101730: c3 ret + +00101731 <_setvect>: + 101731: 55 push %ebp + 101732: 89 e5 mov %esp,%ebp + 101734: 56 push %esi + 101735: 53 push %ebx + 101736: 8b 75 08 mov 0x8(%ebp),%esi + 101739: 8b 06 mov (%esi),%eax + 10173b: 31 db xor %ebx,%ebx + 10173d: 8a 5d 0c mov 0xc(%ebp),%bl + 101740: c1 e3 03 shl $0x3,%ebx + 101743: 88 83 2f 70 10 00 mov %al,0x10702f(%ebx) + 101749: b8 91 17 10 00 mov $0x101791,%eax + 10174e: 2d 6b 17 10 00 sub $0x10176b,%eax + 101753: f6 65 0c mulb 0xc(%ebp) + 101756: 89 c3 mov %eax,%ebx + 101758: 81 c3 6b 17 10 00 add $0x10176b,%ebx + 10175e: 8b 46 04 mov 0x4(%esi),%eax + 101761: 89 83 1b 00 00 00 mov %eax,0x1b(%ebx) + 101767: 5b pop %ebx + 101768: 5e pop %esi + 101769: 5d pop %ebp + 10176a: c3 ret + +0010176b : + 10176b: 6a 00 push $0x0 + 10176d: 6a 00 push $0x0 + 10176f: 0f a8 push %gs + 101771: 0f a0 push %fs + 101773: 06 push %es + 101774: 1e push %ds + 101775: 60 pusha + 101776: 66 b8 10 00 mov $0x10,%ax + 10177a: 8e d8 mov %eax,%ds + 10177c: 8e c0 mov %eax,%es + 10177e: 8e e0 mov %eax,%fs + 101780: 8e e8 mov %eax,%gs + 101782: 89 e0 mov %esp,%eax + 101784: 50 push %eax + +00101785 : + 101785: b8 04 3e 10 00 mov $0x103e04,%eax + 10178a: ff d0 call *%eax + 10178c: e9 57 ff ff ff jmp 1016e8 + +00101791 : + 101791: 6a 00 push $0x0 + 101793: 6a 01 push $0x1 + 101795: 0f a8 push %gs + 101797: 0f a0 push %fs + 101799: 06 push %es + 10179a: 1e push %ds + 10179b: 60 pusha + 10179c: 66 b8 10 00 mov $0x10,%ax + 1017a0: 8e d8 mov %eax,%ds + 1017a2: 8e c0 mov %eax,%es + 1017a4: 8e e0 mov %eax,%fs + 1017a6: 8e e8 mov %eax,%gs + 1017a8: 89 e0 mov %esp,%eax + 1017aa: 50 push %eax + +001017ab : + 1017ab: b8 04 3e 10 00 mov $0x103e04,%eax + 1017b0: ff d0 call *%eax + 1017b2: e9 31 ff ff ff jmp 1016e8 + +001017b7 : + 1017b7: 6a 00 push $0x0 + 1017b9: 6a 02 push $0x2 + 1017bb: 0f a8 push %gs + 1017bd: 0f a0 push %fs + 1017bf: 06 push %es + 1017c0: 1e push %ds + 1017c1: 60 pusha + 1017c2: 66 b8 10 00 mov $0x10,%ax + 1017c6: 8e d8 mov %eax,%ds + 1017c8: 8e c0 mov %eax,%es + 1017ca: 8e e0 mov %eax,%fs + 1017cc: 8e e8 mov %eax,%gs + 1017ce: 89 e0 mov %esp,%eax + 1017d0: 50 push %eax + +001017d1 : + 1017d1: b8 04 3e 10 00 mov $0x103e04,%eax + 1017d6: ff d0 call *%eax + 1017d8: e9 0b ff ff ff jmp 1016e8 + +001017dd : + 1017dd: 6a 00 push $0x0 + 1017df: 6a 03 push $0x3 + 1017e1: 0f a8 push %gs + 1017e3: 0f a0 push %fs + 1017e5: 06 push %es + 1017e6: 1e push %ds + 1017e7: 60 pusha + 1017e8: 66 b8 10 00 mov $0x10,%ax + 1017ec: 8e d8 mov %eax,%ds + 1017ee: 8e c0 mov %eax,%es + 1017f0: 8e e0 mov %eax,%fs + 1017f2: 8e e8 mov %eax,%gs + 1017f4: 89 e0 mov %esp,%eax + 1017f6: 50 push %eax + +001017f7 : + 1017f7: b8 04 3e 10 00 mov $0x103e04,%eax + 1017fc: ff d0 call *%eax + 1017fe: e9 e5 fe ff ff jmp 1016e8 + +00101803 : + 101803: 6a 00 push $0x0 + 101805: 6a 04 push $0x4 + 101807: 0f a8 push %gs + 101809: 0f a0 push %fs + 10180b: 06 push %es + 10180c: 1e push %ds + 10180d: 60 pusha + 10180e: 66 b8 10 00 mov $0x10,%ax + 101812: 8e d8 mov %eax,%ds + 101814: 8e c0 mov %eax,%es + 101816: 8e e0 mov %eax,%fs + 101818: 8e e8 mov %eax,%gs + 10181a: 89 e0 mov %esp,%eax + 10181c: 50 push %eax + +0010181d : + 10181d: b8 04 3e 10 00 mov $0x103e04,%eax + 101822: ff d0 call *%eax + 101824: e9 bf fe ff ff jmp 1016e8 + +00101829 : + 101829: 6a 00 push $0x0 + 10182b: 6a 05 push $0x5 + 10182d: 0f a8 push %gs + 10182f: 0f a0 push %fs + 101831: 06 push %es + 101832: 1e push %ds + 101833: 60 pusha + 101834: 66 b8 10 00 mov $0x10,%ax + 101838: 8e d8 mov %eax,%ds + 10183a: 8e c0 mov %eax,%es + 10183c: 8e e0 mov %eax,%fs + 10183e: 8e e8 mov %eax,%gs + 101840: 89 e0 mov %esp,%eax + 101842: 50 push %eax + +00101843 : + 101843: b8 04 3e 10 00 mov $0x103e04,%eax + 101848: ff d0 call *%eax + 10184a: e9 99 fe ff ff jmp 1016e8 + +0010184f : + 10184f: 6a 00 push $0x0 + 101851: 6a 06 push $0x6 + 101853: 0f a8 push %gs + 101855: 0f a0 push %fs + 101857: 06 push %es + 101858: 1e push %ds + 101859: 60 pusha + 10185a: 66 b8 10 00 mov $0x10,%ax + 10185e: 8e d8 mov %eax,%ds + 101860: 8e c0 mov %eax,%es + 101862: 8e e0 mov %eax,%fs + 101864: 8e e8 mov %eax,%gs + 101866: 89 e0 mov %esp,%eax + 101868: 50 push %eax + +00101869 : + 101869: b8 04 3e 10 00 mov $0x103e04,%eax + 10186e: ff d0 call *%eax + 101870: e9 73 fe ff ff jmp 1016e8 + +00101875 : + 101875: 6a 00 push $0x0 + 101877: 6a 07 push $0x7 + 101879: 0f a8 push %gs + 10187b: 0f a0 push %fs + 10187d: 06 push %es + 10187e: 1e push %ds + 10187f: 60 pusha + 101880: 66 b8 10 00 mov $0x10,%ax + 101884: 8e d8 mov %eax,%ds + 101886: 8e c0 mov %eax,%es + 101888: 8e e0 mov %eax,%fs + 10188a: 8e e8 mov %eax,%gs + 10188c: 89 e0 mov %esp,%eax + 10188e: 50 push %eax + +0010188f : + 10188f: b8 04 3e 10 00 mov $0x103e04,%eax + 101894: ff d0 call *%eax + 101896: e9 4d fe ff ff jmp 1016e8 + +0010189b : + 10189b: 90 nop + 10189c: 90 nop + 10189d: 6a 08 push $0x8 + 10189f: 0f a8 push %gs + 1018a1: 0f a0 push %fs + 1018a3: 06 push %es + 1018a4: 1e push %ds + 1018a5: 60 pusha + 1018a6: 66 b8 10 00 mov $0x10,%ax + 1018aa: 8e d8 mov %eax,%ds + 1018ac: 8e c0 mov %eax,%es + 1018ae: 8e e0 mov %eax,%fs + 1018b0: 8e e8 mov %eax,%gs + 1018b2: 89 e0 mov %esp,%eax + 1018b4: 50 push %eax + +001018b5 : + 1018b5: b8 04 3e 10 00 mov $0x103e04,%eax + 1018ba: ff d0 call *%eax + 1018bc: e9 27 fe ff ff jmp 1016e8 + +001018c1 : + 1018c1: 6a 00 push $0x0 + 1018c3: 6a 09 push $0x9 + 1018c5: 0f a8 push %gs + 1018c7: 0f a0 push %fs + 1018c9: 06 push %es + 1018ca: 1e push %ds + 1018cb: 60 pusha + 1018cc: 66 b8 10 00 mov $0x10,%ax + 1018d0: 8e d8 mov %eax,%ds + 1018d2: 8e c0 mov %eax,%es + 1018d4: 8e e0 mov %eax,%fs + 1018d6: 8e e8 mov %eax,%gs + 1018d8: 89 e0 mov %esp,%eax + 1018da: 50 push %eax + +001018db : + 1018db: b8 04 3e 10 00 mov $0x103e04,%eax + 1018e0: ff d0 call *%eax + 1018e2: e9 01 fe ff ff jmp 1016e8 + +001018e7 : + 1018e7: 90 nop + 1018e8: 90 nop + 1018e9: 6a 0a push $0xa + 1018eb: 0f a8 push %gs + 1018ed: 0f a0 push %fs + 1018ef: 06 push %es + 1018f0: 1e push %ds + 1018f1: 60 pusha + 1018f2: 66 b8 10 00 mov $0x10,%ax + 1018f6: 8e d8 mov %eax,%ds + 1018f8: 8e c0 mov %eax,%es + 1018fa: 8e e0 mov %eax,%fs + 1018fc: 8e e8 mov %eax,%gs + 1018fe: 89 e0 mov %esp,%eax + 101900: 50 push %eax + +00101901 : + 101901: b8 04 3e 10 00 mov $0x103e04,%eax + 101906: ff d0 call *%eax + 101908: e9 db fd ff ff jmp 1016e8 + +0010190d : + 10190d: 90 nop + 10190e: 90 nop + 10190f: 6a 0b push $0xb + 101911: 0f a8 push %gs + 101913: 0f a0 push %fs + 101915: 06 push %es + 101916: 1e push %ds + 101917: 60 pusha + 101918: 66 b8 10 00 mov $0x10,%ax + 10191c: 8e d8 mov %eax,%ds + 10191e: 8e c0 mov %eax,%es + 101920: 8e e0 mov %eax,%fs + 101922: 8e e8 mov %eax,%gs + 101924: 89 e0 mov %esp,%eax + 101926: 50 push %eax + +00101927 : + 101927: b8 04 3e 10 00 mov $0x103e04,%eax + 10192c: ff d0 call *%eax + 10192e: e9 b5 fd ff ff jmp 1016e8 + +00101933 : + 101933: 90 nop + 101934: 90 nop + 101935: 6a 0c push $0xc + 101937: 0f a8 push %gs + 101939: 0f a0 push %fs + 10193b: 06 push %es + 10193c: 1e push %ds + 10193d: 60 pusha + 10193e: 66 b8 10 00 mov $0x10,%ax + 101942: 8e d8 mov %eax,%ds + 101944: 8e c0 mov %eax,%es + 101946: 8e e0 mov %eax,%fs + 101948: 8e e8 mov %eax,%gs + 10194a: 89 e0 mov %esp,%eax + 10194c: 50 push %eax + +0010194d : + 10194d: b8 04 3e 10 00 mov $0x103e04,%eax + 101952: ff d0 call *%eax + 101954: e9 8f fd ff ff jmp 1016e8 + +00101959 : + 101959: 90 nop + 10195a: 90 nop + 10195b: 6a 0d push $0xd + 10195d: 0f a8 push %gs + 10195f: 0f a0 push %fs + 101961: 06 push %es + 101962: 1e push %ds + 101963: 60 pusha + 101964: 66 b8 10 00 mov $0x10,%ax + 101968: 8e d8 mov %eax,%ds + 10196a: 8e c0 mov %eax,%es + 10196c: 8e e0 mov %eax,%fs + 10196e: 8e e8 mov %eax,%gs + 101970: 89 e0 mov %esp,%eax + 101972: 50 push %eax + +00101973 : + 101973: b8 04 3e 10 00 mov $0x103e04,%eax + 101978: ff d0 call *%eax + 10197a: e9 69 fd ff ff jmp 1016e8 + +0010197f : + 10197f: 90 nop + 101980: 90 nop + 101981: 6a 0e push $0xe + 101983: 0f a8 push %gs + 101985: 0f a0 push %fs + 101987: 06 push %es + 101988: 1e push %ds + 101989: 60 pusha + 10198a: 66 b8 10 00 mov $0x10,%ax + 10198e: 8e d8 mov %eax,%ds + 101990: 8e c0 mov %eax,%es + 101992: 8e e0 mov %eax,%fs + 101994: 8e e8 mov %eax,%gs + 101996: 89 e0 mov %esp,%eax + 101998: 50 push %eax + +00101999 : + 101999: b8 04 3e 10 00 mov $0x103e04,%eax + 10199e: ff d0 call *%eax + 1019a0: e9 43 fd ff ff jmp 1016e8 + +001019a5 : + 1019a5: 6a 00 push $0x0 + 1019a7: 6a 0f push $0xf + 1019a9: 0f a8 push %gs + 1019ab: 0f a0 push %fs + 1019ad: 06 push %es + 1019ae: 1e push %ds + 1019af: 60 pusha + 1019b0: 66 b8 10 00 mov $0x10,%ax + 1019b4: 8e d8 mov %eax,%ds + 1019b6: 8e c0 mov %eax,%es + 1019b8: 8e e0 mov %eax,%fs + 1019ba: 8e e8 mov %eax,%gs + 1019bc: 89 e0 mov %esp,%eax + 1019be: 50 push %eax + +001019bf : + 1019bf: b8 04 3e 10 00 mov $0x103e04,%eax + 1019c4: ff d0 call *%eax + 1019c6: e9 1d fd ff ff jmp 1016e8 + +001019cb : + 1019cb: 6a 00 push $0x0 + 1019cd: 6a 10 push $0x10 + 1019cf: 0f a8 push %gs + 1019d1: 0f a0 push %fs + 1019d3: 06 push %es + 1019d4: 1e push %ds + 1019d5: 60 pusha + 1019d6: 66 b8 10 00 mov $0x10,%ax + 1019da: 8e d8 mov %eax,%ds + 1019dc: 8e c0 mov %eax,%es + 1019de: 8e e0 mov %eax,%fs + 1019e0: 8e e8 mov %eax,%gs + 1019e2: 89 e0 mov %esp,%eax + 1019e4: 50 push %eax + +001019e5 : + 1019e5: b8 04 3e 10 00 mov $0x103e04,%eax + 1019ea: ff d0 call *%eax + 1019ec: e9 f7 fc ff ff jmp 1016e8 + +001019f1 : + 1019f1: 6a 00 push $0x0 + 1019f3: 6a 11 push $0x11 + 1019f5: 0f a8 push %gs + 1019f7: 0f a0 push %fs + 1019f9: 06 push %es + 1019fa: 1e push %ds + 1019fb: 60 pusha + 1019fc: 66 b8 10 00 mov $0x10,%ax + 101a00: 8e d8 mov %eax,%ds + 101a02: 8e c0 mov %eax,%es + 101a04: 8e e0 mov %eax,%fs + 101a06: 8e e8 mov %eax,%gs + 101a08: 89 e0 mov %esp,%eax + 101a0a: 50 push %eax + +00101a0b : + 101a0b: b8 04 3e 10 00 mov $0x103e04,%eax + 101a10: ff d0 call *%eax + 101a12: e9 d1 fc ff ff jmp 1016e8 + +00101a17 : + 101a17: 6a 00 push $0x0 + 101a19: 6a 12 push $0x12 + 101a1b: 0f a8 push %gs + 101a1d: 0f a0 push %fs + 101a1f: 06 push %es + 101a20: 1e push %ds + 101a21: 60 pusha + 101a22: 66 b8 10 00 mov $0x10,%ax + 101a26: 8e d8 mov %eax,%ds + 101a28: 8e c0 mov %eax,%es + 101a2a: 8e e0 mov %eax,%fs + 101a2c: 8e e8 mov %eax,%gs + 101a2e: 89 e0 mov %esp,%eax + 101a30: 50 push %eax + +00101a31 : + 101a31: b8 04 3e 10 00 mov $0x103e04,%eax + 101a36: ff d0 call *%eax + 101a38: e9 ab fc ff ff jmp 1016e8 + +00101a3d : + 101a3d: 6a 00 push $0x0 + 101a3f: 6a 13 push $0x13 + 101a41: 0f a8 push %gs + 101a43: 0f a0 push %fs + 101a45: 06 push %es + 101a46: 1e push %ds + 101a47: 60 pusha + 101a48: 66 b8 10 00 mov $0x10,%ax + 101a4c: 8e d8 mov %eax,%ds + 101a4e: 8e c0 mov %eax,%es + 101a50: 8e e0 mov %eax,%fs + 101a52: 8e e8 mov %eax,%gs + 101a54: 89 e0 mov %esp,%eax + 101a56: 50 push %eax + +00101a57 : + 101a57: b8 04 3e 10 00 mov $0x103e04,%eax + 101a5c: ff d0 call *%eax + 101a5e: e9 85 fc ff ff jmp 1016e8 + +00101a63 : + 101a63: 6a 00 push $0x0 + 101a65: 6a 14 push $0x14 + 101a67: 0f a8 push %gs + 101a69: 0f a0 push %fs + 101a6b: 06 push %es + 101a6c: 1e push %ds + 101a6d: 60 pusha + 101a6e: 66 b8 10 00 mov $0x10,%ax + 101a72: 8e d8 mov %eax,%ds + 101a74: 8e c0 mov %eax,%es + 101a76: 8e e0 mov %eax,%fs + 101a78: 8e e8 mov %eax,%gs + 101a7a: 89 e0 mov %esp,%eax + 101a7c: 50 push %eax + +00101a7d : + 101a7d: b8 04 3e 10 00 mov $0x103e04,%eax + 101a82: ff d0 call *%eax + 101a84: e9 5f fc ff ff jmp 1016e8 + +00101a89 : + 101a89: 6a 00 push $0x0 + 101a8b: 6a 15 push $0x15 + 101a8d: 0f a8 push %gs + 101a8f: 0f a0 push %fs + 101a91: 06 push %es + 101a92: 1e push %ds + 101a93: 60 pusha + 101a94: 66 b8 10 00 mov $0x10,%ax + 101a98: 8e d8 mov %eax,%ds + 101a9a: 8e c0 mov %eax,%es + 101a9c: 8e e0 mov %eax,%fs + 101a9e: 8e e8 mov %eax,%gs + 101aa0: 89 e0 mov %esp,%eax + 101aa2: 50 push %eax + +00101aa3 : + 101aa3: b8 04 3e 10 00 mov $0x103e04,%eax + 101aa8: ff d0 call *%eax + 101aaa: e9 39 fc ff ff jmp 1016e8 + +00101aaf : + 101aaf: 6a 00 push $0x0 + 101ab1: 6a 16 push $0x16 + 101ab3: 0f a8 push %gs + 101ab5: 0f a0 push %fs + 101ab7: 06 push %es + 101ab8: 1e push %ds + 101ab9: 60 pusha + 101aba: 66 b8 10 00 mov $0x10,%ax + 101abe: 8e d8 mov %eax,%ds + 101ac0: 8e c0 mov %eax,%es + 101ac2: 8e e0 mov %eax,%fs + 101ac4: 8e e8 mov %eax,%gs + 101ac6: 89 e0 mov %esp,%eax + 101ac8: 50 push %eax + +00101ac9 : + 101ac9: b8 04 3e 10 00 mov $0x103e04,%eax + 101ace: ff d0 call *%eax + 101ad0: e9 13 fc ff ff jmp 1016e8 + +00101ad5 : + 101ad5: 6a 00 push $0x0 + 101ad7: 6a 17 push $0x17 + 101ad9: 0f a8 push %gs + 101adb: 0f a0 push %fs + 101add: 06 push %es + 101ade: 1e push %ds + 101adf: 60 pusha + 101ae0: 66 b8 10 00 mov $0x10,%ax + 101ae4: 8e d8 mov %eax,%ds + 101ae6: 8e c0 mov %eax,%es + 101ae8: 8e e0 mov %eax,%fs + 101aea: 8e e8 mov %eax,%gs + 101aec: 89 e0 mov %esp,%eax + 101aee: 50 push %eax + +00101aef : + 101aef: b8 04 3e 10 00 mov $0x103e04,%eax + 101af4: ff d0 call *%eax + 101af6: e9 ed fb ff ff jmp 1016e8 + +00101afb : + 101afb: 6a 00 push $0x0 + 101afd: 6a 18 push $0x18 + 101aff: 0f a8 push %gs + 101b01: 0f a0 push %fs + 101b03: 06 push %es + 101b04: 1e push %ds + 101b05: 60 pusha + 101b06: 66 b8 10 00 mov $0x10,%ax + 101b0a: 8e d8 mov %eax,%ds + 101b0c: 8e c0 mov %eax,%es + 101b0e: 8e e0 mov %eax,%fs + 101b10: 8e e8 mov %eax,%gs + 101b12: 89 e0 mov %esp,%eax + 101b14: 50 push %eax + +00101b15 : + 101b15: b8 04 3e 10 00 mov $0x103e04,%eax + 101b1a: ff d0 call *%eax + 101b1c: e9 c7 fb ff ff jmp 1016e8 + +00101b21 : + 101b21: 6a 00 push $0x0 + 101b23: 6a 19 push $0x19 + 101b25: 0f a8 push %gs + 101b27: 0f a0 push %fs + 101b29: 06 push %es + 101b2a: 1e push %ds + 101b2b: 60 pusha + 101b2c: 66 b8 10 00 mov $0x10,%ax + 101b30: 8e d8 mov %eax,%ds + 101b32: 8e c0 mov %eax,%es + 101b34: 8e e0 mov %eax,%fs + 101b36: 8e e8 mov %eax,%gs + 101b38: 89 e0 mov %esp,%eax + 101b3a: 50 push %eax + +00101b3b : + 101b3b: b8 04 3e 10 00 mov $0x103e04,%eax + 101b40: ff d0 call *%eax + 101b42: e9 a1 fb ff ff jmp 1016e8 + +00101b47 : + 101b47: 6a 00 push $0x0 + 101b49: 6a 1a push $0x1a + 101b4b: 0f a8 push %gs + 101b4d: 0f a0 push %fs + 101b4f: 06 push %es + 101b50: 1e push %ds + 101b51: 60 pusha + 101b52: 66 b8 10 00 mov $0x10,%ax + 101b56: 8e d8 mov %eax,%ds + 101b58: 8e c0 mov %eax,%es + 101b5a: 8e e0 mov %eax,%fs + 101b5c: 8e e8 mov %eax,%gs + 101b5e: 89 e0 mov %esp,%eax + 101b60: 50 push %eax + +00101b61 : + 101b61: b8 04 3e 10 00 mov $0x103e04,%eax + 101b66: ff d0 call *%eax + 101b68: e9 7b fb ff ff jmp 1016e8 + +00101b6d : + 101b6d: 6a 00 push $0x0 + 101b6f: 6a 1b push $0x1b + 101b71: 0f a8 push %gs + 101b73: 0f a0 push %fs + 101b75: 06 push %es + 101b76: 1e push %ds + 101b77: 60 pusha + 101b78: 66 b8 10 00 mov $0x10,%ax + 101b7c: 8e d8 mov %eax,%ds + 101b7e: 8e c0 mov %eax,%es + 101b80: 8e e0 mov %eax,%fs + 101b82: 8e e8 mov %eax,%gs + 101b84: 89 e0 mov %esp,%eax + 101b86: 50 push %eax + +00101b87 : + 101b87: b8 04 3e 10 00 mov $0x103e04,%eax + 101b8c: ff d0 call *%eax + 101b8e: e9 55 fb ff ff jmp 1016e8 + +00101b93 : + 101b93: 6a 00 push $0x0 + 101b95: 6a 1c push $0x1c + 101b97: 0f a8 push %gs + 101b99: 0f a0 push %fs + 101b9b: 06 push %es + 101b9c: 1e push %ds + 101b9d: 60 pusha + 101b9e: 66 b8 10 00 mov $0x10,%ax + 101ba2: 8e d8 mov %eax,%ds + 101ba4: 8e c0 mov %eax,%es + 101ba6: 8e e0 mov %eax,%fs + 101ba8: 8e e8 mov %eax,%gs + 101baa: 89 e0 mov %esp,%eax + 101bac: 50 push %eax + +00101bad : + 101bad: b8 04 3e 10 00 mov $0x103e04,%eax + 101bb2: ff d0 call *%eax + 101bb4: e9 2f fb ff ff jmp 1016e8 + +00101bb9 : + 101bb9: 6a 00 push $0x0 + 101bbb: 6a 1d push $0x1d + 101bbd: 0f a8 push %gs + 101bbf: 0f a0 push %fs + 101bc1: 06 push %es + 101bc2: 1e push %ds + 101bc3: 60 pusha + 101bc4: 66 b8 10 00 mov $0x10,%ax + 101bc8: 8e d8 mov %eax,%ds + 101bca: 8e c0 mov %eax,%es + 101bcc: 8e e0 mov %eax,%fs + 101bce: 8e e8 mov %eax,%gs + 101bd0: 89 e0 mov %esp,%eax + 101bd2: 50 push %eax + +00101bd3 : + 101bd3: b8 04 3e 10 00 mov $0x103e04,%eax + 101bd8: ff d0 call *%eax + 101bda: e9 09 fb ff ff jmp 1016e8 + +00101bdf : + 101bdf: 6a 00 push $0x0 + 101be1: 6a 1e push $0x1e + 101be3: 0f a8 push %gs + 101be5: 0f a0 push %fs + 101be7: 06 push %es + 101be8: 1e push %ds + 101be9: 60 pusha + 101bea: 66 b8 10 00 mov $0x10,%ax + 101bee: 8e d8 mov %eax,%ds + 101bf0: 8e c0 mov %eax,%es + 101bf2: 8e e0 mov %eax,%fs + 101bf4: 8e e8 mov %eax,%gs + 101bf6: 89 e0 mov %esp,%eax + 101bf8: 50 push %eax + +00101bf9 : + 101bf9: b8 04 3e 10 00 mov $0x103e04,%eax + 101bfe: ff d0 call *%eax + 101c00: e9 e3 fa ff ff jmp 1016e8 + +00101c05 : + 101c05: 6a 00 push $0x0 + 101c07: 6a 1f push $0x1f + 101c09: 0f a8 push %gs + 101c0b: 0f a0 push %fs + 101c0d: 06 push %es + 101c0e: 1e push %ds + 101c0f: 60 pusha + 101c10: 66 b8 10 00 mov $0x10,%ax + 101c14: 8e d8 mov %eax,%ds + 101c16: 8e c0 mov %eax,%es + 101c18: 8e e0 mov %eax,%fs + 101c1a: 8e e8 mov %eax,%gs + 101c1c: 89 e0 mov %esp,%eax + 101c1e: 50 push %eax + +00101c1f : + 101c1f: b8 04 3e 10 00 mov $0x103e04,%eax + 101c24: ff d0 call *%eax + 101c26: e9 bd fa ff ff jmp 1016e8 + +00101c2b : + 101c2b: 6a 00 push $0x0 + 101c2d: 6a 20 push $0x20 + 101c2f: 0f a8 push %gs + 101c31: 0f a0 push %fs + 101c33: 06 push %es + 101c34: 1e push %ds + 101c35: 60 pusha + 101c36: 66 b8 10 00 mov $0x10,%ax + 101c3a: 8e d8 mov %eax,%ds + 101c3c: 8e c0 mov %eax,%es + 101c3e: 8e e0 mov %eax,%fs + 101c40: 8e e8 mov %eax,%gs + 101c42: 89 e0 mov %esp,%eax + 101c44: 50 push %eax + +00101c45 : + 101c45: b8 04 3e 10 00 mov $0x103e04,%eax + 101c4a: ff d0 call *%eax + 101c4c: e9 97 fa ff ff jmp 1016e8 + +00101c51 : + 101c51: 6a 00 push $0x0 + 101c53: 6a 21 push $0x21 + 101c55: 0f a8 push %gs + 101c57: 0f a0 push %fs + 101c59: 06 push %es + 101c5a: 1e push %ds + 101c5b: 60 pusha + 101c5c: 66 b8 10 00 mov $0x10,%ax + 101c60: 8e d8 mov %eax,%ds + 101c62: 8e c0 mov %eax,%es + 101c64: 8e e0 mov %eax,%fs + 101c66: 8e e8 mov %eax,%gs + 101c68: 89 e0 mov %esp,%eax + 101c6a: 50 push %eax + +00101c6b : + 101c6b: b8 04 3e 10 00 mov $0x103e04,%eax + 101c70: ff d0 call *%eax + 101c72: e9 71 fa ff ff jmp 1016e8 + +00101c77 : + 101c77: 6a 00 push $0x0 + 101c79: 6a 22 push $0x22 + 101c7b: 0f a8 push %gs + 101c7d: 0f a0 push %fs + 101c7f: 06 push %es + 101c80: 1e push %ds + 101c81: 60 pusha + 101c82: 66 b8 10 00 mov $0x10,%ax + 101c86: 8e d8 mov %eax,%ds + 101c88: 8e c0 mov %eax,%es + 101c8a: 8e e0 mov %eax,%fs + 101c8c: 8e e8 mov %eax,%gs + 101c8e: 89 e0 mov %esp,%eax + 101c90: 50 push %eax + +00101c91 : + 101c91: b8 04 3e 10 00 mov $0x103e04,%eax + 101c96: ff d0 call *%eax + 101c98: e9 4b fa ff ff jmp 1016e8 + +00101c9d : + 101c9d: 6a 00 push $0x0 + 101c9f: 6a 23 push $0x23 + 101ca1: 0f a8 push %gs + 101ca3: 0f a0 push %fs + 101ca5: 06 push %es + 101ca6: 1e push %ds + 101ca7: 60 pusha + 101ca8: 66 b8 10 00 mov $0x10,%ax + 101cac: 8e d8 mov %eax,%ds + 101cae: 8e c0 mov %eax,%es + 101cb0: 8e e0 mov %eax,%fs + 101cb2: 8e e8 mov %eax,%gs + 101cb4: 89 e0 mov %esp,%eax + 101cb6: 50 push %eax + +00101cb7 : + 101cb7: b8 04 3e 10 00 mov $0x103e04,%eax + 101cbc: ff d0 call *%eax + 101cbe: e9 25 fa ff ff jmp 1016e8 + +00101cc3 : + 101cc3: 6a 00 push $0x0 + 101cc5: 6a 24 push $0x24 + 101cc7: 0f a8 push %gs + 101cc9: 0f a0 push %fs + 101ccb: 06 push %es + 101ccc: 1e push %ds + 101ccd: 60 pusha + 101cce: 66 b8 10 00 mov $0x10,%ax + 101cd2: 8e d8 mov %eax,%ds + 101cd4: 8e c0 mov %eax,%es + 101cd6: 8e e0 mov %eax,%fs + 101cd8: 8e e8 mov %eax,%gs + 101cda: 89 e0 mov %esp,%eax + 101cdc: 50 push %eax + +00101cdd : + 101cdd: b8 04 3e 10 00 mov $0x103e04,%eax + 101ce2: ff d0 call *%eax + 101ce4: e9 ff f9 ff ff jmp 1016e8 + +00101ce9 : + 101ce9: 6a 00 push $0x0 + 101ceb: 6a 25 push $0x25 + 101ced: 0f a8 push %gs + 101cef: 0f a0 push %fs + 101cf1: 06 push %es + 101cf2: 1e push %ds + 101cf3: 60 pusha + 101cf4: 66 b8 10 00 mov $0x10,%ax + 101cf8: 8e d8 mov %eax,%ds + 101cfa: 8e c0 mov %eax,%es + 101cfc: 8e e0 mov %eax,%fs + 101cfe: 8e e8 mov %eax,%gs + 101d00: 89 e0 mov %esp,%eax + 101d02: 50 push %eax + +00101d03 : + 101d03: b8 04 3e 10 00 mov $0x103e04,%eax + 101d08: ff d0 call *%eax + 101d0a: e9 d9 f9 ff ff jmp 1016e8 + +00101d0f : + 101d0f: 6a 00 push $0x0 + 101d11: 6a 26 push $0x26 + 101d13: 0f a8 push %gs + 101d15: 0f a0 push %fs + 101d17: 06 push %es + 101d18: 1e push %ds + 101d19: 60 pusha + 101d1a: 66 b8 10 00 mov $0x10,%ax + 101d1e: 8e d8 mov %eax,%ds + 101d20: 8e c0 mov %eax,%es + 101d22: 8e e0 mov %eax,%fs + 101d24: 8e e8 mov %eax,%gs + 101d26: 89 e0 mov %esp,%eax + 101d28: 50 push %eax + +00101d29 : + 101d29: b8 04 3e 10 00 mov $0x103e04,%eax + 101d2e: ff d0 call *%eax + 101d30: e9 b3 f9 ff ff jmp 1016e8 + +00101d35 : + 101d35: 6a 00 push $0x0 + 101d37: 6a 27 push $0x27 + 101d39: 0f a8 push %gs + 101d3b: 0f a0 push %fs + 101d3d: 06 push %es + 101d3e: 1e push %ds + 101d3f: 60 pusha + 101d40: 66 b8 10 00 mov $0x10,%ax + 101d44: 8e d8 mov %eax,%ds + 101d46: 8e c0 mov %eax,%es + 101d48: 8e e0 mov %eax,%fs + 101d4a: 8e e8 mov %eax,%gs + 101d4c: 89 e0 mov %esp,%eax + 101d4e: 50 push %eax + +00101d4f : + 101d4f: b8 04 3e 10 00 mov $0x103e04,%eax + 101d54: ff d0 call *%eax + 101d56: e9 8d f9 ff ff jmp 1016e8 + +00101d5b : + 101d5b: 6a 00 push $0x0 + 101d5d: 6a 28 push $0x28 + 101d5f: 0f a8 push %gs + 101d61: 0f a0 push %fs + 101d63: 06 push %es + 101d64: 1e push %ds + 101d65: 60 pusha + 101d66: 66 b8 10 00 mov $0x10,%ax + 101d6a: 8e d8 mov %eax,%ds + 101d6c: 8e c0 mov %eax,%es + 101d6e: 8e e0 mov %eax,%fs + 101d70: 8e e8 mov %eax,%gs + 101d72: 89 e0 mov %esp,%eax + 101d74: 50 push %eax + +00101d75 : + 101d75: b8 04 3e 10 00 mov $0x103e04,%eax + 101d7a: ff d0 call *%eax + 101d7c: e9 67 f9 ff ff jmp 1016e8 + +00101d81 : + 101d81: 6a 00 push $0x0 + 101d83: 6a 29 push $0x29 + 101d85: 0f a8 push %gs + 101d87: 0f a0 push %fs + 101d89: 06 push %es + 101d8a: 1e push %ds + 101d8b: 60 pusha + 101d8c: 66 b8 10 00 mov $0x10,%ax + 101d90: 8e d8 mov %eax,%ds + 101d92: 8e c0 mov %eax,%es + 101d94: 8e e0 mov %eax,%fs + 101d96: 8e e8 mov %eax,%gs + 101d98: 89 e0 mov %esp,%eax + 101d9a: 50 push %eax + +00101d9b : + 101d9b: b8 04 3e 10 00 mov $0x103e04,%eax + 101da0: ff d0 call *%eax + 101da2: e9 41 f9 ff ff jmp 1016e8 + +00101da7 : + 101da7: 6a 00 push $0x0 + 101da9: 6a 2a push $0x2a + 101dab: 0f a8 push %gs + 101dad: 0f a0 push %fs + 101daf: 06 push %es + 101db0: 1e push %ds + 101db1: 60 pusha + 101db2: 66 b8 10 00 mov $0x10,%ax + 101db6: 8e d8 mov %eax,%ds + 101db8: 8e c0 mov %eax,%es + 101dba: 8e e0 mov %eax,%fs + 101dbc: 8e e8 mov %eax,%gs + 101dbe: 89 e0 mov %esp,%eax + 101dc0: 50 push %eax + +00101dc1 : + 101dc1: b8 04 3e 10 00 mov $0x103e04,%eax + 101dc6: ff d0 call *%eax + 101dc8: e9 1b f9 ff ff jmp 1016e8 + +00101dcd : + 101dcd: 6a 00 push $0x0 + 101dcf: 6a 2b push $0x2b + 101dd1: 0f a8 push %gs + 101dd3: 0f a0 push %fs + 101dd5: 06 push %es + 101dd6: 1e push %ds + 101dd7: 60 pusha + 101dd8: 66 b8 10 00 mov $0x10,%ax + 101ddc: 8e d8 mov %eax,%ds + 101dde: 8e c0 mov %eax,%es + 101de0: 8e e0 mov %eax,%fs + 101de2: 8e e8 mov %eax,%gs + 101de4: 89 e0 mov %esp,%eax + 101de6: 50 push %eax + +00101de7 : + 101de7: b8 04 3e 10 00 mov $0x103e04,%eax + 101dec: ff d0 call *%eax + 101dee: e9 f5 f8 ff ff jmp 1016e8 + +00101df3 : + 101df3: 6a 00 push $0x0 + 101df5: 6a 2c push $0x2c + 101df7: 0f a8 push %gs + 101df9: 0f a0 push %fs + 101dfb: 06 push %es + 101dfc: 1e push %ds + 101dfd: 60 pusha + 101dfe: 66 b8 10 00 mov $0x10,%ax + 101e02: 8e d8 mov %eax,%ds + 101e04: 8e c0 mov %eax,%es + 101e06: 8e e0 mov %eax,%fs + 101e08: 8e e8 mov %eax,%gs + 101e0a: 89 e0 mov %esp,%eax + 101e0c: 50 push %eax + +00101e0d : + 101e0d: b8 04 3e 10 00 mov $0x103e04,%eax + 101e12: ff d0 call *%eax + 101e14: e9 cf f8 ff ff jmp 1016e8 + +00101e19 : + 101e19: 6a 00 push $0x0 + 101e1b: 6a 2d push $0x2d + 101e1d: 0f a8 push %gs + 101e1f: 0f a0 push %fs + 101e21: 06 push %es + 101e22: 1e push %ds + 101e23: 60 pusha + 101e24: 66 b8 10 00 mov $0x10,%ax + 101e28: 8e d8 mov %eax,%ds + 101e2a: 8e c0 mov %eax,%es + 101e2c: 8e e0 mov %eax,%fs + 101e2e: 8e e8 mov %eax,%gs + 101e30: 89 e0 mov %esp,%eax + 101e32: 50 push %eax + +00101e33 : + 101e33: b8 04 3e 10 00 mov $0x103e04,%eax + 101e38: ff d0 call *%eax + 101e3a: e9 a9 f8 ff ff jmp 1016e8 + +00101e3f : + 101e3f: 6a 00 push $0x0 + 101e41: 6a 2e push $0x2e + 101e43: 0f a8 push %gs + 101e45: 0f a0 push %fs + 101e47: 06 push %es + 101e48: 1e push %ds + 101e49: 60 pusha + 101e4a: 66 b8 10 00 mov $0x10,%ax + 101e4e: 8e d8 mov %eax,%ds + 101e50: 8e c0 mov %eax,%es + 101e52: 8e e0 mov %eax,%fs + 101e54: 8e e8 mov %eax,%gs + 101e56: 89 e0 mov %esp,%eax + 101e58: 50 push %eax + +00101e59 : + 101e59: b8 04 3e 10 00 mov $0x103e04,%eax + 101e5e: ff d0 call *%eax + 101e60: e9 83 f8 ff ff jmp 1016e8 + +00101e65 : + 101e65: 6a 00 push $0x0 + 101e67: 6a 2f push $0x2f + 101e69: 0f a8 push %gs + 101e6b: 0f a0 push %fs + 101e6d: 06 push %es + 101e6e: 1e push %ds + 101e6f: 60 pusha + 101e70: 66 b8 10 00 mov $0x10,%ax + 101e74: 8e d8 mov %eax,%ds + 101e76: 8e c0 mov %eax,%es + 101e78: 8e e0 mov %eax,%fs + 101e7a: 8e e8 mov %eax,%gs + 101e7c: 89 e0 mov %esp,%eax + 101e7e: 50 push %eax + +00101e7f : + 101e7f: b8 04 3e 10 00 mov $0x103e04,%eax + 101e84: ff d0 call *%eax + 101e86: e9 5d f8 ff ff jmp 1016e8 + +00101e8b : + 101e8b: 6a 00 push $0x0 + 101e8d: 6a 30 push $0x30 + 101e8f: 0f a8 push %gs + 101e91: 0f a0 push %fs + 101e93: 06 push %es + 101e94: 1e push %ds + 101e95: 60 pusha + 101e96: 66 b8 10 00 mov $0x10,%ax + 101e9a: 8e d8 mov %eax,%ds + 101e9c: 8e c0 mov %eax,%es + 101e9e: 8e e0 mov %eax,%fs + 101ea0: 8e e8 mov %eax,%gs + 101ea2: 89 e0 mov %esp,%eax + 101ea4: 50 push %eax + +00101ea5 : + 101ea5: b8 04 3e 10 00 mov $0x103e04,%eax + 101eaa: ff d0 call *%eax + 101eac: e9 37 f8 ff ff jmp 1016e8 + +00101eb1 : + 101eb1: 6a 00 push $0x0 + 101eb3: 6a 31 push $0x31 + 101eb5: 0f a8 push %gs + 101eb7: 0f a0 push %fs + 101eb9: 06 push %es + 101eba: 1e push %ds + 101ebb: 60 pusha + 101ebc: 66 b8 10 00 mov $0x10,%ax + 101ec0: 8e d8 mov %eax,%ds + 101ec2: 8e c0 mov %eax,%es + 101ec4: 8e e0 mov %eax,%fs + 101ec6: 8e e8 mov %eax,%gs + 101ec8: 89 e0 mov %esp,%eax + 101eca: 50 push %eax + +00101ecb : + 101ecb: b8 04 3e 10 00 mov $0x103e04,%eax + 101ed0: ff d0 call *%eax + 101ed2: e9 11 f8 ff ff jmp 1016e8 + +00101ed7 : + 101ed7: 6a 00 push $0x0 + 101ed9: 6a 32 push $0x32 + 101edb: 0f a8 push %gs + 101edd: 0f a0 push %fs + 101edf: 06 push %es + 101ee0: 1e push %ds + 101ee1: 60 pusha + 101ee2: 66 b8 10 00 mov $0x10,%ax + 101ee6: 8e d8 mov %eax,%ds + 101ee8: 8e c0 mov %eax,%es + 101eea: 8e e0 mov %eax,%fs + 101eec: 8e e8 mov %eax,%gs + 101eee: 89 e0 mov %esp,%eax + 101ef0: 50 push %eax + +00101ef1 : + 101ef1: b8 04 3e 10 00 mov $0x103e04,%eax + 101ef6: ff d0 call *%eax + 101ef8: e9 eb f7 ff ff jmp 1016e8 + +00101efd : + 101efd: 6a 00 push $0x0 + 101eff: 6a 33 push $0x33 + 101f01: 0f a8 push %gs + 101f03: 0f a0 push %fs + 101f05: 06 push %es + 101f06: 1e push %ds + 101f07: 60 pusha + 101f08: 66 b8 10 00 mov $0x10,%ax + 101f0c: 8e d8 mov %eax,%ds + 101f0e: 8e c0 mov %eax,%es + 101f10: 8e e0 mov %eax,%fs + 101f12: 8e e8 mov %eax,%gs + 101f14: 89 e0 mov %esp,%eax + 101f16: 50 push %eax + +00101f17 : + 101f17: b8 04 3e 10 00 mov $0x103e04,%eax + 101f1c: ff d0 call *%eax + 101f1e: e9 c5 f7 ff ff jmp 1016e8 + +00101f23 : + 101f23: 6a 00 push $0x0 + 101f25: 6a 34 push $0x34 + 101f27: 0f a8 push %gs + 101f29: 0f a0 push %fs + 101f2b: 06 push %es + 101f2c: 1e push %ds + 101f2d: 60 pusha + 101f2e: 66 b8 10 00 mov $0x10,%ax + 101f32: 8e d8 mov %eax,%ds + 101f34: 8e c0 mov %eax,%es + 101f36: 8e e0 mov %eax,%fs + 101f38: 8e e8 mov %eax,%gs + 101f3a: 89 e0 mov %esp,%eax + 101f3c: 50 push %eax + +00101f3d : + 101f3d: b8 04 3e 10 00 mov $0x103e04,%eax + 101f42: ff d0 call *%eax + 101f44: e9 9f f7 ff ff jmp 1016e8 + +00101f49 : + 101f49: 6a 00 push $0x0 + 101f4b: 6a 35 push $0x35 + 101f4d: 0f a8 push %gs + 101f4f: 0f a0 push %fs + 101f51: 06 push %es + 101f52: 1e push %ds + 101f53: 60 pusha + 101f54: 66 b8 10 00 mov $0x10,%ax + 101f58: 8e d8 mov %eax,%ds + 101f5a: 8e c0 mov %eax,%es + 101f5c: 8e e0 mov %eax,%fs + 101f5e: 8e e8 mov %eax,%gs + 101f60: 89 e0 mov %esp,%eax + 101f62: 50 push %eax + +00101f63 : + 101f63: b8 04 3e 10 00 mov $0x103e04,%eax + 101f68: ff d0 call *%eax + 101f6a: e9 79 f7 ff ff jmp 1016e8 + +00101f6f : + 101f6f: 6a 00 push $0x0 + 101f71: 6a 36 push $0x36 + 101f73: 0f a8 push %gs + 101f75: 0f a0 push %fs + 101f77: 06 push %es + 101f78: 1e push %ds + 101f79: 60 pusha + 101f7a: 66 b8 10 00 mov $0x10,%ax + 101f7e: 8e d8 mov %eax,%ds + 101f80: 8e c0 mov %eax,%es + 101f82: 8e e0 mov %eax,%fs + 101f84: 8e e8 mov %eax,%gs + 101f86: 89 e0 mov %esp,%eax + 101f88: 50 push %eax + +00101f89 : + 101f89: b8 04 3e 10 00 mov $0x103e04,%eax + 101f8e: ff d0 call *%eax + 101f90: e9 53 f7 ff ff jmp 1016e8 + +00101f95 : + 101f95: 6a 00 push $0x0 + 101f97: 6a 37 push $0x37 + 101f99: 0f a8 push %gs + 101f9b: 0f a0 push %fs + 101f9d: 06 push %es + 101f9e: 1e push %ds + 101f9f: 60 pusha + 101fa0: 66 b8 10 00 mov $0x10,%ax + 101fa4: 8e d8 mov %eax,%ds + 101fa6: 8e c0 mov %eax,%es + 101fa8: 8e e0 mov %eax,%fs + 101faa: 8e e8 mov %eax,%gs + 101fac: 89 e0 mov %esp,%eax + 101fae: 50 push %eax + +00101faf : + 101faf: b8 04 3e 10 00 mov $0x103e04,%eax + 101fb4: ff d0 call *%eax + 101fb6: e9 2d f7 ff ff jmp 1016e8 + +00101fbb : + 101fbb: 6a 00 push $0x0 + 101fbd: 6a 38 push $0x38 + 101fbf: 0f a8 push %gs + 101fc1: 0f a0 push %fs + 101fc3: 06 push %es + 101fc4: 1e push %ds + 101fc5: 60 pusha + 101fc6: 66 b8 10 00 mov $0x10,%ax + 101fca: 8e d8 mov %eax,%ds + 101fcc: 8e c0 mov %eax,%es + 101fce: 8e e0 mov %eax,%fs + 101fd0: 8e e8 mov %eax,%gs + 101fd2: 89 e0 mov %esp,%eax + 101fd4: 50 push %eax + +00101fd5 : + 101fd5: b8 04 3e 10 00 mov $0x103e04,%eax + 101fda: ff d0 call *%eax + 101fdc: e9 07 f7 ff ff jmp 1016e8 + +00101fe1 : + 101fe1: 6a 00 push $0x0 + 101fe3: 6a 39 push $0x39 + 101fe5: 0f a8 push %gs + 101fe7: 0f a0 push %fs + 101fe9: 06 push %es + 101fea: 1e push %ds + 101feb: 60 pusha + 101fec: 66 b8 10 00 mov $0x10,%ax + 101ff0: 8e d8 mov %eax,%ds + 101ff2: 8e c0 mov %eax,%es + 101ff4: 8e e0 mov %eax,%fs + 101ff6: 8e e8 mov %eax,%gs + 101ff8: 89 e0 mov %esp,%eax + 101ffa: 50 push %eax + +00101ffb : + 101ffb: b8 04 3e 10 00 mov $0x103e04,%eax + 102000: ff d0 call *%eax + 102002: e9 e1 f6 ff ff jmp 1016e8 + +00102007 : + 102007: 6a 00 push $0x0 + 102009: 6a 3a push $0x3a + 10200b: 0f a8 push %gs + 10200d: 0f a0 push %fs + 10200f: 06 push %es + 102010: 1e push %ds + 102011: 60 pusha + 102012: 66 b8 10 00 mov $0x10,%ax + 102016: 8e d8 mov %eax,%ds + 102018: 8e c0 mov %eax,%es + 10201a: 8e e0 mov %eax,%fs + 10201c: 8e e8 mov %eax,%gs + 10201e: 89 e0 mov %esp,%eax + 102020: 50 push %eax + +00102021 : + 102021: b8 04 3e 10 00 mov $0x103e04,%eax + 102026: ff d0 call *%eax + 102028: e9 bb f6 ff ff jmp 1016e8 + +0010202d : + 10202d: 6a 00 push $0x0 + 10202f: 6a 3b push $0x3b + 102031: 0f a8 push %gs + 102033: 0f a0 push %fs + 102035: 06 push %es + 102036: 1e push %ds + 102037: 60 pusha + 102038: 66 b8 10 00 mov $0x10,%ax + 10203c: 8e d8 mov %eax,%ds + 10203e: 8e c0 mov %eax,%es + 102040: 8e e0 mov %eax,%fs + 102042: 8e e8 mov %eax,%gs + 102044: 89 e0 mov %esp,%eax + 102046: 50 push %eax + +00102047 : + 102047: b8 04 3e 10 00 mov $0x103e04,%eax + 10204c: ff d0 call *%eax + 10204e: e9 95 f6 ff ff jmp 1016e8 + +00102053 : + 102053: 6a 00 push $0x0 + 102055: 6a 3c push $0x3c + 102057: 0f a8 push %gs + 102059: 0f a0 push %fs + 10205b: 06 push %es + 10205c: 1e push %ds + 10205d: 60 pusha + 10205e: 66 b8 10 00 mov $0x10,%ax + 102062: 8e d8 mov %eax,%ds + 102064: 8e c0 mov %eax,%es + 102066: 8e e0 mov %eax,%fs + 102068: 8e e8 mov %eax,%gs + 10206a: 89 e0 mov %esp,%eax + 10206c: 50 push %eax + +0010206d : + 10206d: b8 04 3e 10 00 mov $0x103e04,%eax + 102072: ff d0 call *%eax + 102074: e9 6f f6 ff ff jmp 1016e8 + +00102079 : + 102079: 6a 00 push $0x0 + 10207b: 6a 3d push $0x3d + 10207d: 0f a8 push %gs + 10207f: 0f a0 push %fs + 102081: 06 push %es + 102082: 1e push %ds + 102083: 60 pusha + 102084: 66 b8 10 00 mov $0x10,%ax + 102088: 8e d8 mov %eax,%ds + 10208a: 8e c0 mov %eax,%es + 10208c: 8e e0 mov %eax,%fs + 10208e: 8e e8 mov %eax,%gs + 102090: 89 e0 mov %esp,%eax + 102092: 50 push %eax + +00102093 : + 102093: b8 04 3e 10 00 mov $0x103e04,%eax + 102098: ff d0 call *%eax + 10209a: e9 49 f6 ff ff jmp 1016e8 + +0010209f : + 10209f: 6a 00 push $0x0 + 1020a1: 6a 3e push $0x3e + 1020a3: 0f a8 push %gs + 1020a5: 0f a0 push %fs + 1020a7: 06 push %es + 1020a8: 1e push %ds + 1020a9: 60 pusha + 1020aa: 66 b8 10 00 mov $0x10,%ax + 1020ae: 8e d8 mov %eax,%ds + 1020b0: 8e c0 mov %eax,%es + 1020b2: 8e e0 mov %eax,%fs + 1020b4: 8e e8 mov %eax,%gs + 1020b6: 89 e0 mov %esp,%eax + 1020b8: 50 push %eax + +001020b9 : + 1020b9: b8 04 3e 10 00 mov $0x103e04,%eax + 1020be: ff d0 call *%eax + 1020c0: e9 23 f6 ff ff jmp 1016e8 + +001020c5 : + 1020c5: 6a 00 push $0x0 + 1020c7: 6a 3f push $0x3f + 1020c9: 0f a8 push %gs + 1020cb: 0f a0 push %fs + 1020cd: 06 push %es + 1020ce: 1e push %ds + 1020cf: 60 pusha + 1020d0: 66 b8 10 00 mov $0x10,%ax + 1020d4: 8e d8 mov %eax,%ds + 1020d6: 8e c0 mov %eax,%es + 1020d8: 8e e0 mov %eax,%fs + 1020da: 8e e8 mov %eax,%gs + 1020dc: 89 e0 mov %esp,%eax + 1020de: 50 push %eax + +001020df : + 1020df: b8 04 3e 10 00 mov $0x103e04,%eax + 1020e4: ff d0 call *%eax + 1020e6: e9 fd f5 ff ff jmp 1016e8 + +001020eb : + 1020eb: 6a 00 push $0x0 + 1020ed: 6a 40 push $0x40 + 1020ef: 0f a8 push %gs + 1020f1: 0f a0 push %fs + 1020f3: 06 push %es + 1020f4: 1e push %ds + 1020f5: 60 pusha + 1020f6: 66 b8 10 00 mov $0x10,%ax + 1020fa: 8e d8 mov %eax,%ds + 1020fc: 8e c0 mov %eax,%es + 1020fe: 8e e0 mov %eax,%fs + 102100: 8e e8 mov %eax,%gs + 102102: 89 e0 mov %esp,%eax + 102104: 50 push %eax + +00102105 : + 102105: b8 04 3e 10 00 mov $0x103e04,%eax + 10210a: ff d0 call *%eax + 10210c: e9 d7 f5 ff ff jmp 1016e8 + +00102111 : + 102111: 6a 00 push $0x0 + 102113: 6a 41 push $0x41 + 102115: 0f a8 push %gs + 102117: 0f a0 push %fs + 102119: 06 push %es + 10211a: 1e push %ds + 10211b: 60 pusha + 10211c: 66 b8 10 00 mov $0x10,%ax + 102120: 8e d8 mov %eax,%ds + 102122: 8e c0 mov %eax,%es + 102124: 8e e0 mov %eax,%fs + 102126: 8e e8 mov %eax,%gs + 102128: 89 e0 mov %esp,%eax + 10212a: 50 push %eax + +0010212b : + 10212b: b8 04 3e 10 00 mov $0x103e04,%eax + 102130: ff d0 call *%eax + 102132: e9 b1 f5 ff ff jmp 1016e8 + +00102137 : + 102137: 6a 00 push $0x0 + 102139: 6a 42 push $0x42 + 10213b: 0f a8 push %gs + 10213d: 0f a0 push %fs + 10213f: 06 push %es + 102140: 1e push %ds + 102141: 60 pusha + 102142: 66 b8 10 00 mov $0x10,%ax + 102146: 8e d8 mov %eax,%ds + 102148: 8e c0 mov %eax,%es + 10214a: 8e e0 mov %eax,%fs + 10214c: 8e e8 mov %eax,%gs + 10214e: 89 e0 mov %esp,%eax + 102150: 50 push %eax + +00102151 : + 102151: b8 04 3e 10 00 mov $0x103e04,%eax + 102156: ff d0 call *%eax + 102158: e9 8b f5 ff ff jmp 1016e8 + +0010215d : + 10215d: 6a 00 push $0x0 + 10215f: 6a 43 push $0x43 + 102161: 0f a8 push %gs + 102163: 0f a0 push %fs + 102165: 06 push %es + 102166: 1e push %ds + 102167: 60 pusha + 102168: 66 b8 10 00 mov $0x10,%ax + 10216c: 8e d8 mov %eax,%ds + 10216e: 8e c0 mov %eax,%es + 102170: 8e e0 mov %eax,%fs + 102172: 8e e8 mov %eax,%gs + 102174: 89 e0 mov %esp,%eax + 102176: 50 push %eax + +00102177 : + 102177: b8 04 3e 10 00 mov $0x103e04,%eax + 10217c: ff d0 call *%eax + 10217e: e9 65 f5 ff ff jmp 1016e8 + +00102183 : + 102183: 6a 00 push $0x0 + 102185: 6a 44 push $0x44 + 102187: 0f a8 push %gs + 102189: 0f a0 push %fs + 10218b: 06 push %es + 10218c: 1e push %ds + 10218d: 60 pusha + 10218e: 66 b8 10 00 mov $0x10,%ax + 102192: 8e d8 mov %eax,%ds + 102194: 8e c0 mov %eax,%es + 102196: 8e e0 mov %eax,%fs + 102198: 8e e8 mov %eax,%gs + 10219a: 89 e0 mov %esp,%eax + 10219c: 50 push %eax + +0010219d : + 10219d: b8 04 3e 10 00 mov $0x103e04,%eax + 1021a2: ff d0 call *%eax + 1021a4: e9 3f f5 ff ff jmp 1016e8 + +001021a9 : + 1021a9: 6a 00 push $0x0 + 1021ab: 6a 45 push $0x45 + 1021ad: 0f a8 push %gs + 1021af: 0f a0 push %fs + 1021b1: 06 push %es + 1021b2: 1e push %ds + 1021b3: 60 pusha + 1021b4: 66 b8 10 00 mov $0x10,%ax + 1021b8: 8e d8 mov %eax,%ds + 1021ba: 8e c0 mov %eax,%es + 1021bc: 8e e0 mov %eax,%fs + 1021be: 8e e8 mov %eax,%gs + 1021c0: 89 e0 mov %esp,%eax + 1021c2: 50 push %eax + +001021c3 : + 1021c3: b8 04 3e 10 00 mov $0x103e04,%eax + 1021c8: ff d0 call *%eax + 1021ca: e9 19 f5 ff ff jmp 1016e8 + +001021cf : + 1021cf: 6a 00 push $0x0 + 1021d1: 6a 46 push $0x46 + 1021d3: 0f a8 push %gs + 1021d5: 0f a0 push %fs + 1021d7: 06 push %es + 1021d8: 1e push %ds + 1021d9: 60 pusha + 1021da: 66 b8 10 00 mov $0x10,%ax + 1021de: 8e d8 mov %eax,%ds + 1021e0: 8e c0 mov %eax,%es + 1021e2: 8e e0 mov %eax,%fs + 1021e4: 8e e8 mov %eax,%gs + 1021e6: 89 e0 mov %esp,%eax + 1021e8: 50 push %eax + +001021e9 : + 1021e9: b8 04 3e 10 00 mov $0x103e04,%eax + 1021ee: ff d0 call *%eax + 1021f0: e9 f3 f4 ff ff jmp 1016e8 + +001021f5 : + 1021f5: 6a 00 push $0x0 + 1021f7: 6a 47 push $0x47 + 1021f9: 0f a8 push %gs + 1021fb: 0f a0 push %fs + 1021fd: 06 push %es + 1021fe: 1e push %ds + 1021ff: 60 pusha + 102200: 66 b8 10 00 mov $0x10,%ax + 102204: 8e d8 mov %eax,%ds + 102206: 8e c0 mov %eax,%es + 102208: 8e e0 mov %eax,%fs + 10220a: 8e e8 mov %eax,%gs + 10220c: 89 e0 mov %esp,%eax + 10220e: 50 push %eax + +0010220f : + 10220f: b8 04 3e 10 00 mov $0x103e04,%eax + 102214: ff d0 call *%eax + 102216: e9 cd f4 ff ff jmp 1016e8 + +0010221b : + 10221b: 6a 00 push $0x0 + 10221d: 6a 48 push $0x48 + 10221f: 0f a8 push %gs + 102221: 0f a0 push %fs + 102223: 06 push %es + 102224: 1e push %ds + 102225: 60 pusha + 102226: 66 b8 10 00 mov $0x10,%ax + 10222a: 8e d8 mov %eax,%ds + 10222c: 8e c0 mov %eax,%es + 10222e: 8e e0 mov %eax,%fs + 102230: 8e e8 mov %eax,%gs + 102232: 89 e0 mov %esp,%eax + 102234: 50 push %eax + +00102235 : + 102235: b8 04 3e 10 00 mov $0x103e04,%eax + 10223a: ff d0 call *%eax + 10223c: e9 a7 f4 ff ff jmp 1016e8 + +00102241 : + 102241: 6a 00 push $0x0 + 102243: 6a 49 push $0x49 + 102245: 0f a8 push %gs + 102247: 0f a0 push %fs + 102249: 06 push %es + 10224a: 1e push %ds + 10224b: 60 pusha + 10224c: 66 b8 10 00 mov $0x10,%ax + 102250: 8e d8 mov %eax,%ds + 102252: 8e c0 mov %eax,%es + 102254: 8e e0 mov %eax,%fs + 102256: 8e e8 mov %eax,%gs + 102258: 89 e0 mov %esp,%eax + 10225a: 50 push %eax + +0010225b : + 10225b: b8 04 3e 10 00 mov $0x103e04,%eax + 102260: ff d0 call *%eax + 102262: e9 81 f4 ff ff jmp 1016e8 + +00102267 : + 102267: 6a 00 push $0x0 + 102269: 6a 4a push $0x4a + 10226b: 0f a8 push %gs + 10226d: 0f a0 push %fs + 10226f: 06 push %es + 102270: 1e push %ds + 102271: 60 pusha + 102272: 66 b8 10 00 mov $0x10,%ax + 102276: 8e d8 mov %eax,%ds + 102278: 8e c0 mov %eax,%es + 10227a: 8e e0 mov %eax,%fs + 10227c: 8e e8 mov %eax,%gs + 10227e: 89 e0 mov %esp,%eax + 102280: 50 push %eax + +00102281 : + 102281: b8 04 3e 10 00 mov $0x103e04,%eax + 102286: ff d0 call *%eax + 102288: e9 5b f4 ff ff jmp 1016e8 + +0010228d : + 10228d: 6a 00 push $0x0 + 10228f: 6a 4b push $0x4b + 102291: 0f a8 push %gs + 102293: 0f a0 push %fs + 102295: 06 push %es + 102296: 1e push %ds + 102297: 60 pusha + 102298: 66 b8 10 00 mov $0x10,%ax + 10229c: 8e d8 mov %eax,%ds + 10229e: 8e c0 mov %eax,%es + 1022a0: 8e e0 mov %eax,%fs + 1022a2: 8e e8 mov %eax,%gs + 1022a4: 89 e0 mov %esp,%eax + 1022a6: 50 push %eax + +001022a7 : + 1022a7: b8 04 3e 10 00 mov $0x103e04,%eax + 1022ac: ff d0 call *%eax + 1022ae: e9 35 f4 ff ff jmp 1016e8 + +001022b3 : + 1022b3: 6a 00 push $0x0 + 1022b5: 6a 4c push $0x4c + 1022b7: 0f a8 push %gs + 1022b9: 0f a0 push %fs + 1022bb: 06 push %es + 1022bc: 1e push %ds + 1022bd: 60 pusha + 1022be: 66 b8 10 00 mov $0x10,%ax + 1022c2: 8e d8 mov %eax,%ds + 1022c4: 8e c0 mov %eax,%es + 1022c6: 8e e0 mov %eax,%fs + 1022c8: 8e e8 mov %eax,%gs + 1022ca: 89 e0 mov %esp,%eax + 1022cc: 50 push %eax + +001022cd : + 1022cd: b8 04 3e 10 00 mov $0x103e04,%eax + 1022d2: ff d0 call *%eax + 1022d4: e9 0f f4 ff ff jmp 1016e8 + +001022d9 : + 1022d9: 6a 00 push $0x0 + 1022db: 6a 4d push $0x4d + 1022dd: 0f a8 push %gs + 1022df: 0f a0 push %fs + 1022e1: 06 push %es + 1022e2: 1e push %ds + 1022e3: 60 pusha + 1022e4: 66 b8 10 00 mov $0x10,%ax + 1022e8: 8e d8 mov %eax,%ds + 1022ea: 8e c0 mov %eax,%es + 1022ec: 8e e0 mov %eax,%fs + 1022ee: 8e e8 mov %eax,%gs + 1022f0: 89 e0 mov %esp,%eax + 1022f2: 50 push %eax + +001022f3 : + 1022f3: b8 04 3e 10 00 mov $0x103e04,%eax + 1022f8: ff d0 call *%eax + 1022fa: e9 e9 f3 ff ff jmp 1016e8 + +001022ff : + 1022ff: 6a 00 push $0x0 + 102301: 6a 4e push $0x4e + 102303: 0f a8 push %gs + 102305: 0f a0 push %fs + 102307: 06 push %es + 102308: 1e push %ds + 102309: 60 pusha + 10230a: 66 b8 10 00 mov $0x10,%ax + 10230e: 8e d8 mov %eax,%ds + 102310: 8e c0 mov %eax,%es + 102312: 8e e0 mov %eax,%fs + 102314: 8e e8 mov %eax,%gs + 102316: 89 e0 mov %esp,%eax + 102318: 50 push %eax + +00102319 : + 102319: b8 04 3e 10 00 mov $0x103e04,%eax + 10231e: ff d0 call *%eax + 102320: e9 c3 f3 ff ff jmp 1016e8 + +00102325 : + 102325: 6a 00 push $0x0 + 102327: 6a 4f push $0x4f + 102329: 0f a8 push %gs + 10232b: 0f a0 push %fs + 10232d: 06 push %es + 10232e: 1e push %ds + 10232f: 60 pusha + 102330: 66 b8 10 00 mov $0x10,%ax + 102334: 8e d8 mov %eax,%ds + 102336: 8e c0 mov %eax,%es + 102338: 8e e0 mov %eax,%fs + 10233a: 8e e8 mov %eax,%gs + 10233c: 89 e0 mov %esp,%eax + 10233e: 50 push %eax + +0010233f : + 10233f: b8 04 3e 10 00 mov $0x103e04,%eax + 102344: ff d0 call *%eax + 102346: e9 9d f3 ff ff jmp 1016e8 + +0010234b : + 10234b: 6a 00 push $0x0 + 10234d: 6a 50 push $0x50 + 10234f: 0f a8 push %gs + 102351: 0f a0 push %fs + 102353: 06 push %es + 102354: 1e push %ds + 102355: 60 pusha + 102356: 66 b8 10 00 mov $0x10,%ax + 10235a: 8e d8 mov %eax,%ds + 10235c: 8e c0 mov %eax,%es + 10235e: 8e e0 mov %eax,%fs + 102360: 8e e8 mov %eax,%gs + 102362: 89 e0 mov %esp,%eax + 102364: 50 push %eax + +00102365 : + 102365: b8 04 3e 10 00 mov $0x103e04,%eax + 10236a: ff d0 call *%eax + 10236c: e9 77 f3 ff ff jmp 1016e8 + +00102371 : + 102371: 6a 00 push $0x0 + 102373: 6a 51 push $0x51 + 102375: 0f a8 push %gs + 102377: 0f a0 push %fs + 102379: 06 push %es + 10237a: 1e push %ds + 10237b: 60 pusha + 10237c: 66 b8 10 00 mov $0x10,%ax + 102380: 8e d8 mov %eax,%ds + 102382: 8e c0 mov %eax,%es + 102384: 8e e0 mov %eax,%fs + 102386: 8e e8 mov %eax,%gs + 102388: 89 e0 mov %esp,%eax + 10238a: 50 push %eax + +0010238b : + 10238b: b8 04 3e 10 00 mov $0x103e04,%eax + 102390: ff d0 call *%eax + 102392: e9 51 f3 ff ff jmp 1016e8 + +00102397 : + 102397: 6a 00 push $0x0 + 102399: 6a 52 push $0x52 + 10239b: 0f a8 push %gs + 10239d: 0f a0 push %fs + 10239f: 06 push %es + 1023a0: 1e push %ds + 1023a1: 60 pusha + 1023a2: 66 b8 10 00 mov $0x10,%ax + 1023a6: 8e d8 mov %eax,%ds + 1023a8: 8e c0 mov %eax,%es + 1023aa: 8e e0 mov %eax,%fs + 1023ac: 8e e8 mov %eax,%gs + 1023ae: 89 e0 mov %esp,%eax + 1023b0: 50 push %eax + +001023b1 : + 1023b1: b8 04 3e 10 00 mov $0x103e04,%eax + 1023b6: ff d0 call *%eax + 1023b8: e9 2b f3 ff ff jmp 1016e8 + +001023bd : + 1023bd: 6a 00 push $0x0 + 1023bf: 6a 53 push $0x53 + 1023c1: 0f a8 push %gs + 1023c3: 0f a0 push %fs + 1023c5: 06 push %es + 1023c6: 1e push %ds + 1023c7: 60 pusha + 1023c8: 66 b8 10 00 mov $0x10,%ax + 1023cc: 8e d8 mov %eax,%ds + 1023ce: 8e c0 mov %eax,%es + 1023d0: 8e e0 mov %eax,%fs + 1023d2: 8e e8 mov %eax,%gs + 1023d4: 89 e0 mov %esp,%eax + 1023d6: 50 push %eax + +001023d7 : + 1023d7: b8 04 3e 10 00 mov $0x103e04,%eax + 1023dc: ff d0 call *%eax + 1023de: e9 05 f3 ff ff jmp 1016e8 + +001023e3 : + 1023e3: 6a 00 push $0x0 + 1023e5: 6a 54 push $0x54 + 1023e7: 0f a8 push %gs + 1023e9: 0f a0 push %fs + 1023eb: 06 push %es + 1023ec: 1e push %ds + 1023ed: 60 pusha + 1023ee: 66 b8 10 00 mov $0x10,%ax + 1023f2: 8e d8 mov %eax,%ds + 1023f4: 8e c0 mov %eax,%es + 1023f6: 8e e0 mov %eax,%fs + 1023f8: 8e e8 mov %eax,%gs + 1023fa: 89 e0 mov %esp,%eax + 1023fc: 50 push %eax + +001023fd : + 1023fd: b8 04 3e 10 00 mov $0x103e04,%eax + 102402: ff d0 call *%eax + 102404: e9 df f2 ff ff jmp 1016e8 + +00102409 : + 102409: 6a 00 push $0x0 + 10240b: 6a 55 push $0x55 + 10240d: 0f a8 push %gs + 10240f: 0f a0 push %fs + 102411: 06 push %es + 102412: 1e push %ds + 102413: 60 pusha + 102414: 66 b8 10 00 mov $0x10,%ax + 102418: 8e d8 mov %eax,%ds + 10241a: 8e c0 mov %eax,%es + 10241c: 8e e0 mov %eax,%fs + 10241e: 8e e8 mov %eax,%gs + 102420: 89 e0 mov %esp,%eax + 102422: 50 push %eax + +00102423 : + 102423: b8 04 3e 10 00 mov $0x103e04,%eax + 102428: ff d0 call *%eax + 10242a: e9 b9 f2 ff ff jmp 1016e8 + +0010242f : + 10242f: 6a 00 push $0x0 + 102431: 6a 56 push $0x56 + 102433: 0f a8 push %gs + 102435: 0f a0 push %fs + 102437: 06 push %es + 102438: 1e push %ds + 102439: 60 pusha + 10243a: 66 b8 10 00 mov $0x10,%ax + 10243e: 8e d8 mov %eax,%ds + 102440: 8e c0 mov %eax,%es + 102442: 8e e0 mov %eax,%fs + 102444: 8e e8 mov %eax,%gs + 102446: 89 e0 mov %esp,%eax + 102448: 50 push %eax + +00102449 : + 102449: b8 04 3e 10 00 mov $0x103e04,%eax + 10244e: ff d0 call *%eax + 102450: e9 93 f2 ff ff jmp 1016e8 + +00102455 : + 102455: 6a 00 push $0x0 + 102457: 6a 57 push $0x57 + 102459: 0f a8 push %gs + 10245b: 0f a0 push %fs + 10245d: 06 push %es + 10245e: 1e push %ds + 10245f: 60 pusha + 102460: 66 b8 10 00 mov $0x10,%ax + 102464: 8e d8 mov %eax,%ds + 102466: 8e c0 mov %eax,%es + 102468: 8e e0 mov %eax,%fs + 10246a: 8e e8 mov %eax,%gs + 10246c: 89 e0 mov %esp,%eax + 10246e: 50 push %eax + +0010246f : + 10246f: b8 04 3e 10 00 mov $0x103e04,%eax + 102474: ff d0 call *%eax + 102476: e9 6d f2 ff ff jmp 1016e8 + +0010247b : + 10247b: 6a 00 push $0x0 + 10247d: 6a 58 push $0x58 + 10247f: 0f a8 push %gs + 102481: 0f a0 push %fs + 102483: 06 push %es + 102484: 1e push %ds + 102485: 60 pusha + 102486: 66 b8 10 00 mov $0x10,%ax + 10248a: 8e d8 mov %eax,%ds + 10248c: 8e c0 mov %eax,%es + 10248e: 8e e0 mov %eax,%fs + 102490: 8e e8 mov %eax,%gs + 102492: 89 e0 mov %esp,%eax + 102494: 50 push %eax + +00102495 : + 102495: b8 04 3e 10 00 mov $0x103e04,%eax + 10249a: ff d0 call *%eax + 10249c: e9 47 f2 ff ff jmp 1016e8 + +001024a1 : + 1024a1: 6a 00 push $0x0 + 1024a3: 6a 59 push $0x59 + 1024a5: 0f a8 push %gs + 1024a7: 0f a0 push %fs + 1024a9: 06 push %es + 1024aa: 1e push %ds + 1024ab: 60 pusha + 1024ac: 66 b8 10 00 mov $0x10,%ax + 1024b0: 8e d8 mov %eax,%ds + 1024b2: 8e c0 mov %eax,%es + 1024b4: 8e e0 mov %eax,%fs + 1024b6: 8e e8 mov %eax,%gs + 1024b8: 89 e0 mov %esp,%eax + 1024ba: 50 push %eax + +001024bb : + 1024bb: b8 04 3e 10 00 mov $0x103e04,%eax + 1024c0: ff d0 call *%eax + 1024c2: e9 21 f2 ff ff jmp 1016e8 + +001024c7 : + 1024c7: 6a 00 push $0x0 + 1024c9: 6a 5a push $0x5a + 1024cb: 0f a8 push %gs + 1024cd: 0f a0 push %fs + 1024cf: 06 push %es + 1024d0: 1e push %ds + 1024d1: 60 pusha + 1024d2: 66 b8 10 00 mov $0x10,%ax + 1024d6: 8e d8 mov %eax,%ds + 1024d8: 8e c0 mov %eax,%es + 1024da: 8e e0 mov %eax,%fs + 1024dc: 8e e8 mov %eax,%gs + 1024de: 89 e0 mov %esp,%eax + 1024e0: 50 push %eax + +001024e1 : + 1024e1: b8 04 3e 10 00 mov $0x103e04,%eax + 1024e6: ff d0 call *%eax + 1024e8: e9 fb f1 ff ff jmp 1016e8 + +001024ed : + 1024ed: 6a 00 push $0x0 + 1024ef: 6a 5b push $0x5b + 1024f1: 0f a8 push %gs + 1024f3: 0f a0 push %fs + 1024f5: 06 push %es + 1024f6: 1e push %ds + 1024f7: 60 pusha + 1024f8: 66 b8 10 00 mov $0x10,%ax + 1024fc: 8e d8 mov %eax,%ds + 1024fe: 8e c0 mov %eax,%es + 102500: 8e e0 mov %eax,%fs + 102502: 8e e8 mov %eax,%gs + 102504: 89 e0 mov %esp,%eax + 102506: 50 push %eax + +00102507 : + 102507: b8 04 3e 10 00 mov $0x103e04,%eax + 10250c: ff d0 call *%eax + 10250e: e9 d5 f1 ff ff jmp 1016e8 + +00102513 : + 102513: 6a 00 push $0x0 + 102515: 6a 5c push $0x5c + 102517: 0f a8 push %gs + 102519: 0f a0 push %fs + 10251b: 06 push %es + 10251c: 1e push %ds + 10251d: 60 pusha + 10251e: 66 b8 10 00 mov $0x10,%ax + 102522: 8e d8 mov %eax,%ds + 102524: 8e c0 mov %eax,%es + 102526: 8e e0 mov %eax,%fs + 102528: 8e e8 mov %eax,%gs + 10252a: 89 e0 mov %esp,%eax + 10252c: 50 push %eax + +0010252d : + 10252d: b8 04 3e 10 00 mov $0x103e04,%eax + 102532: ff d0 call *%eax + 102534: e9 af f1 ff ff jmp 1016e8 + +00102539 : + 102539: 6a 00 push $0x0 + 10253b: 6a 5d push $0x5d + 10253d: 0f a8 push %gs + 10253f: 0f a0 push %fs + 102541: 06 push %es + 102542: 1e push %ds + 102543: 60 pusha + 102544: 66 b8 10 00 mov $0x10,%ax + 102548: 8e d8 mov %eax,%ds + 10254a: 8e c0 mov %eax,%es + 10254c: 8e e0 mov %eax,%fs + 10254e: 8e e8 mov %eax,%gs + 102550: 89 e0 mov %esp,%eax + 102552: 50 push %eax + +00102553 : + 102553: b8 04 3e 10 00 mov $0x103e04,%eax + 102558: ff d0 call *%eax + 10255a: e9 89 f1 ff ff jmp 1016e8 + +0010255f : + 10255f: 6a 00 push $0x0 + 102561: 6a 5e push $0x5e + 102563: 0f a8 push %gs + 102565: 0f a0 push %fs + 102567: 06 push %es + 102568: 1e push %ds + 102569: 60 pusha + 10256a: 66 b8 10 00 mov $0x10,%ax + 10256e: 8e d8 mov %eax,%ds + 102570: 8e c0 mov %eax,%es + 102572: 8e e0 mov %eax,%fs + 102574: 8e e8 mov %eax,%gs + 102576: 89 e0 mov %esp,%eax + 102578: 50 push %eax + +00102579 : + 102579: b8 04 3e 10 00 mov $0x103e04,%eax + 10257e: ff d0 call *%eax + 102580: e9 63 f1 ff ff jmp 1016e8 + +00102585 : + 102585: 6a 00 push $0x0 + 102587: 6a 5f push $0x5f + 102589: 0f a8 push %gs + 10258b: 0f a0 push %fs + 10258d: 06 push %es + 10258e: 1e push %ds + 10258f: 60 pusha + 102590: 66 b8 10 00 mov $0x10,%ax + 102594: 8e d8 mov %eax,%ds + 102596: 8e c0 mov %eax,%es + 102598: 8e e0 mov %eax,%fs + 10259a: 8e e8 mov %eax,%gs + 10259c: 89 e0 mov %esp,%eax + 10259e: 50 push %eax + +0010259f : + 10259f: b8 04 3e 10 00 mov $0x103e04,%eax + 1025a4: ff d0 call *%eax + 1025a6: e9 3d f1 ff ff jmp 1016e8 + +001025ab : + 1025ab: 6a 00 push $0x0 + 1025ad: 6a 60 push $0x60 + 1025af: 0f a8 push %gs + 1025b1: 0f a0 push %fs + 1025b3: 06 push %es + 1025b4: 1e push %ds + 1025b5: 60 pusha + 1025b6: 66 b8 10 00 mov $0x10,%ax + 1025ba: 8e d8 mov %eax,%ds + 1025bc: 8e c0 mov %eax,%es + 1025be: 8e e0 mov %eax,%fs + 1025c0: 8e e8 mov %eax,%gs + 1025c2: 89 e0 mov %esp,%eax + 1025c4: 50 push %eax + +001025c5 : + 1025c5: b8 04 3e 10 00 mov $0x103e04,%eax + 1025ca: ff d0 call *%eax + 1025cc: e9 17 f1 ff ff jmp 1016e8 + +001025d1 : + 1025d1: 6a 00 push $0x0 + 1025d3: 6a 61 push $0x61 + 1025d5: 0f a8 push %gs + 1025d7: 0f a0 push %fs + 1025d9: 06 push %es + 1025da: 1e push %ds + 1025db: 60 pusha + 1025dc: 66 b8 10 00 mov $0x10,%ax + 1025e0: 8e d8 mov %eax,%ds + 1025e2: 8e c0 mov %eax,%es + 1025e4: 8e e0 mov %eax,%fs + 1025e6: 8e e8 mov %eax,%gs + 1025e8: 89 e0 mov %esp,%eax + 1025ea: 50 push %eax + +001025eb : + 1025eb: b8 04 3e 10 00 mov $0x103e04,%eax + 1025f0: ff d0 call *%eax + 1025f2: e9 f1 f0 ff ff jmp 1016e8 + +001025f7 : + 1025f7: 6a 00 push $0x0 + 1025f9: 6a 62 push $0x62 + 1025fb: 0f a8 push %gs + 1025fd: 0f a0 push %fs + 1025ff: 06 push %es + 102600: 1e push %ds + 102601: 60 pusha + 102602: 66 b8 10 00 mov $0x10,%ax + 102606: 8e d8 mov %eax,%ds + 102608: 8e c0 mov %eax,%es + 10260a: 8e e0 mov %eax,%fs + 10260c: 8e e8 mov %eax,%gs + 10260e: 89 e0 mov %esp,%eax + 102610: 50 push %eax + +00102611 : + 102611: b8 04 3e 10 00 mov $0x103e04,%eax + 102616: ff d0 call *%eax + 102618: e9 cb f0 ff ff jmp 1016e8 + +0010261d : + 10261d: 6a 00 push $0x0 + 10261f: 6a 63 push $0x63 + 102621: 0f a8 push %gs + 102623: 0f a0 push %fs + 102625: 06 push %es + 102626: 1e push %ds + 102627: 60 pusha + 102628: 66 b8 10 00 mov $0x10,%ax + 10262c: 8e d8 mov %eax,%ds + 10262e: 8e c0 mov %eax,%es + 102630: 8e e0 mov %eax,%fs + 102632: 8e e8 mov %eax,%gs + 102634: 89 e0 mov %esp,%eax + 102636: 50 push %eax + +00102637 : + 102637: b8 04 3e 10 00 mov $0x103e04,%eax + 10263c: ff d0 call *%eax + 10263e: e9 a5 f0 ff ff jmp 1016e8 + +00102643 : + 102643: 6a 00 push $0x0 + 102645: 6a 64 push $0x64 + 102647: 0f a8 push %gs + 102649: 0f a0 push %fs + 10264b: 06 push %es + 10264c: 1e push %ds + 10264d: 60 pusha + 10264e: 66 b8 10 00 mov $0x10,%ax + 102652: 8e d8 mov %eax,%ds + 102654: 8e c0 mov %eax,%es + 102656: 8e e0 mov %eax,%fs + 102658: 8e e8 mov %eax,%gs + 10265a: 89 e0 mov %esp,%eax + 10265c: 50 push %eax + +0010265d : + 10265d: b8 04 3e 10 00 mov $0x103e04,%eax + 102662: ff d0 call *%eax + 102664: e9 7f f0 ff ff jmp 1016e8 + +00102669 : + 102669: 6a 00 push $0x0 + 10266b: 6a 65 push $0x65 + 10266d: 0f a8 push %gs + 10266f: 0f a0 push %fs + 102671: 06 push %es + 102672: 1e push %ds + 102673: 60 pusha + 102674: 66 b8 10 00 mov $0x10,%ax + 102678: 8e d8 mov %eax,%ds + 10267a: 8e c0 mov %eax,%es + 10267c: 8e e0 mov %eax,%fs + 10267e: 8e e8 mov %eax,%gs + 102680: 89 e0 mov %esp,%eax + 102682: 50 push %eax + +00102683 : + 102683: b8 04 3e 10 00 mov $0x103e04,%eax + 102688: ff d0 call *%eax + 10268a: e9 59 f0 ff ff jmp 1016e8 + +0010268f : + 10268f: 6a 00 push $0x0 + 102691: 6a 66 push $0x66 + 102693: 0f a8 push %gs + 102695: 0f a0 push %fs + 102697: 06 push %es + 102698: 1e push %ds + 102699: 60 pusha + 10269a: 66 b8 10 00 mov $0x10,%ax + 10269e: 8e d8 mov %eax,%ds + 1026a0: 8e c0 mov %eax,%es + 1026a2: 8e e0 mov %eax,%fs + 1026a4: 8e e8 mov %eax,%gs + 1026a6: 89 e0 mov %esp,%eax + 1026a8: 50 push %eax + +001026a9 : + 1026a9: b8 04 3e 10 00 mov $0x103e04,%eax + 1026ae: ff d0 call *%eax + 1026b0: e9 33 f0 ff ff jmp 1016e8 + +001026b5 : + 1026b5: 6a 00 push $0x0 + 1026b7: 6a 67 push $0x67 + 1026b9: 0f a8 push %gs + 1026bb: 0f a0 push %fs + 1026bd: 06 push %es + 1026be: 1e push %ds + 1026bf: 60 pusha + 1026c0: 66 b8 10 00 mov $0x10,%ax + 1026c4: 8e d8 mov %eax,%ds + 1026c6: 8e c0 mov %eax,%es + 1026c8: 8e e0 mov %eax,%fs + 1026ca: 8e e8 mov %eax,%gs + 1026cc: 89 e0 mov %esp,%eax + 1026ce: 50 push %eax + +001026cf : + 1026cf: b8 04 3e 10 00 mov $0x103e04,%eax + 1026d4: ff d0 call *%eax + 1026d6: e9 0d f0 ff ff jmp 1016e8 + +001026db : + 1026db: 6a 00 push $0x0 + 1026dd: 6a 68 push $0x68 + 1026df: 0f a8 push %gs + 1026e1: 0f a0 push %fs + 1026e3: 06 push %es + 1026e4: 1e push %ds + 1026e5: 60 pusha + 1026e6: 66 b8 10 00 mov $0x10,%ax + 1026ea: 8e d8 mov %eax,%ds + 1026ec: 8e c0 mov %eax,%es + 1026ee: 8e e0 mov %eax,%fs + 1026f0: 8e e8 mov %eax,%gs + 1026f2: 89 e0 mov %esp,%eax + 1026f4: 50 push %eax + +001026f5 : + 1026f5: b8 04 3e 10 00 mov $0x103e04,%eax + 1026fa: ff d0 call *%eax + 1026fc: e9 e7 ef ff ff jmp 1016e8 + +00102701 : + 102701: 6a 00 push $0x0 + 102703: 6a 69 push $0x69 + 102705: 0f a8 push %gs + 102707: 0f a0 push %fs + 102709: 06 push %es + 10270a: 1e push %ds + 10270b: 60 pusha + 10270c: 66 b8 10 00 mov $0x10,%ax + 102710: 8e d8 mov %eax,%ds + 102712: 8e c0 mov %eax,%es + 102714: 8e e0 mov %eax,%fs + 102716: 8e e8 mov %eax,%gs + 102718: 89 e0 mov %esp,%eax + 10271a: 50 push %eax + +0010271b : + 10271b: b8 04 3e 10 00 mov $0x103e04,%eax + 102720: ff d0 call *%eax + 102722: e9 c1 ef ff ff jmp 1016e8 + +00102727 : + 102727: 6a 00 push $0x0 + 102729: 6a 6a push $0x6a + 10272b: 0f a8 push %gs + 10272d: 0f a0 push %fs + 10272f: 06 push %es + 102730: 1e push %ds + 102731: 60 pusha + 102732: 66 b8 10 00 mov $0x10,%ax + 102736: 8e d8 mov %eax,%ds + 102738: 8e c0 mov %eax,%es + 10273a: 8e e0 mov %eax,%fs + 10273c: 8e e8 mov %eax,%gs + 10273e: 89 e0 mov %esp,%eax + 102740: 50 push %eax + +00102741 : + 102741: b8 04 3e 10 00 mov $0x103e04,%eax + 102746: ff d0 call *%eax + 102748: e9 9b ef ff ff jmp 1016e8 + +0010274d : + 10274d: 6a 00 push $0x0 + 10274f: 6a 6b push $0x6b + 102751: 0f a8 push %gs + 102753: 0f a0 push %fs + 102755: 06 push %es + 102756: 1e push %ds + 102757: 60 pusha + 102758: 66 b8 10 00 mov $0x10,%ax + 10275c: 8e d8 mov %eax,%ds + 10275e: 8e c0 mov %eax,%es + 102760: 8e e0 mov %eax,%fs + 102762: 8e e8 mov %eax,%gs + 102764: 89 e0 mov %esp,%eax + 102766: 50 push %eax + +00102767 : + 102767: b8 04 3e 10 00 mov $0x103e04,%eax + 10276c: ff d0 call *%eax + 10276e: e9 75 ef ff ff jmp 1016e8 + +00102773 : + 102773: 6a 00 push $0x0 + 102775: 6a 6c push $0x6c + 102777: 0f a8 push %gs + 102779: 0f a0 push %fs + 10277b: 06 push %es + 10277c: 1e push %ds + 10277d: 60 pusha + 10277e: 66 b8 10 00 mov $0x10,%ax + 102782: 8e d8 mov %eax,%ds + 102784: 8e c0 mov %eax,%es + 102786: 8e e0 mov %eax,%fs + 102788: 8e e8 mov %eax,%gs + 10278a: 89 e0 mov %esp,%eax + 10278c: 50 push %eax + +0010278d : + 10278d: b8 04 3e 10 00 mov $0x103e04,%eax + 102792: ff d0 call *%eax + 102794: e9 4f ef ff ff jmp 1016e8 + +00102799 : + 102799: 6a 00 push $0x0 + 10279b: 6a 6d push $0x6d + 10279d: 0f a8 push %gs + 10279f: 0f a0 push %fs + 1027a1: 06 push %es + 1027a2: 1e push %ds + 1027a3: 60 pusha + 1027a4: 66 b8 10 00 mov $0x10,%ax + 1027a8: 8e d8 mov %eax,%ds + 1027aa: 8e c0 mov %eax,%es + 1027ac: 8e e0 mov %eax,%fs + 1027ae: 8e e8 mov %eax,%gs + 1027b0: 89 e0 mov %esp,%eax + 1027b2: 50 push %eax + +001027b3 : + 1027b3: b8 04 3e 10 00 mov $0x103e04,%eax + 1027b8: ff d0 call *%eax + 1027ba: e9 29 ef ff ff jmp 1016e8 + +001027bf : + 1027bf: 6a 00 push $0x0 + 1027c1: 6a 6e push $0x6e + 1027c3: 0f a8 push %gs + 1027c5: 0f a0 push %fs + 1027c7: 06 push %es + 1027c8: 1e push %ds + 1027c9: 60 pusha + 1027ca: 66 b8 10 00 mov $0x10,%ax + 1027ce: 8e d8 mov %eax,%ds + 1027d0: 8e c0 mov %eax,%es + 1027d2: 8e e0 mov %eax,%fs + 1027d4: 8e e8 mov %eax,%gs + 1027d6: 89 e0 mov %esp,%eax + 1027d8: 50 push %eax + +001027d9 : + 1027d9: b8 04 3e 10 00 mov $0x103e04,%eax + 1027de: ff d0 call *%eax + 1027e0: e9 03 ef ff ff jmp 1016e8 + +001027e5 : + 1027e5: 6a 00 push $0x0 + 1027e7: 6a 6f push $0x6f + 1027e9: 0f a8 push %gs + 1027eb: 0f a0 push %fs + 1027ed: 06 push %es + 1027ee: 1e push %ds + 1027ef: 60 pusha + 1027f0: 66 b8 10 00 mov $0x10,%ax + 1027f4: 8e d8 mov %eax,%ds + 1027f6: 8e c0 mov %eax,%es + 1027f8: 8e e0 mov %eax,%fs + 1027fa: 8e e8 mov %eax,%gs + 1027fc: 89 e0 mov %esp,%eax + 1027fe: 50 push %eax + +001027ff : + 1027ff: b8 04 3e 10 00 mov $0x103e04,%eax + 102804: ff d0 call *%eax + 102806: e9 dd ee ff ff jmp 1016e8 + +0010280b : + 10280b: 6a 00 push $0x0 + 10280d: 6a 70 push $0x70 + 10280f: 0f a8 push %gs + 102811: 0f a0 push %fs + 102813: 06 push %es + 102814: 1e push %ds + 102815: 60 pusha + 102816: 66 b8 10 00 mov $0x10,%ax + 10281a: 8e d8 mov %eax,%ds + 10281c: 8e c0 mov %eax,%es + 10281e: 8e e0 mov %eax,%fs + 102820: 8e e8 mov %eax,%gs + 102822: 89 e0 mov %esp,%eax + 102824: 50 push %eax + +00102825 : + 102825: b8 04 3e 10 00 mov $0x103e04,%eax + 10282a: ff d0 call *%eax + 10282c: e9 b7 ee ff ff jmp 1016e8 + +00102831 : + 102831: 6a 00 push $0x0 + 102833: 6a 71 push $0x71 + 102835: 0f a8 push %gs + 102837: 0f a0 push %fs + 102839: 06 push %es + 10283a: 1e push %ds + 10283b: 60 pusha + 10283c: 66 b8 10 00 mov $0x10,%ax + 102840: 8e d8 mov %eax,%ds + 102842: 8e c0 mov %eax,%es + 102844: 8e e0 mov %eax,%fs + 102846: 8e e8 mov %eax,%gs + 102848: 89 e0 mov %esp,%eax + 10284a: 50 push %eax + +0010284b : + 10284b: b8 04 3e 10 00 mov $0x103e04,%eax + 102850: ff d0 call *%eax + 102852: e9 91 ee ff ff jmp 1016e8 + +00102857 : + 102857: 6a 00 push $0x0 + 102859: 6a 72 push $0x72 + 10285b: 0f a8 push %gs + 10285d: 0f a0 push %fs + 10285f: 06 push %es + 102860: 1e push %ds + 102861: 60 pusha + 102862: 66 b8 10 00 mov $0x10,%ax + 102866: 8e d8 mov %eax,%ds + 102868: 8e c0 mov %eax,%es + 10286a: 8e e0 mov %eax,%fs + 10286c: 8e e8 mov %eax,%gs + 10286e: 89 e0 mov %esp,%eax + 102870: 50 push %eax + +00102871 : + 102871: b8 04 3e 10 00 mov $0x103e04,%eax + 102876: ff d0 call *%eax + 102878: e9 6b ee ff ff jmp 1016e8 + +0010287d : + 10287d: 6a 00 push $0x0 + 10287f: 6a 73 push $0x73 + 102881: 0f a8 push %gs + 102883: 0f a0 push %fs + 102885: 06 push %es + 102886: 1e push %ds + 102887: 60 pusha + 102888: 66 b8 10 00 mov $0x10,%ax + 10288c: 8e d8 mov %eax,%ds + 10288e: 8e c0 mov %eax,%es + 102890: 8e e0 mov %eax,%fs + 102892: 8e e8 mov %eax,%gs + 102894: 89 e0 mov %esp,%eax + 102896: 50 push %eax + +00102897 : + 102897: b8 04 3e 10 00 mov $0x103e04,%eax + 10289c: ff d0 call *%eax + 10289e: e9 45 ee ff ff jmp 1016e8 + +001028a3 : + 1028a3: 6a 00 push $0x0 + 1028a5: 6a 74 push $0x74 + 1028a7: 0f a8 push %gs + 1028a9: 0f a0 push %fs + 1028ab: 06 push %es + 1028ac: 1e push %ds + 1028ad: 60 pusha + 1028ae: 66 b8 10 00 mov $0x10,%ax + 1028b2: 8e d8 mov %eax,%ds + 1028b4: 8e c0 mov %eax,%es + 1028b6: 8e e0 mov %eax,%fs + 1028b8: 8e e8 mov %eax,%gs + 1028ba: 89 e0 mov %esp,%eax + 1028bc: 50 push %eax + +001028bd : + 1028bd: b8 04 3e 10 00 mov $0x103e04,%eax + 1028c2: ff d0 call *%eax + 1028c4: e9 1f ee ff ff jmp 1016e8 + +001028c9 : + 1028c9: 6a 00 push $0x0 + 1028cb: 6a 75 push $0x75 + 1028cd: 0f a8 push %gs + 1028cf: 0f a0 push %fs + 1028d1: 06 push %es + 1028d2: 1e push %ds + 1028d3: 60 pusha + 1028d4: 66 b8 10 00 mov $0x10,%ax + 1028d8: 8e d8 mov %eax,%ds + 1028da: 8e c0 mov %eax,%es + 1028dc: 8e e0 mov %eax,%fs + 1028de: 8e e8 mov %eax,%gs + 1028e0: 89 e0 mov %esp,%eax + 1028e2: 50 push %eax + +001028e3 : + 1028e3: b8 04 3e 10 00 mov $0x103e04,%eax + 1028e8: ff d0 call *%eax + 1028ea: e9 f9 ed ff ff jmp 1016e8 + +001028ef : + 1028ef: 6a 00 push $0x0 + 1028f1: 6a 76 push $0x76 + 1028f3: 0f a8 push %gs + 1028f5: 0f a0 push %fs + 1028f7: 06 push %es + 1028f8: 1e push %ds + 1028f9: 60 pusha + 1028fa: 66 b8 10 00 mov $0x10,%ax + 1028fe: 8e d8 mov %eax,%ds + 102900: 8e c0 mov %eax,%es + 102902: 8e e0 mov %eax,%fs + 102904: 8e e8 mov %eax,%gs + 102906: 89 e0 mov %esp,%eax + 102908: 50 push %eax + +00102909 : + 102909: b8 04 3e 10 00 mov $0x103e04,%eax + 10290e: ff d0 call *%eax + 102910: e9 d3 ed ff ff jmp 1016e8 + +00102915 : + 102915: 6a 00 push $0x0 + 102917: 6a 77 push $0x77 + 102919: 0f a8 push %gs + 10291b: 0f a0 push %fs + 10291d: 06 push %es + 10291e: 1e push %ds + 10291f: 60 pusha + 102920: 66 b8 10 00 mov $0x10,%ax + 102924: 8e d8 mov %eax,%ds + 102926: 8e c0 mov %eax,%es + 102928: 8e e0 mov %eax,%fs + 10292a: 8e e8 mov %eax,%gs + 10292c: 89 e0 mov %esp,%eax + 10292e: 50 push %eax + +0010292f : + 10292f: b8 04 3e 10 00 mov $0x103e04,%eax + 102934: ff d0 call *%eax + 102936: e9 ad ed ff ff jmp 1016e8 + +0010293b : + 10293b: 6a 00 push $0x0 + 10293d: 6a 78 push $0x78 + 10293f: 0f a8 push %gs + 102941: 0f a0 push %fs + 102943: 06 push %es + 102944: 1e push %ds + 102945: 60 pusha + 102946: 66 b8 10 00 mov $0x10,%ax + 10294a: 8e d8 mov %eax,%ds + 10294c: 8e c0 mov %eax,%es + 10294e: 8e e0 mov %eax,%fs + 102950: 8e e8 mov %eax,%gs + 102952: 89 e0 mov %esp,%eax + 102954: 50 push %eax + +00102955 : + 102955: b8 04 3e 10 00 mov $0x103e04,%eax + 10295a: ff d0 call *%eax + 10295c: e9 87 ed ff ff jmp 1016e8 + +00102961 : + 102961: 6a 00 push $0x0 + 102963: 6a 79 push $0x79 + 102965: 0f a8 push %gs + 102967: 0f a0 push %fs + 102969: 06 push %es + 10296a: 1e push %ds + 10296b: 60 pusha + 10296c: 66 b8 10 00 mov $0x10,%ax + 102970: 8e d8 mov %eax,%ds + 102972: 8e c0 mov %eax,%es + 102974: 8e e0 mov %eax,%fs + 102976: 8e e8 mov %eax,%gs + 102978: 89 e0 mov %esp,%eax + 10297a: 50 push %eax + +0010297b : + 10297b: b8 04 3e 10 00 mov $0x103e04,%eax + 102980: ff d0 call *%eax + 102982: e9 61 ed ff ff jmp 1016e8 + +00102987 : + 102987: 6a 00 push $0x0 + 102989: 6a 7a push $0x7a + 10298b: 0f a8 push %gs + 10298d: 0f a0 push %fs + 10298f: 06 push %es + 102990: 1e push %ds + 102991: 60 pusha + 102992: 66 b8 10 00 mov $0x10,%ax + 102996: 8e d8 mov %eax,%ds + 102998: 8e c0 mov %eax,%es + 10299a: 8e e0 mov %eax,%fs + 10299c: 8e e8 mov %eax,%gs + 10299e: 89 e0 mov %esp,%eax + 1029a0: 50 push %eax + +001029a1 : + 1029a1: b8 04 3e 10 00 mov $0x103e04,%eax + 1029a6: ff d0 call *%eax + 1029a8: e9 3b ed ff ff jmp 1016e8 + +001029ad : + 1029ad: 6a 00 push $0x0 + 1029af: 6a 7b push $0x7b + 1029b1: 0f a8 push %gs + 1029b3: 0f a0 push %fs + 1029b5: 06 push %es + 1029b6: 1e push %ds + 1029b7: 60 pusha + 1029b8: 66 b8 10 00 mov $0x10,%ax + 1029bc: 8e d8 mov %eax,%ds + 1029be: 8e c0 mov %eax,%es + 1029c0: 8e e0 mov %eax,%fs + 1029c2: 8e e8 mov %eax,%gs + 1029c4: 89 e0 mov %esp,%eax + 1029c6: 50 push %eax + +001029c7 : + 1029c7: b8 04 3e 10 00 mov $0x103e04,%eax + 1029cc: ff d0 call *%eax + 1029ce: e9 15 ed ff ff jmp 1016e8 + +001029d3 : + 1029d3: 6a 00 push $0x0 + 1029d5: 6a 7c push $0x7c + 1029d7: 0f a8 push %gs + 1029d9: 0f a0 push %fs + 1029db: 06 push %es + 1029dc: 1e push %ds + 1029dd: 60 pusha + 1029de: 66 b8 10 00 mov $0x10,%ax + 1029e2: 8e d8 mov %eax,%ds + 1029e4: 8e c0 mov %eax,%es + 1029e6: 8e e0 mov %eax,%fs + 1029e8: 8e e8 mov %eax,%gs + 1029ea: 89 e0 mov %esp,%eax + 1029ec: 50 push %eax + +001029ed : + 1029ed: b8 04 3e 10 00 mov $0x103e04,%eax + 1029f2: ff d0 call *%eax + 1029f4: e9 ef ec ff ff jmp 1016e8 + +001029f9 : + 1029f9: 6a 00 push $0x0 + 1029fb: 6a 7d push $0x7d + 1029fd: 0f a8 push %gs + 1029ff: 0f a0 push %fs + 102a01: 06 push %es + 102a02: 1e push %ds + 102a03: 60 pusha + 102a04: 66 b8 10 00 mov $0x10,%ax + 102a08: 8e d8 mov %eax,%ds + 102a0a: 8e c0 mov %eax,%es + 102a0c: 8e e0 mov %eax,%fs + 102a0e: 8e e8 mov %eax,%gs + 102a10: 89 e0 mov %esp,%eax + 102a12: 50 push %eax + +00102a13 : + 102a13: b8 04 3e 10 00 mov $0x103e04,%eax + 102a18: ff d0 call *%eax + 102a1a: e9 c9 ec ff ff jmp 1016e8 + +00102a1f : + 102a1f: 6a 00 push $0x0 + 102a21: 6a 7e push $0x7e + 102a23: 0f a8 push %gs + 102a25: 0f a0 push %fs + 102a27: 06 push %es + 102a28: 1e push %ds + 102a29: 60 pusha + 102a2a: 66 b8 10 00 mov $0x10,%ax + 102a2e: 8e d8 mov %eax,%ds + 102a30: 8e c0 mov %eax,%es + 102a32: 8e e0 mov %eax,%fs + 102a34: 8e e8 mov %eax,%gs + 102a36: 89 e0 mov %esp,%eax + 102a38: 50 push %eax + +00102a39 : + 102a39: b8 04 3e 10 00 mov $0x103e04,%eax + 102a3e: ff d0 call *%eax + 102a40: e9 a3 ec ff ff jmp 1016e8 + +00102a45 : + 102a45: 6a 00 push $0x0 + 102a47: 6a 7f push $0x7f + 102a49: 0f a8 push %gs + 102a4b: 0f a0 push %fs + 102a4d: 06 push %es + 102a4e: 1e push %ds + 102a4f: 60 pusha + 102a50: 66 b8 10 00 mov $0x10,%ax + 102a54: 8e d8 mov %eax,%ds + 102a56: 8e c0 mov %eax,%es + 102a58: 8e e0 mov %eax,%fs + 102a5a: 8e e8 mov %eax,%gs + 102a5c: 89 e0 mov %esp,%eax + 102a5e: 50 push %eax + +00102a5f : + 102a5f: b8 04 3e 10 00 mov $0x103e04,%eax + 102a64: ff d0 call *%eax + 102a66: e9 7d ec ff ff jmp 1016e8 + +00102a6b : + 102a6b: 6a 00 push $0x0 + 102a6d: 6a 80 push $0xffffff80 + 102a6f: 0f a8 push %gs + 102a71: 0f a0 push %fs + 102a73: 06 push %es + 102a74: 1e push %ds + 102a75: 60 pusha + 102a76: 66 b8 10 00 mov $0x10,%ax + 102a7a: 8e d8 mov %eax,%ds + 102a7c: 8e c0 mov %eax,%es + 102a7e: 8e e0 mov %eax,%fs + 102a80: 8e e8 mov %eax,%gs + 102a82: 89 e0 mov %esp,%eax + 102a84: 50 push %eax + +00102a85 : + 102a85: b8 04 3e 10 00 mov $0x103e04,%eax + 102a8a: ff d0 call *%eax + 102a8c: e9 57 ec ff ff jmp 1016e8 + +00102a91 : + 102a91: 6a 00 push $0x0 + 102a93: 6a 81 push $0xffffff81 + 102a95: 0f a8 push %gs + 102a97: 0f a0 push %fs + 102a99: 06 push %es + 102a9a: 1e push %ds + 102a9b: 60 pusha + 102a9c: 66 b8 10 00 mov $0x10,%ax + 102aa0: 8e d8 mov %eax,%ds + 102aa2: 8e c0 mov %eax,%es + 102aa4: 8e e0 mov %eax,%fs + 102aa6: 8e e8 mov %eax,%gs + 102aa8: 89 e0 mov %esp,%eax + 102aaa: 50 push %eax + +00102aab : + 102aab: b8 04 3e 10 00 mov $0x103e04,%eax + 102ab0: ff d0 call *%eax + 102ab2: e9 31 ec ff ff jmp 1016e8 + +00102ab7 : + 102ab7: 6a 00 push $0x0 + 102ab9: 6a 82 push $0xffffff82 + 102abb: 0f a8 push %gs + 102abd: 0f a0 push %fs + 102abf: 06 push %es + 102ac0: 1e push %ds + 102ac1: 60 pusha + 102ac2: 66 b8 10 00 mov $0x10,%ax + 102ac6: 8e d8 mov %eax,%ds + 102ac8: 8e c0 mov %eax,%es + 102aca: 8e e0 mov %eax,%fs + 102acc: 8e e8 mov %eax,%gs + 102ace: 89 e0 mov %esp,%eax + 102ad0: 50 push %eax + +00102ad1 : + 102ad1: b8 04 3e 10 00 mov $0x103e04,%eax + 102ad6: ff d0 call *%eax + 102ad8: e9 0b ec ff ff jmp 1016e8 + +00102add : + 102add: 6a 00 push $0x0 + 102adf: 6a 83 push $0xffffff83 + 102ae1: 0f a8 push %gs + 102ae3: 0f a0 push %fs + 102ae5: 06 push %es + 102ae6: 1e push %ds + 102ae7: 60 pusha + 102ae8: 66 b8 10 00 mov $0x10,%ax + 102aec: 8e d8 mov %eax,%ds + 102aee: 8e c0 mov %eax,%es + 102af0: 8e e0 mov %eax,%fs + 102af2: 8e e8 mov %eax,%gs + 102af4: 89 e0 mov %esp,%eax + 102af6: 50 push %eax + +00102af7 : + 102af7: b8 04 3e 10 00 mov $0x103e04,%eax + 102afc: ff d0 call *%eax + 102afe: e9 e5 eb ff ff jmp 1016e8 + +00102b03 : + 102b03: 6a 00 push $0x0 + 102b05: 6a 84 push $0xffffff84 + 102b07: 0f a8 push %gs + 102b09: 0f a0 push %fs + 102b0b: 06 push %es + 102b0c: 1e push %ds + 102b0d: 60 pusha + 102b0e: 66 b8 10 00 mov $0x10,%ax + 102b12: 8e d8 mov %eax,%ds + 102b14: 8e c0 mov %eax,%es + 102b16: 8e e0 mov %eax,%fs + 102b18: 8e e8 mov %eax,%gs + 102b1a: 89 e0 mov %esp,%eax + 102b1c: 50 push %eax + +00102b1d : + 102b1d: b8 04 3e 10 00 mov $0x103e04,%eax + 102b22: ff d0 call *%eax + 102b24: e9 bf eb ff ff jmp 1016e8 + +00102b29 : + 102b29: 6a 00 push $0x0 + 102b2b: 6a 85 push $0xffffff85 + 102b2d: 0f a8 push %gs + 102b2f: 0f a0 push %fs + 102b31: 06 push %es + 102b32: 1e push %ds + 102b33: 60 pusha + 102b34: 66 b8 10 00 mov $0x10,%ax + 102b38: 8e d8 mov %eax,%ds + 102b3a: 8e c0 mov %eax,%es + 102b3c: 8e e0 mov %eax,%fs + 102b3e: 8e e8 mov %eax,%gs + 102b40: 89 e0 mov %esp,%eax + 102b42: 50 push %eax + +00102b43 : + 102b43: b8 04 3e 10 00 mov $0x103e04,%eax + 102b48: ff d0 call *%eax + 102b4a: e9 99 eb ff ff jmp 1016e8 + +00102b4f : + 102b4f: 6a 00 push $0x0 + 102b51: 6a 86 push $0xffffff86 + 102b53: 0f a8 push %gs + 102b55: 0f a0 push %fs + 102b57: 06 push %es + 102b58: 1e push %ds + 102b59: 60 pusha + 102b5a: 66 b8 10 00 mov $0x10,%ax + 102b5e: 8e d8 mov %eax,%ds + 102b60: 8e c0 mov %eax,%es + 102b62: 8e e0 mov %eax,%fs + 102b64: 8e e8 mov %eax,%gs + 102b66: 89 e0 mov %esp,%eax + 102b68: 50 push %eax + +00102b69 : + 102b69: b8 04 3e 10 00 mov $0x103e04,%eax + 102b6e: ff d0 call *%eax + 102b70: e9 73 eb ff ff jmp 1016e8 + +00102b75 : + 102b75: 6a 00 push $0x0 + 102b77: 6a 87 push $0xffffff87 + 102b79: 0f a8 push %gs + 102b7b: 0f a0 push %fs + 102b7d: 06 push %es + 102b7e: 1e push %ds + 102b7f: 60 pusha + 102b80: 66 b8 10 00 mov $0x10,%ax + 102b84: 8e d8 mov %eax,%ds + 102b86: 8e c0 mov %eax,%es + 102b88: 8e e0 mov %eax,%fs + 102b8a: 8e e8 mov %eax,%gs + 102b8c: 89 e0 mov %esp,%eax + 102b8e: 50 push %eax + +00102b8f : + 102b8f: b8 04 3e 10 00 mov $0x103e04,%eax + 102b94: ff d0 call *%eax + 102b96: e9 4d eb ff ff jmp 1016e8 + +00102b9b : + 102b9b: 6a 00 push $0x0 + 102b9d: 6a 88 push $0xffffff88 + 102b9f: 0f a8 push %gs + 102ba1: 0f a0 push %fs + 102ba3: 06 push %es + 102ba4: 1e push %ds + 102ba5: 60 pusha + 102ba6: 66 b8 10 00 mov $0x10,%ax + 102baa: 8e d8 mov %eax,%ds + 102bac: 8e c0 mov %eax,%es + 102bae: 8e e0 mov %eax,%fs + 102bb0: 8e e8 mov %eax,%gs + 102bb2: 89 e0 mov %esp,%eax + 102bb4: 50 push %eax + +00102bb5 : + 102bb5: b8 04 3e 10 00 mov $0x103e04,%eax + 102bba: ff d0 call *%eax + 102bbc: e9 27 eb ff ff jmp 1016e8 + +00102bc1 : + 102bc1: 6a 00 push $0x0 + 102bc3: 6a 89 push $0xffffff89 + 102bc5: 0f a8 push %gs + 102bc7: 0f a0 push %fs + 102bc9: 06 push %es + 102bca: 1e push %ds + 102bcb: 60 pusha + 102bcc: 66 b8 10 00 mov $0x10,%ax + 102bd0: 8e d8 mov %eax,%ds + 102bd2: 8e c0 mov %eax,%es + 102bd4: 8e e0 mov %eax,%fs + 102bd6: 8e e8 mov %eax,%gs + 102bd8: 89 e0 mov %esp,%eax + 102bda: 50 push %eax + +00102bdb : + 102bdb: b8 04 3e 10 00 mov $0x103e04,%eax + 102be0: ff d0 call *%eax + 102be2: e9 01 eb ff ff jmp 1016e8 + +00102be7 : + 102be7: 6a 00 push $0x0 + 102be9: 6a 8a push $0xffffff8a + 102beb: 0f a8 push %gs + 102bed: 0f a0 push %fs + 102bef: 06 push %es + 102bf0: 1e push %ds + 102bf1: 60 pusha + 102bf2: 66 b8 10 00 mov $0x10,%ax + 102bf6: 8e d8 mov %eax,%ds + 102bf8: 8e c0 mov %eax,%es + 102bfa: 8e e0 mov %eax,%fs + 102bfc: 8e e8 mov %eax,%gs + 102bfe: 89 e0 mov %esp,%eax + 102c00: 50 push %eax + +00102c01 : + 102c01: b8 04 3e 10 00 mov $0x103e04,%eax + 102c06: ff d0 call *%eax + 102c08: e9 db ea ff ff jmp 1016e8 + +00102c0d : + 102c0d: 6a 00 push $0x0 + 102c0f: 6a 8b push $0xffffff8b + 102c11: 0f a8 push %gs + 102c13: 0f a0 push %fs + 102c15: 06 push %es + 102c16: 1e push %ds + 102c17: 60 pusha + 102c18: 66 b8 10 00 mov $0x10,%ax + 102c1c: 8e d8 mov %eax,%ds + 102c1e: 8e c0 mov %eax,%es + 102c20: 8e e0 mov %eax,%fs + 102c22: 8e e8 mov %eax,%gs + 102c24: 89 e0 mov %esp,%eax + 102c26: 50 push %eax + +00102c27 : + 102c27: b8 04 3e 10 00 mov $0x103e04,%eax + 102c2c: ff d0 call *%eax + 102c2e: e9 b5 ea ff ff jmp 1016e8 + +00102c33 : + 102c33: 6a 00 push $0x0 + 102c35: 6a 8c push $0xffffff8c + 102c37: 0f a8 push %gs + 102c39: 0f a0 push %fs + 102c3b: 06 push %es + 102c3c: 1e push %ds + 102c3d: 60 pusha + 102c3e: 66 b8 10 00 mov $0x10,%ax + 102c42: 8e d8 mov %eax,%ds + 102c44: 8e c0 mov %eax,%es + 102c46: 8e e0 mov %eax,%fs + 102c48: 8e e8 mov %eax,%gs + 102c4a: 89 e0 mov %esp,%eax + 102c4c: 50 push %eax + +00102c4d : + 102c4d: b8 04 3e 10 00 mov $0x103e04,%eax + 102c52: ff d0 call *%eax + 102c54: e9 8f ea ff ff jmp 1016e8 + +00102c59 : + 102c59: 6a 00 push $0x0 + 102c5b: 6a 8d push $0xffffff8d + 102c5d: 0f a8 push %gs + 102c5f: 0f a0 push %fs + 102c61: 06 push %es + 102c62: 1e push %ds + 102c63: 60 pusha + 102c64: 66 b8 10 00 mov $0x10,%ax + 102c68: 8e d8 mov %eax,%ds + 102c6a: 8e c0 mov %eax,%es + 102c6c: 8e e0 mov %eax,%fs + 102c6e: 8e e8 mov %eax,%gs + 102c70: 89 e0 mov %esp,%eax + 102c72: 50 push %eax + +00102c73 : + 102c73: b8 04 3e 10 00 mov $0x103e04,%eax + 102c78: ff d0 call *%eax + 102c7a: e9 69 ea ff ff jmp 1016e8 + +00102c7f : + 102c7f: 6a 00 push $0x0 + 102c81: 6a 8e push $0xffffff8e + 102c83: 0f a8 push %gs + 102c85: 0f a0 push %fs + 102c87: 06 push %es + 102c88: 1e push %ds + 102c89: 60 pusha + 102c8a: 66 b8 10 00 mov $0x10,%ax + 102c8e: 8e d8 mov %eax,%ds + 102c90: 8e c0 mov %eax,%es + 102c92: 8e e0 mov %eax,%fs + 102c94: 8e e8 mov %eax,%gs + 102c96: 89 e0 mov %esp,%eax + 102c98: 50 push %eax + +00102c99 : + 102c99: b8 04 3e 10 00 mov $0x103e04,%eax + 102c9e: ff d0 call *%eax + 102ca0: e9 43 ea ff ff jmp 1016e8 + +00102ca5 : + 102ca5: 6a 00 push $0x0 + 102ca7: 6a 8f push $0xffffff8f + 102ca9: 0f a8 push %gs + 102cab: 0f a0 push %fs + 102cad: 06 push %es + 102cae: 1e push %ds + 102caf: 60 pusha + 102cb0: 66 b8 10 00 mov $0x10,%ax + 102cb4: 8e d8 mov %eax,%ds + 102cb6: 8e c0 mov %eax,%es + 102cb8: 8e e0 mov %eax,%fs + 102cba: 8e e8 mov %eax,%gs + 102cbc: 89 e0 mov %esp,%eax + 102cbe: 50 push %eax + +00102cbf : + 102cbf: b8 04 3e 10 00 mov $0x103e04,%eax + 102cc4: ff d0 call *%eax + 102cc6: e9 1d ea ff ff jmp 1016e8 + +00102ccb : + 102ccb: 6a 00 push $0x0 + 102ccd: 6a 90 push $0xffffff90 + 102ccf: 0f a8 push %gs + 102cd1: 0f a0 push %fs + 102cd3: 06 push %es + 102cd4: 1e push %ds + 102cd5: 60 pusha + 102cd6: 66 b8 10 00 mov $0x10,%ax + 102cda: 8e d8 mov %eax,%ds + 102cdc: 8e c0 mov %eax,%es + 102cde: 8e e0 mov %eax,%fs + 102ce0: 8e e8 mov %eax,%gs + 102ce2: 89 e0 mov %esp,%eax + 102ce4: 50 push %eax + +00102ce5 : + 102ce5: b8 04 3e 10 00 mov $0x103e04,%eax + 102cea: ff d0 call *%eax + 102cec: e9 f7 e9 ff ff jmp 1016e8 + +00102cf1 : + 102cf1: 6a 00 push $0x0 + 102cf3: 6a 91 push $0xffffff91 + 102cf5: 0f a8 push %gs + 102cf7: 0f a0 push %fs + 102cf9: 06 push %es + 102cfa: 1e push %ds + 102cfb: 60 pusha + 102cfc: 66 b8 10 00 mov $0x10,%ax + 102d00: 8e d8 mov %eax,%ds + 102d02: 8e c0 mov %eax,%es + 102d04: 8e e0 mov %eax,%fs + 102d06: 8e e8 mov %eax,%gs + 102d08: 89 e0 mov %esp,%eax + 102d0a: 50 push %eax + +00102d0b : + 102d0b: b8 04 3e 10 00 mov $0x103e04,%eax + 102d10: ff d0 call *%eax + 102d12: e9 d1 e9 ff ff jmp 1016e8 + +00102d17 : + 102d17: 6a 00 push $0x0 + 102d19: 6a 92 push $0xffffff92 + 102d1b: 0f a8 push %gs + 102d1d: 0f a0 push %fs + 102d1f: 06 push %es + 102d20: 1e push %ds + 102d21: 60 pusha + 102d22: 66 b8 10 00 mov $0x10,%ax + 102d26: 8e d8 mov %eax,%ds + 102d28: 8e c0 mov %eax,%es + 102d2a: 8e e0 mov %eax,%fs + 102d2c: 8e e8 mov %eax,%gs + 102d2e: 89 e0 mov %esp,%eax + 102d30: 50 push %eax + +00102d31 : + 102d31: b8 04 3e 10 00 mov $0x103e04,%eax + 102d36: ff d0 call *%eax + 102d38: e9 ab e9 ff ff jmp 1016e8 + +00102d3d : + 102d3d: 6a 00 push $0x0 + 102d3f: 6a 93 push $0xffffff93 + 102d41: 0f a8 push %gs + 102d43: 0f a0 push %fs + 102d45: 06 push %es + 102d46: 1e push %ds + 102d47: 60 pusha + 102d48: 66 b8 10 00 mov $0x10,%ax + 102d4c: 8e d8 mov %eax,%ds + 102d4e: 8e c0 mov %eax,%es + 102d50: 8e e0 mov %eax,%fs + 102d52: 8e e8 mov %eax,%gs + 102d54: 89 e0 mov %esp,%eax + 102d56: 50 push %eax + +00102d57 : + 102d57: b8 04 3e 10 00 mov $0x103e04,%eax + 102d5c: ff d0 call *%eax + 102d5e: e9 85 e9 ff ff jmp 1016e8 + +00102d63 : + 102d63: 6a 00 push $0x0 + 102d65: 6a 94 push $0xffffff94 + 102d67: 0f a8 push %gs + 102d69: 0f a0 push %fs + 102d6b: 06 push %es + 102d6c: 1e push %ds + 102d6d: 60 pusha + 102d6e: 66 b8 10 00 mov $0x10,%ax + 102d72: 8e d8 mov %eax,%ds + 102d74: 8e c0 mov %eax,%es + 102d76: 8e e0 mov %eax,%fs + 102d78: 8e e8 mov %eax,%gs + 102d7a: 89 e0 mov %esp,%eax + 102d7c: 50 push %eax + +00102d7d : + 102d7d: b8 04 3e 10 00 mov $0x103e04,%eax + 102d82: ff d0 call *%eax + 102d84: e9 5f e9 ff ff jmp 1016e8 + +00102d89 : + 102d89: 6a 00 push $0x0 + 102d8b: 6a 95 push $0xffffff95 + 102d8d: 0f a8 push %gs + 102d8f: 0f a0 push %fs + 102d91: 06 push %es + 102d92: 1e push %ds + 102d93: 60 pusha + 102d94: 66 b8 10 00 mov $0x10,%ax + 102d98: 8e d8 mov %eax,%ds + 102d9a: 8e c0 mov %eax,%es + 102d9c: 8e e0 mov %eax,%fs + 102d9e: 8e e8 mov %eax,%gs + 102da0: 89 e0 mov %esp,%eax + 102da2: 50 push %eax + +00102da3 : + 102da3: b8 04 3e 10 00 mov $0x103e04,%eax + 102da8: ff d0 call *%eax + 102daa: e9 39 e9 ff ff jmp 1016e8 + +00102daf : + 102daf: 6a 00 push $0x0 + 102db1: 6a 96 push $0xffffff96 + 102db3: 0f a8 push %gs + 102db5: 0f a0 push %fs + 102db7: 06 push %es + 102db8: 1e push %ds + 102db9: 60 pusha + 102dba: 66 b8 10 00 mov $0x10,%ax + 102dbe: 8e d8 mov %eax,%ds + 102dc0: 8e c0 mov %eax,%es + 102dc2: 8e e0 mov %eax,%fs + 102dc4: 8e e8 mov %eax,%gs + 102dc6: 89 e0 mov %esp,%eax + 102dc8: 50 push %eax + +00102dc9 : + 102dc9: b8 04 3e 10 00 mov $0x103e04,%eax + 102dce: ff d0 call *%eax + 102dd0: e9 13 e9 ff ff jmp 1016e8 + +00102dd5 : + 102dd5: 6a 00 push $0x0 + 102dd7: 6a 97 push $0xffffff97 + 102dd9: 0f a8 push %gs + 102ddb: 0f a0 push %fs + 102ddd: 06 push %es + 102dde: 1e push %ds + 102ddf: 60 pusha + 102de0: 66 b8 10 00 mov $0x10,%ax + 102de4: 8e d8 mov %eax,%ds + 102de6: 8e c0 mov %eax,%es + 102de8: 8e e0 mov %eax,%fs + 102dea: 8e e8 mov %eax,%gs + 102dec: 89 e0 mov %esp,%eax + 102dee: 50 push %eax + +00102def : + 102def: b8 04 3e 10 00 mov $0x103e04,%eax + 102df4: ff d0 call *%eax + 102df6: e9 ed e8 ff ff jmp 1016e8 + +00102dfb : + 102dfb: 6a 00 push $0x0 + 102dfd: 6a 98 push $0xffffff98 + 102dff: 0f a8 push %gs + 102e01: 0f a0 push %fs + 102e03: 06 push %es + 102e04: 1e push %ds + 102e05: 60 pusha + 102e06: 66 b8 10 00 mov $0x10,%ax + 102e0a: 8e d8 mov %eax,%ds + 102e0c: 8e c0 mov %eax,%es + 102e0e: 8e e0 mov %eax,%fs + 102e10: 8e e8 mov %eax,%gs + 102e12: 89 e0 mov %esp,%eax + 102e14: 50 push %eax + +00102e15 : + 102e15: b8 04 3e 10 00 mov $0x103e04,%eax + 102e1a: ff d0 call *%eax + 102e1c: e9 c7 e8 ff ff jmp 1016e8 + +00102e21 : + 102e21: 6a 00 push $0x0 + 102e23: 6a 99 push $0xffffff99 + 102e25: 0f a8 push %gs + 102e27: 0f a0 push %fs + 102e29: 06 push %es + 102e2a: 1e push %ds + 102e2b: 60 pusha + 102e2c: 66 b8 10 00 mov $0x10,%ax + 102e30: 8e d8 mov %eax,%ds + 102e32: 8e c0 mov %eax,%es + 102e34: 8e e0 mov %eax,%fs + 102e36: 8e e8 mov %eax,%gs + 102e38: 89 e0 mov %esp,%eax + 102e3a: 50 push %eax + +00102e3b : + 102e3b: b8 04 3e 10 00 mov $0x103e04,%eax + 102e40: ff d0 call *%eax + 102e42: e9 a1 e8 ff ff jmp 1016e8 + +00102e47 : + 102e47: 6a 00 push $0x0 + 102e49: 6a 9a push $0xffffff9a + 102e4b: 0f a8 push %gs + 102e4d: 0f a0 push %fs + 102e4f: 06 push %es + 102e50: 1e push %ds + 102e51: 60 pusha + 102e52: 66 b8 10 00 mov $0x10,%ax + 102e56: 8e d8 mov %eax,%ds + 102e58: 8e c0 mov %eax,%es + 102e5a: 8e e0 mov %eax,%fs + 102e5c: 8e e8 mov %eax,%gs + 102e5e: 89 e0 mov %esp,%eax + 102e60: 50 push %eax + +00102e61 : + 102e61: b8 04 3e 10 00 mov $0x103e04,%eax + 102e66: ff d0 call *%eax + 102e68: e9 7b e8 ff ff jmp 1016e8 + +00102e6d : + 102e6d: 6a 00 push $0x0 + 102e6f: 6a 9b push $0xffffff9b + 102e71: 0f a8 push %gs + 102e73: 0f a0 push %fs + 102e75: 06 push %es + 102e76: 1e push %ds + 102e77: 60 pusha + 102e78: 66 b8 10 00 mov $0x10,%ax + 102e7c: 8e d8 mov %eax,%ds + 102e7e: 8e c0 mov %eax,%es + 102e80: 8e e0 mov %eax,%fs + 102e82: 8e e8 mov %eax,%gs + 102e84: 89 e0 mov %esp,%eax + 102e86: 50 push %eax + +00102e87 : + 102e87: b8 04 3e 10 00 mov $0x103e04,%eax + 102e8c: ff d0 call *%eax + 102e8e: e9 55 e8 ff ff jmp 1016e8 + +00102e93 : + 102e93: 6a 00 push $0x0 + 102e95: 6a 9c push $0xffffff9c + 102e97: 0f a8 push %gs + 102e99: 0f a0 push %fs + 102e9b: 06 push %es + 102e9c: 1e push %ds + 102e9d: 60 pusha + 102e9e: 66 b8 10 00 mov $0x10,%ax + 102ea2: 8e d8 mov %eax,%ds + 102ea4: 8e c0 mov %eax,%es + 102ea6: 8e e0 mov %eax,%fs + 102ea8: 8e e8 mov %eax,%gs + 102eaa: 89 e0 mov %esp,%eax + 102eac: 50 push %eax + +00102ead : + 102ead: b8 04 3e 10 00 mov $0x103e04,%eax + 102eb2: ff d0 call *%eax + 102eb4: e9 2f e8 ff ff jmp 1016e8 + +00102eb9 : + 102eb9: 6a 00 push $0x0 + 102ebb: 6a 9d push $0xffffff9d + 102ebd: 0f a8 push %gs + 102ebf: 0f a0 push %fs + 102ec1: 06 push %es + 102ec2: 1e push %ds + 102ec3: 60 pusha + 102ec4: 66 b8 10 00 mov $0x10,%ax + 102ec8: 8e d8 mov %eax,%ds + 102eca: 8e c0 mov %eax,%es + 102ecc: 8e e0 mov %eax,%fs + 102ece: 8e e8 mov %eax,%gs + 102ed0: 89 e0 mov %esp,%eax + 102ed2: 50 push %eax + +00102ed3 : + 102ed3: b8 04 3e 10 00 mov $0x103e04,%eax + 102ed8: ff d0 call *%eax + 102eda: e9 09 e8 ff ff jmp 1016e8 + +00102edf : + 102edf: 6a 00 push $0x0 + 102ee1: 6a 9e push $0xffffff9e + 102ee3: 0f a8 push %gs + 102ee5: 0f a0 push %fs + 102ee7: 06 push %es + 102ee8: 1e push %ds + 102ee9: 60 pusha + 102eea: 66 b8 10 00 mov $0x10,%ax + 102eee: 8e d8 mov %eax,%ds + 102ef0: 8e c0 mov %eax,%es + 102ef2: 8e e0 mov %eax,%fs + 102ef4: 8e e8 mov %eax,%gs + 102ef6: 89 e0 mov %esp,%eax + 102ef8: 50 push %eax + +00102ef9 : + 102ef9: b8 04 3e 10 00 mov $0x103e04,%eax + 102efe: ff d0 call *%eax + 102f00: e9 e3 e7 ff ff jmp 1016e8 + +00102f05 : + 102f05: 6a 00 push $0x0 + 102f07: 6a 9f push $0xffffff9f + 102f09: 0f a8 push %gs + 102f0b: 0f a0 push %fs + 102f0d: 06 push %es + 102f0e: 1e push %ds + 102f0f: 60 pusha + 102f10: 66 b8 10 00 mov $0x10,%ax + 102f14: 8e d8 mov %eax,%ds + 102f16: 8e c0 mov %eax,%es + 102f18: 8e e0 mov %eax,%fs + 102f1a: 8e e8 mov %eax,%gs + 102f1c: 89 e0 mov %esp,%eax + 102f1e: 50 push %eax + +00102f1f : + 102f1f: b8 04 3e 10 00 mov $0x103e04,%eax + 102f24: ff d0 call *%eax + 102f26: e9 bd e7 ff ff jmp 1016e8 + +00102f2b : + 102f2b: 6a 00 push $0x0 + 102f2d: 6a a0 push $0xffffffa0 + 102f2f: 0f a8 push %gs + 102f31: 0f a0 push %fs + 102f33: 06 push %es + 102f34: 1e push %ds + 102f35: 60 pusha + 102f36: 66 b8 10 00 mov $0x10,%ax + 102f3a: 8e d8 mov %eax,%ds + 102f3c: 8e c0 mov %eax,%es + 102f3e: 8e e0 mov %eax,%fs + 102f40: 8e e8 mov %eax,%gs + 102f42: 89 e0 mov %esp,%eax + 102f44: 50 push %eax + +00102f45 : + 102f45: b8 04 3e 10 00 mov $0x103e04,%eax + 102f4a: ff d0 call *%eax + 102f4c: e9 97 e7 ff ff jmp 1016e8 + +00102f51 : + 102f51: 6a 00 push $0x0 + 102f53: 6a a1 push $0xffffffa1 + 102f55: 0f a8 push %gs + 102f57: 0f a0 push %fs + 102f59: 06 push %es + 102f5a: 1e push %ds + 102f5b: 60 pusha + 102f5c: 66 b8 10 00 mov $0x10,%ax + 102f60: 8e d8 mov %eax,%ds + 102f62: 8e c0 mov %eax,%es + 102f64: 8e e0 mov %eax,%fs + 102f66: 8e e8 mov %eax,%gs + 102f68: 89 e0 mov %esp,%eax + 102f6a: 50 push %eax + +00102f6b : + 102f6b: b8 04 3e 10 00 mov $0x103e04,%eax + 102f70: ff d0 call *%eax + 102f72: e9 71 e7 ff ff jmp 1016e8 + +00102f77 : + 102f77: 6a 00 push $0x0 + 102f79: 6a a2 push $0xffffffa2 + 102f7b: 0f a8 push %gs + 102f7d: 0f a0 push %fs + 102f7f: 06 push %es + 102f80: 1e push %ds + 102f81: 60 pusha + 102f82: 66 b8 10 00 mov $0x10,%ax + 102f86: 8e d8 mov %eax,%ds + 102f88: 8e c0 mov %eax,%es + 102f8a: 8e e0 mov %eax,%fs + 102f8c: 8e e8 mov %eax,%gs + 102f8e: 89 e0 mov %esp,%eax + 102f90: 50 push %eax + +00102f91 : + 102f91: b8 04 3e 10 00 mov $0x103e04,%eax + 102f96: ff d0 call *%eax + 102f98: e9 4b e7 ff ff jmp 1016e8 + +00102f9d : + 102f9d: 6a 00 push $0x0 + 102f9f: 6a a3 push $0xffffffa3 + 102fa1: 0f a8 push %gs + 102fa3: 0f a0 push %fs + 102fa5: 06 push %es + 102fa6: 1e push %ds + 102fa7: 60 pusha + 102fa8: 66 b8 10 00 mov $0x10,%ax + 102fac: 8e d8 mov %eax,%ds + 102fae: 8e c0 mov %eax,%es + 102fb0: 8e e0 mov %eax,%fs + 102fb2: 8e e8 mov %eax,%gs + 102fb4: 89 e0 mov %esp,%eax + 102fb6: 50 push %eax + +00102fb7 : + 102fb7: b8 04 3e 10 00 mov $0x103e04,%eax + 102fbc: ff d0 call *%eax + 102fbe: e9 25 e7 ff ff jmp 1016e8 + +00102fc3 : + 102fc3: 6a 00 push $0x0 + 102fc5: 6a a4 push $0xffffffa4 + 102fc7: 0f a8 push %gs + 102fc9: 0f a0 push %fs + 102fcb: 06 push %es + 102fcc: 1e push %ds + 102fcd: 60 pusha + 102fce: 66 b8 10 00 mov $0x10,%ax + 102fd2: 8e d8 mov %eax,%ds + 102fd4: 8e c0 mov %eax,%es + 102fd6: 8e e0 mov %eax,%fs + 102fd8: 8e e8 mov %eax,%gs + 102fda: 89 e0 mov %esp,%eax + 102fdc: 50 push %eax + +00102fdd : + 102fdd: b8 04 3e 10 00 mov $0x103e04,%eax + 102fe2: ff d0 call *%eax + 102fe4: e9 ff e6 ff ff jmp 1016e8 + +00102fe9 : + 102fe9: 6a 00 push $0x0 + 102feb: 6a a5 push $0xffffffa5 + 102fed: 0f a8 push %gs + 102fef: 0f a0 push %fs + 102ff1: 06 push %es + 102ff2: 1e push %ds + 102ff3: 60 pusha + 102ff4: 66 b8 10 00 mov $0x10,%ax + 102ff8: 8e d8 mov %eax,%ds + 102ffa: 8e c0 mov %eax,%es + 102ffc: 8e e0 mov %eax,%fs + 102ffe: 8e e8 mov %eax,%gs + 103000: 89 e0 mov %esp,%eax + 103002: 50 push %eax + +00103003 : + 103003: b8 04 3e 10 00 mov $0x103e04,%eax + 103008: ff d0 call *%eax + 10300a: e9 d9 e6 ff ff jmp 1016e8 + +0010300f : + 10300f: 6a 00 push $0x0 + 103011: 6a a6 push $0xffffffa6 + 103013: 0f a8 push %gs + 103015: 0f a0 push %fs + 103017: 06 push %es + 103018: 1e push %ds + 103019: 60 pusha + 10301a: 66 b8 10 00 mov $0x10,%ax + 10301e: 8e d8 mov %eax,%ds + 103020: 8e c0 mov %eax,%es + 103022: 8e e0 mov %eax,%fs + 103024: 8e e8 mov %eax,%gs + 103026: 89 e0 mov %esp,%eax + 103028: 50 push %eax + +00103029 : + 103029: b8 04 3e 10 00 mov $0x103e04,%eax + 10302e: ff d0 call *%eax + 103030: e9 b3 e6 ff ff jmp 1016e8 + +00103035 : + 103035: 6a 00 push $0x0 + 103037: 6a a7 push $0xffffffa7 + 103039: 0f a8 push %gs + 10303b: 0f a0 push %fs + 10303d: 06 push %es + 10303e: 1e push %ds + 10303f: 60 pusha + 103040: 66 b8 10 00 mov $0x10,%ax + 103044: 8e d8 mov %eax,%ds + 103046: 8e c0 mov %eax,%es + 103048: 8e e0 mov %eax,%fs + 10304a: 8e e8 mov %eax,%gs + 10304c: 89 e0 mov %esp,%eax + 10304e: 50 push %eax + +0010304f : + 10304f: b8 04 3e 10 00 mov $0x103e04,%eax + 103054: ff d0 call *%eax + 103056: e9 8d e6 ff ff jmp 1016e8 + +0010305b : + 10305b: 6a 00 push $0x0 + 10305d: 6a a8 push $0xffffffa8 + 10305f: 0f a8 push %gs + 103061: 0f a0 push %fs + 103063: 06 push %es + 103064: 1e push %ds + 103065: 60 pusha + 103066: 66 b8 10 00 mov $0x10,%ax + 10306a: 8e d8 mov %eax,%ds + 10306c: 8e c0 mov %eax,%es + 10306e: 8e e0 mov %eax,%fs + 103070: 8e e8 mov %eax,%gs + 103072: 89 e0 mov %esp,%eax + 103074: 50 push %eax + +00103075 : + 103075: b8 04 3e 10 00 mov $0x103e04,%eax + 10307a: ff d0 call *%eax + 10307c: e9 67 e6 ff ff jmp 1016e8 + +00103081 : + 103081: 6a 00 push $0x0 + 103083: 6a a9 push $0xffffffa9 + 103085: 0f a8 push %gs + 103087: 0f a0 push %fs + 103089: 06 push %es + 10308a: 1e push %ds + 10308b: 60 pusha + 10308c: 66 b8 10 00 mov $0x10,%ax + 103090: 8e d8 mov %eax,%ds + 103092: 8e c0 mov %eax,%es + 103094: 8e e0 mov %eax,%fs + 103096: 8e e8 mov %eax,%gs + 103098: 89 e0 mov %esp,%eax + 10309a: 50 push %eax + +0010309b : + 10309b: b8 04 3e 10 00 mov $0x103e04,%eax + 1030a0: ff d0 call *%eax + 1030a2: e9 41 e6 ff ff jmp 1016e8 + +001030a7 : + 1030a7: 6a 00 push $0x0 + 1030a9: 6a aa push $0xffffffaa + 1030ab: 0f a8 push %gs + 1030ad: 0f a0 push %fs + 1030af: 06 push %es + 1030b0: 1e push %ds + 1030b1: 60 pusha + 1030b2: 66 b8 10 00 mov $0x10,%ax + 1030b6: 8e d8 mov %eax,%ds + 1030b8: 8e c0 mov %eax,%es + 1030ba: 8e e0 mov %eax,%fs + 1030bc: 8e e8 mov %eax,%gs + 1030be: 89 e0 mov %esp,%eax + 1030c0: 50 push %eax + +001030c1 : + 1030c1: b8 04 3e 10 00 mov $0x103e04,%eax + 1030c6: ff d0 call *%eax + 1030c8: e9 1b e6 ff ff jmp 1016e8 + +001030cd : + 1030cd: 6a 00 push $0x0 + 1030cf: 6a ab push $0xffffffab + 1030d1: 0f a8 push %gs + 1030d3: 0f a0 push %fs + 1030d5: 06 push %es + 1030d6: 1e push %ds + 1030d7: 60 pusha + 1030d8: 66 b8 10 00 mov $0x10,%ax + 1030dc: 8e d8 mov %eax,%ds + 1030de: 8e c0 mov %eax,%es + 1030e0: 8e e0 mov %eax,%fs + 1030e2: 8e e8 mov %eax,%gs + 1030e4: 89 e0 mov %esp,%eax + 1030e6: 50 push %eax + +001030e7 : + 1030e7: b8 04 3e 10 00 mov $0x103e04,%eax + 1030ec: ff d0 call *%eax + 1030ee: e9 f5 e5 ff ff jmp 1016e8 + +001030f3 : + 1030f3: 6a 00 push $0x0 + 1030f5: 6a ac push $0xffffffac + 1030f7: 0f a8 push %gs + 1030f9: 0f a0 push %fs + 1030fb: 06 push %es + 1030fc: 1e push %ds + 1030fd: 60 pusha + 1030fe: 66 b8 10 00 mov $0x10,%ax + 103102: 8e d8 mov %eax,%ds + 103104: 8e c0 mov %eax,%es + 103106: 8e e0 mov %eax,%fs + 103108: 8e e8 mov %eax,%gs + 10310a: 89 e0 mov %esp,%eax + 10310c: 50 push %eax + +0010310d : + 10310d: b8 04 3e 10 00 mov $0x103e04,%eax + 103112: ff d0 call *%eax + 103114: e9 cf e5 ff ff jmp 1016e8 + +00103119 : + 103119: 6a 00 push $0x0 + 10311b: 6a ad push $0xffffffad + 10311d: 0f a8 push %gs + 10311f: 0f a0 push %fs + 103121: 06 push %es + 103122: 1e push %ds + 103123: 60 pusha + 103124: 66 b8 10 00 mov $0x10,%ax + 103128: 8e d8 mov %eax,%ds + 10312a: 8e c0 mov %eax,%es + 10312c: 8e e0 mov %eax,%fs + 10312e: 8e e8 mov %eax,%gs + 103130: 89 e0 mov %esp,%eax + 103132: 50 push %eax + +00103133 : + 103133: b8 04 3e 10 00 mov $0x103e04,%eax + 103138: ff d0 call *%eax + 10313a: e9 a9 e5 ff ff jmp 1016e8 + +0010313f : + 10313f: 6a 00 push $0x0 + 103141: 6a ae push $0xffffffae + 103143: 0f a8 push %gs + 103145: 0f a0 push %fs + 103147: 06 push %es + 103148: 1e push %ds + 103149: 60 pusha + 10314a: 66 b8 10 00 mov $0x10,%ax + 10314e: 8e d8 mov %eax,%ds + 103150: 8e c0 mov %eax,%es + 103152: 8e e0 mov %eax,%fs + 103154: 8e e8 mov %eax,%gs + 103156: 89 e0 mov %esp,%eax + 103158: 50 push %eax + +00103159 : + 103159: b8 04 3e 10 00 mov $0x103e04,%eax + 10315e: ff d0 call *%eax + 103160: e9 83 e5 ff ff jmp 1016e8 + +00103165 : + 103165: 6a 00 push $0x0 + 103167: 6a af push $0xffffffaf + 103169: 0f a8 push %gs + 10316b: 0f a0 push %fs + 10316d: 06 push %es + 10316e: 1e push %ds + 10316f: 60 pusha + 103170: 66 b8 10 00 mov $0x10,%ax + 103174: 8e d8 mov %eax,%ds + 103176: 8e c0 mov %eax,%es + 103178: 8e e0 mov %eax,%fs + 10317a: 8e e8 mov %eax,%gs + 10317c: 89 e0 mov %esp,%eax + 10317e: 50 push %eax + +0010317f : + 10317f: b8 04 3e 10 00 mov $0x103e04,%eax + 103184: ff d0 call *%eax + 103186: e9 5d e5 ff ff jmp 1016e8 + +0010318b : + 10318b: 6a 00 push $0x0 + 10318d: 6a b0 push $0xffffffb0 + 10318f: 0f a8 push %gs + 103191: 0f a0 push %fs + 103193: 06 push %es + 103194: 1e push %ds + 103195: 60 pusha + 103196: 66 b8 10 00 mov $0x10,%ax + 10319a: 8e d8 mov %eax,%ds + 10319c: 8e c0 mov %eax,%es + 10319e: 8e e0 mov %eax,%fs + 1031a0: 8e e8 mov %eax,%gs + 1031a2: 89 e0 mov %esp,%eax + 1031a4: 50 push %eax + +001031a5 : + 1031a5: b8 04 3e 10 00 mov $0x103e04,%eax + 1031aa: ff d0 call *%eax + 1031ac: e9 37 e5 ff ff jmp 1016e8 + +001031b1 : + 1031b1: 6a 00 push $0x0 + 1031b3: 6a b1 push $0xffffffb1 + 1031b5: 0f a8 push %gs + 1031b7: 0f a0 push %fs + 1031b9: 06 push %es + 1031ba: 1e push %ds + 1031bb: 60 pusha + 1031bc: 66 b8 10 00 mov $0x10,%ax + 1031c0: 8e d8 mov %eax,%ds + 1031c2: 8e c0 mov %eax,%es + 1031c4: 8e e0 mov %eax,%fs + 1031c6: 8e e8 mov %eax,%gs + 1031c8: 89 e0 mov %esp,%eax + 1031ca: 50 push %eax + +001031cb : + 1031cb: b8 04 3e 10 00 mov $0x103e04,%eax + 1031d0: ff d0 call *%eax + 1031d2: e9 11 e5 ff ff jmp 1016e8 + +001031d7 : + 1031d7: 6a 00 push $0x0 + 1031d9: 6a b2 push $0xffffffb2 + 1031db: 0f a8 push %gs + 1031dd: 0f a0 push %fs + 1031df: 06 push %es + 1031e0: 1e push %ds + 1031e1: 60 pusha + 1031e2: 66 b8 10 00 mov $0x10,%ax + 1031e6: 8e d8 mov %eax,%ds + 1031e8: 8e c0 mov %eax,%es + 1031ea: 8e e0 mov %eax,%fs + 1031ec: 8e e8 mov %eax,%gs + 1031ee: 89 e0 mov %esp,%eax + 1031f0: 50 push %eax + +001031f1 : + 1031f1: b8 04 3e 10 00 mov $0x103e04,%eax + 1031f6: ff d0 call *%eax + 1031f8: e9 eb e4 ff ff jmp 1016e8 + +001031fd : + 1031fd: 6a 00 push $0x0 + 1031ff: 6a b3 push $0xffffffb3 + 103201: 0f a8 push %gs + 103203: 0f a0 push %fs + 103205: 06 push %es + 103206: 1e push %ds + 103207: 60 pusha + 103208: 66 b8 10 00 mov $0x10,%ax + 10320c: 8e d8 mov %eax,%ds + 10320e: 8e c0 mov %eax,%es + 103210: 8e e0 mov %eax,%fs + 103212: 8e e8 mov %eax,%gs + 103214: 89 e0 mov %esp,%eax + 103216: 50 push %eax + +00103217 : + 103217: b8 04 3e 10 00 mov $0x103e04,%eax + 10321c: ff d0 call *%eax + 10321e: e9 c5 e4 ff ff jmp 1016e8 + +00103223 : + 103223: 6a 00 push $0x0 + 103225: 6a b4 push $0xffffffb4 + 103227: 0f a8 push %gs + 103229: 0f a0 push %fs + 10322b: 06 push %es + 10322c: 1e push %ds + 10322d: 60 pusha + 10322e: 66 b8 10 00 mov $0x10,%ax + 103232: 8e d8 mov %eax,%ds + 103234: 8e c0 mov %eax,%es + 103236: 8e e0 mov %eax,%fs + 103238: 8e e8 mov %eax,%gs + 10323a: 89 e0 mov %esp,%eax + 10323c: 50 push %eax + +0010323d : + 10323d: b8 04 3e 10 00 mov $0x103e04,%eax + 103242: ff d0 call *%eax + 103244: e9 9f e4 ff ff jmp 1016e8 + +00103249 : + 103249: 6a 00 push $0x0 + 10324b: 6a b5 push $0xffffffb5 + 10324d: 0f a8 push %gs + 10324f: 0f a0 push %fs + 103251: 06 push %es + 103252: 1e push %ds + 103253: 60 pusha + 103254: 66 b8 10 00 mov $0x10,%ax + 103258: 8e d8 mov %eax,%ds + 10325a: 8e c0 mov %eax,%es + 10325c: 8e e0 mov %eax,%fs + 10325e: 8e e8 mov %eax,%gs + 103260: 89 e0 mov %esp,%eax + 103262: 50 push %eax + +00103263 : + 103263: b8 04 3e 10 00 mov $0x103e04,%eax + 103268: ff d0 call *%eax + 10326a: e9 79 e4 ff ff jmp 1016e8 + +0010326f : + 10326f: 6a 00 push $0x0 + 103271: 6a b6 push $0xffffffb6 + 103273: 0f a8 push %gs + 103275: 0f a0 push %fs + 103277: 06 push %es + 103278: 1e push %ds + 103279: 60 pusha + 10327a: 66 b8 10 00 mov $0x10,%ax + 10327e: 8e d8 mov %eax,%ds + 103280: 8e c0 mov %eax,%es + 103282: 8e e0 mov %eax,%fs + 103284: 8e e8 mov %eax,%gs + 103286: 89 e0 mov %esp,%eax + 103288: 50 push %eax + +00103289 : + 103289: b8 04 3e 10 00 mov $0x103e04,%eax + 10328e: ff d0 call *%eax + 103290: e9 53 e4 ff ff jmp 1016e8 + +00103295 : + 103295: 6a 00 push $0x0 + 103297: 6a b7 push $0xffffffb7 + 103299: 0f a8 push %gs + 10329b: 0f a0 push %fs + 10329d: 06 push %es + 10329e: 1e push %ds + 10329f: 60 pusha + 1032a0: 66 b8 10 00 mov $0x10,%ax + 1032a4: 8e d8 mov %eax,%ds + 1032a6: 8e c0 mov %eax,%es + 1032a8: 8e e0 mov %eax,%fs + 1032aa: 8e e8 mov %eax,%gs + 1032ac: 89 e0 mov %esp,%eax + 1032ae: 50 push %eax + +001032af : + 1032af: b8 04 3e 10 00 mov $0x103e04,%eax + 1032b4: ff d0 call *%eax + 1032b6: e9 2d e4 ff ff jmp 1016e8 + +001032bb : + 1032bb: 6a 00 push $0x0 + 1032bd: 6a b8 push $0xffffffb8 + 1032bf: 0f a8 push %gs + 1032c1: 0f a0 push %fs + 1032c3: 06 push %es + 1032c4: 1e push %ds + 1032c5: 60 pusha + 1032c6: 66 b8 10 00 mov $0x10,%ax + 1032ca: 8e d8 mov %eax,%ds + 1032cc: 8e c0 mov %eax,%es + 1032ce: 8e e0 mov %eax,%fs + 1032d0: 8e e8 mov %eax,%gs + 1032d2: 89 e0 mov %esp,%eax + 1032d4: 50 push %eax + +001032d5 : + 1032d5: b8 04 3e 10 00 mov $0x103e04,%eax + 1032da: ff d0 call *%eax + 1032dc: e9 07 e4 ff ff jmp 1016e8 + +001032e1 : + 1032e1: 6a 00 push $0x0 + 1032e3: 6a b9 push $0xffffffb9 + 1032e5: 0f a8 push %gs + 1032e7: 0f a0 push %fs + 1032e9: 06 push %es + 1032ea: 1e push %ds + 1032eb: 60 pusha + 1032ec: 66 b8 10 00 mov $0x10,%ax + 1032f0: 8e d8 mov %eax,%ds + 1032f2: 8e c0 mov %eax,%es + 1032f4: 8e e0 mov %eax,%fs + 1032f6: 8e e8 mov %eax,%gs + 1032f8: 89 e0 mov %esp,%eax + 1032fa: 50 push %eax + +001032fb : + 1032fb: b8 04 3e 10 00 mov $0x103e04,%eax + 103300: ff d0 call *%eax + 103302: e9 e1 e3 ff ff jmp 1016e8 + +00103307 : + 103307: 6a 00 push $0x0 + 103309: 6a ba push $0xffffffba + 10330b: 0f a8 push %gs + 10330d: 0f a0 push %fs + 10330f: 06 push %es + 103310: 1e push %ds + 103311: 60 pusha + 103312: 66 b8 10 00 mov $0x10,%ax + 103316: 8e d8 mov %eax,%ds + 103318: 8e c0 mov %eax,%es + 10331a: 8e e0 mov %eax,%fs + 10331c: 8e e8 mov %eax,%gs + 10331e: 89 e0 mov %esp,%eax + 103320: 50 push %eax + +00103321 : + 103321: b8 04 3e 10 00 mov $0x103e04,%eax + 103326: ff d0 call *%eax + 103328: e9 bb e3 ff ff jmp 1016e8 + +0010332d : + 10332d: 6a 00 push $0x0 + 10332f: 6a bb push $0xffffffbb + 103331: 0f a8 push %gs + 103333: 0f a0 push %fs + 103335: 06 push %es + 103336: 1e push %ds + 103337: 60 pusha + 103338: 66 b8 10 00 mov $0x10,%ax + 10333c: 8e d8 mov %eax,%ds + 10333e: 8e c0 mov %eax,%es + 103340: 8e e0 mov %eax,%fs + 103342: 8e e8 mov %eax,%gs + 103344: 89 e0 mov %esp,%eax + 103346: 50 push %eax + +00103347 : + 103347: b8 04 3e 10 00 mov $0x103e04,%eax + 10334c: ff d0 call *%eax + 10334e: e9 95 e3 ff ff jmp 1016e8 + +00103353 : + 103353: 6a 00 push $0x0 + 103355: 6a bc push $0xffffffbc + 103357: 0f a8 push %gs + 103359: 0f a0 push %fs + 10335b: 06 push %es + 10335c: 1e push %ds + 10335d: 60 pusha + 10335e: 66 b8 10 00 mov $0x10,%ax + 103362: 8e d8 mov %eax,%ds + 103364: 8e c0 mov %eax,%es + 103366: 8e e0 mov %eax,%fs + 103368: 8e e8 mov %eax,%gs + 10336a: 89 e0 mov %esp,%eax + 10336c: 50 push %eax + +0010336d : + 10336d: b8 04 3e 10 00 mov $0x103e04,%eax + 103372: ff d0 call *%eax + 103374: e9 6f e3 ff ff jmp 1016e8 + +00103379 : + 103379: 6a 00 push $0x0 + 10337b: 6a bd push $0xffffffbd + 10337d: 0f a8 push %gs + 10337f: 0f a0 push %fs + 103381: 06 push %es + 103382: 1e push %ds + 103383: 60 pusha + 103384: 66 b8 10 00 mov $0x10,%ax + 103388: 8e d8 mov %eax,%ds + 10338a: 8e c0 mov %eax,%es + 10338c: 8e e0 mov %eax,%fs + 10338e: 8e e8 mov %eax,%gs + 103390: 89 e0 mov %esp,%eax + 103392: 50 push %eax + +00103393 : + 103393: b8 04 3e 10 00 mov $0x103e04,%eax + 103398: ff d0 call *%eax + 10339a: e9 49 e3 ff ff jmp 1016e8 + +0010339f : + 10339f: 6a 00 push $0x0 + 1033a1: 6a be push $0xffffffbe + 1033a3: 0f a8 push %gs + 1033a5: 0f a0 push %fs + 1033a7: 06 push %es + 1033a8: 1e push %ds + 1033a9: 60 pusha + 1033aa: 66 b8 10 00 mov $0x10,%ax + 1033ae: 8e d8 mov %eax,%ds + 1033b0: 8e c0 mov %eax,%es + 1033b2: 8e e0 mov %eax,%fs + 1033b4: 8e e8 mov %eax,%gs + 1033b6: 89 e0 mov %esp,%eax + 1033b8: 50 push %eax + +001033b9 : + 1033b9: b8 04 3e 10 00 mov $0x103e04,%eax + 1033be: ff d0 call *%eax + 1033c0: e9 23 e3 ff ff jmp 1016e8 + +001033c5 : + 1033c5: 6a 00 push $0x0 + 1033c7: 6a bf push $0xffffffbf + 1033c9: 0f a8 push %gs + 1033cb: 0f a0 push %fs + 1033cd: 06 push %es + 1033ce: 1e push %ds + 1033cf: 60 pusha + 1033d0: 66 b8 10 00 mov $0x10,%ax + 1033d4: 8e d8 mov %eax,%ds + 1033d6: 8e c0 mov %eax,%es + 1033d8: 8e e0 mov %eax,%fs + 1033da: 8e e8 mov %eax,%gs + 1033dc: 89 e0 mov %esp,%eax + 1033de: 50 push %eax + +001033df : + 1033df: b8 04 3e 10 00 mov $0x103e04,%eax + 1033e4: ff d0 call *%eax + 1033e6: e9 fd e2 ff ff jmp 1016e8 + +001033eb : + 1033eb: 6a 00 push $0x0 + 1033ed: 6a c0 push $0xffffffc0 + 1033ef: 0f a8 push %gs + 1033f1: 0f a0 push %fs + 1033f3: 06 push %es + 1033f4: 1e push %ds + 1033f5: 60 pusha + 1033f6: 66 b8 10 00 mov $0x10,%ax + 1033fa: 8e d8 mov %eax,%ds + 1033fc: 8e c0 mov %eax,%es + 1033fe: 8e e0 mov %eax,%fs + 103400: 8e e8 mov %eax,%gs + 103402: 89 e0 mov %esp,%eax + 103404: 50 push %eax + +00103405 : + 103405: b8 04 3e 10 00 mov $0x103e04,%eax + 10340a: ff d0 call *%eax + 10340c: e9 d7 e2 ff ff jmp 1016e8 + +00103411 : + 103411: 6a 00 push $0x0 + 103413: 6a c1 push $0xffffffc1 + 103415: 0f a8 push %gs + 103417: 0f a0 push %fs + 103419: 06 push %es + 10341a: 1e push %ds + 10341b: 60 pusha + 10341c: 66 b8 10 00 mov $0x10,%ax + 103420: 8e d8 mov %eax,%ds + 103422: 8e c0 mov %eax,%es + 103424: 8e e0 mov %eax,%fs + 103426: 8e e8 mov %eax,%gs + 103428: 89 e0 mov %esp,%eax + 10342a: 50 push %eax + +0010342b : + 10342b: b8 04 3e 10 00 mov $0x103e04,%eax + 103430: ff d0 call *%eax + 103432: e9 b1 e2 ff ff jmp 1016e8 + +00103437 : + 103437: 6a 00 push $0x0 + 103439: 6a c2 push $0xffffffc2 + 10343b: 0f a8 push %gs + 10343d: 0f a0 push %fs + 10343f: 06 push %es + 103440: 1e push %ds + 103441: 60 pusha + 103442: 66 b8 10 00 mov $0x10,%ax + 103446: 8e d8 mov %eax,%ds + 103448: 8e c0 mov %eax,%es + 10344a: 8e e0 mov %eax,%fs + 10344c: 8e e8 mov %eax,%gs + 10344e: 89 e0 mov %esp,%eax + 103450: 50 push %eax + +00103451 : + 103451: b8 04 3e 10 00 mov $0x103e04,%eax + 103456: ff d0 call *%eax + 103458: e9 8b e2 ff ff jmp 1016e8 + +0010345d : + 10345d: 6a 00 push $0x0 + 10345f: 6a c3 push $0xffffffc3 + 103461: 0f a8 push %gs + 103463: 0f a0 push %fs + 103465: 06 push %es + 103466: 1e push %ds + 103467: 60 pusha + 103468: 66 b8 10 00 mov $0x10,%ax + 10346c: 8e d8 mov %eax,%ds + 10346e: 8e c0 mov %eax,%es + 103470: 8e e0 mov %eax,%fs + 103472: 8e e8 mov %eax,%gs + 103474: 89 e0 mov %esp,%eax + 103476: 50 push %eax + +00103477 : + 103477: b8 04 3e 10 00 mov $0x103e04,%eax + 10347c: ff d0 call *%eax + 10347e: e9 65 e2 ff ff jmp 1016e8 + +00103483 : + 103483: 6a 00 push $0x0 + 103485: 6a c4 push $0xffffffc4 + 103487: 0f a8 push %gs + 103489: 0f a0 push %fs + 10348b: 06 push %es + 10348c: 1e push %ds + 10348d: 60 pusha + 10348e: 66 b8 10 00 mov $0x10,%ax + 103492: 8e d8 mov %eax,%ds + 103494: 8e c0 mov %eax,%es + 103496: 8e e0 mov %eax,%fs + 103498: 8e e8 mov %eax,%gs + 10349a: 89 e0 mov %esp,%eax + 10349c: 50 push %eax + +0010349d : + 10349d: b8 04 3e 10 00 mov $0x103e04,%eax + 1034a2: ff d0 call *%eax + 1034a4: e9 3f e2 ff ff jmp 1016e8 + +001034a9 : + 1034a9: 6a 00 push $0x0 + 1034ab: 6a c5 push $0xffffffc5 + 1034ad: 0f a8 push %gs + 1034af: 0f a0 push %fs + 1034b1: 06 push %es + 1034b2: 1e push %ds + 1034b3: 60 pusha + 1034b4: 66 b8 10 00 mov $0x10,%ax + 1034b8: 8e d8 mov %eax,%ds + 1034ba: 8e c0 mov %eax,%es + 1034bc: 8e e0 mov %eax,%fs + 1034be: 8e e8 mov %eax,%gs + 1034c0: 89 e0 mov %esp,%eax + 1034c2: 50 push %eax + +001034c3 : + 1034c3: b8 04 3e 10 00 mov $0x103e04,%eax + 1034c8: ff d0 call *%eax + 1034ca: e9 19 e2 ff ff jmp 1016e8 + +001034cf : + 1034cf: 6a 00 push $0x0 + 1034d1: 6a c6 push $0xffffffc6 + 1034d3: 0f a8 push %gs + 1034d5: 0f a0 push %fs + 1034d7: 06 push %es + 1034d8: 1e push %ds + 1034d9: 60 pusha + 1034da: 66 b8 10 00 mov $0x10,%ax + 1034de: 8e d8 mov %eax,%ds + 1034e0: 8e c0 mov %eax,%es + 1034e2: 8e e0 mov %eax,%fs + 1034e4: 8e e8 mov %eax,%gs + 1034e6: 89 e0 mov %esp,%eax + 1034e8: 50 push %eax + +001034e9 : + 1034e9: b8 04 3e 10 00 mov $0x103e04,%eax + 1034ee: ff d0 call *%eax + 1034f0: e9 f3 e1 ff ff jmp 1016e8 + +001034f5 : + 1034f5: 6a 00 push $0x0 + 1034f7: 6a c7 push $0xffffffc7 + 1034f9: 0f a8 push %gs + 1034fb: 0f a0 push %fs + 1034fd: 06 push %es + 1034fe: 1e push %ds + 1034ff: 60 pusha + 103500: 66 b8 10 00 mov $0x10,%ax + 103504: 8e d8 mov %eax,%ds + 103506: 8e c0 mov %eax,%es + 103508: 8e e0 mov %eax,%fs + 10350a: 8e e8 mov %eax,%gs + 10350c: 89 e0 mov %esp,%eax + 10350e: 50 push %eax + +0010350f : + 10350f: b8 04 3e 10 00 mov $0x103e04,%eax + 103514: ff d0 call *%eax + 103516: e9 cd e1 ff ff jmp 1016e8 + +0010351b : + 10351b: 6a 00 push $0x0 + 10351d: 6a c8 push $0xffffffc8 + 10351f: 0f a8 push %gs + 103521: 0f a0 push %fs + 103523: 06 push %es + 103524: 1e push %ds + 103525: 60 pusha + 103526: 66 b8 10 00 mov $0x10,%ax + 10352a: 8e d8 mov %eax,%ds + 10352c: 8e c0 mov %eax,%es + 10352e: 8e e0 mov %eax,%fs + 103530: 8e e8 mov %eax,%gs + 103532: 89 e0 mov %esp,%eax + 103534: 50 push %eax + +00103535 : + 103535: b8 04 3e 10 00 mov $0x103e04,%eax + 10353a: ff d0 call *%eax + 10353c: e9 a7 e1 ff ff jmp 1016e8 + +00103541 : + 103541: 6a 00 push $0x0 + 103543: 6a c9 push $0xffffffc9 + 103545: 0f a8 push %gs + 103547: 0f a0 push %fs + 103549: 06 push %es + 10354a: 1e push %ds + 10354b: 60 pusha + 10354c: 66 b8 10 00 mov $0x10,%ax + 103550: 8e d8 mov %eax,%ds + 103552: 8e c0 mov %eax,%es + 103554: 8e e0 mov %eax,%fs + 103556: 8e e8 mov %eax,%gs + 103558: 89 e0 mov %esp,%eax + 10355a: 50 push %eax + +0010355b : + 10355b: b8 04 3e 10 00 mov $0x103e04,%eax + 103560: ff d0 call *%eax + 103562: e9 81 e1 ff ff jmp 1016e8 + +00103567 : + 103567: 6a 00 push $0x0 + 103569: 6a ca push $0xffffffca + 10356b: 0f a8 push %gs + 10356d: 0f a0 push %fs + 10356f: 06 push %es + 103570: 1e push %ds + 103571: 60 pusha + 103572: 66 b8 10 00 mov $0x10,%ax + 103576: 8e d8 mov %eax,%ds + 103578: 8e c0 mov %eax,%es + 10357a: 8e e0 mov %eax,%fs + 10357c: 8e e8 mov %eax,%gs + 10357e: 89 e0 mov %esp,%eax + 103580: 50 push %eax + +00103581 : + 103581: b8 04 3e 10 00 mov $0x103e04,%eax + 103586: ff d0 call *%eax + 103588: e9 5b e1 ff ff jmp 1016e8 + +0010358d : + 10358d: 6a 00 push $0x0 + 10358f: 6a cb push $0xffffffcb + 103591: 0f a8 push %gs + 103593: 0f a0 push %fs + 103595: 06 push %es + 103596: 1e push %ds + 103597: 60 pusha + 103598: 66 b8 10 00 mov $0x10,%ax + 10359c: 8e d8 mov %eax,%ds + 10359e: 8e c0 mov %eax,%es + 1035a0: 8e e0 mov %eax,%fs + 1035a2: 8e e8 mov %eax,%gs + 1035a4: 89 e0 mov %esp,%eax + 1035a6: 50 push %eax + +001035a7 : + 1035a7: b8 04 3e 10 00 mov $0x103e04,%eax + 1035ac: ff d0 call *%eax + 1035ae: e9 35 e1 ff ff jmp 1016e8 + +001035b3 : + 1035b3: 6a 00 push $0x0 + 1035b5: 6a cc push $0xffffffcc + 1035b7: 0f a8 push %gs + 1035b9: 0f a0 push %fs + 1035bb: 06 push %es + 1035bc: 1e push %ds + 1035bd: 60 pusha + 1035be: 66 b8 10 00 mov $0x10,%ax + 1035c2: 8e d8 mov %eax,%ds + 1035c4: 8e c0 mov %eax,%es + 1035c6: 8e e0 mov %eax,%fs + 1035c8: 8e e8 mov %eax,%gs + 1035ca: 89 e0 mov %esp,%eax + 1035cc: 50 push %eax + +001035cd : + 1035cd: b8 04 3e 10 00 mov $0x103e04,%eax + 1035d2: ff d0 call *%eax + 1035d4: e9 0f e1 ff ff jmp 1016e8 + +001035d9 : + 1035d9: 6a 00 push $0x0 + 1035db: 6a cd push $0xffffffcd + 1035dd: 0f a8 push %gs + 1035df: 0f a0 push %fs + 1035e1: 06 push %es + 1035e2: 1e push %ds + 1035e3: 60 pusha + 1035e4: 66 b8 10 00 mov $0x10,%ax + 1035e8: 8e d8 mov %eax,%ds + 1035ea: 8e c0 mov %eax,%es + 1035ec: 8e e0 mov %eax,%fs + 1035ee: 8e e8 mov %eax,%gs + 1035f0: 89 e0 mov %esp,%eax + 1035f2: 50 push %eax + +001035f3 : + 1035f3: b8 04 3e 10 00 mov $0x103e04,%eax + 1035f8: ff d0 call *%eax + 1035fa: e9 e9 e0 ff ff jmp 1016e8 + +001035ff : + 1035ff: 6a 00 push $0x0 + 103601: 6a ce push $0xffffffce + 103603: 0f a8 push %gs + 103605: 0f a0 push %fs + 103607: 06 push %es + 103608: 1e push %ds + 103609: 60 pusha + 10360a: 66 b8 10 00 mov $0x10,%ax + 10360e: 8e d8 mov %eax,%ds + 103610: 8e c0 mov %eax,%es + 103612: 8e e0 mov %eax,%fs + 103614: 8e e8 mov %eax,%gs + 103616: 89 e0 mov %esp,%eax + 103618: 50 push %eax + +00103619 : + 103619: b8 04 3e 10 00 mov $0x103e04,%eax + 10361e: ff d0 call *%eax + 103620: e9 c3 e0 ff ff jmp 1016e8 + +00103625 : + 103625: 6a 00 push $0x0 + 103627: 6a cf push $0xffffffcf + 103629: 0f a8 push %gs + 10362b: 0f a0 push %fs + 10362d: 06 push %es + 10362e: 1e push %ds + 10362f: 60 pusha + 103630: 66 b8 10 00 mov $0x10,%ax + 103634: 8e d8 mov %eax,%ds + 103636: 8e c0 mov %eax,%es + 103638: 8e e0 mov %eax,%fs + 10363a: 8e e8 mov %eax,%gs + 10363c: 89 e0 mov %esp,%eax + 10363e: 50 push %eax + +0010363f : + 10363f: b8 04 3e 10 00 mov $0x103e04,%eax + 103644: ff d0 call *%eax + 103646: e9 9d e0 ff ff jmp 1016e8 + +0010364b : + 10364b: 6a 00 push $0x0 + 10364d: 6a d0 push $0xffffffd0 + 10364f: 0f a8 push %gs + 103651: 0f a0 push %fs + 103653: 06 push %es + 103654: 1e push %ds + 103655: 60 pusha + 103656: 66 b8 10 00 mov $0x10,%ax + 10365a: 8e d8 mov %eax,%ds + 10365c: 8e c0 mov %eax,%es + 10365e: 8e e0 mov %eax,%fs + 103660: 8e e8 mov %eax,%gs + 103662: 89 e0 mov %esp,%eax + 103664: 50 push %eax + +00103665 : + 103665: b8 04 3e 10 00 mov $0x103e04,%eax + 10366a: ff d0 call *%eax + 10366c: e9 77 e0 ff ff jmp 1016e8 + +00103671 : + 103671: 6a 00 push $0x0 + 103673: 6a d1 push $0xffffffd1 + 103675: 0f a8 push %gs + 103677: 0f a0 push %fs + 103679: 06 push %es + 10367a: 1e push %ds + 10367b: 60 pusha + 10367c: 66 b8 10 00 mov $0x10,%ax + 103680: 8e d8 mov %eax,%ds + 103682: 8e c0 mov %eax,%es + 103684: 8e e0 mov %eax,%fs + 103686: 8e e8 mov %eax,%gs + 103688: 89 e0 mov %esp,%eax + 10368a: 50 push %eax + +0010368b : + 10368b: b8 04 3e 10 00 mov $0x103e04,%eax + 103690: ff d0 call *%eax + 103692: e9 51 e0 ff ff jmp 1016e8 + +00103697 : + 103697: 6a 00 push $0x0 + 103699: 6a d2 push $0xffffffd2 + 10369b: 0f a8 push %gs + 10369d: 0f a0 push %fs + 10369f: 06 push %es + 1036a0: 1e push %ds + 1036a1: 60 pusha + 1036a2: 66 b8 10 00 mov $0x10,%ax + 1036a6: 8e d8 mov %eax,%ds + 1036a8: 8e c0 mov %eax,%es + 1036aa: 8e e0 mov %eax,%fs + 1036ac: 8e e8 mov %eax,%gs + 1036ae: 89 e0 mov %esp,%eax + 1036b0: 50 push %eax + +001036b1 : + 1036b1: b8 04 3e 10 00 mov $0x103e04,%eax + 1036b6: ff d0 call *%eax + 1036b8: e9 2b e0 ff ff jmp 1016e8 + +001036bd : + 1036bd: 6a 00 push $0x0 + 1036bf: 6a d3 push $0xffffffd3 + 1036c1: 0f a8 push %gs + 1036c3: 0f a0 push %fs + 1036c5: 06 push %es + 1036c6: 1e push %ds + 1036c7: 60 pusha + 1036c8: 66 b8 10 00 mov $0x10,%ax + 1036cc: 8e d8 mov %eax,%ds + 1036ce: 8e c0 mov %eax,%es + 1036d0: 8e e0 mov %eax,%fs + 1036d2: 8e e8 mov %eax,%gs + 1036d4: 89 e0 mov %esp,%eax + 1036d6: 50 push %eax + +001036d7 : + 1036d7: b8 04 3e 10 00 mov $0x103e04,%eax + 1036dc: ff d0 call *%eax + 1036de: e9 05 e0 ff ff jmp 1016e8 + +001036e3 : + 1036e3: 6a 00 push $0x0 + 1036e5: 6a d4 push $0xffffffd4 + 1036e7: 0f a8 push %gs + 1036e9: 0f a0 push %fs + 1036eb: 06 push %es + 1036ec: 1e push %ds + 1036ed: 60 pusha + 1036ee: 66 b8 10 00 mov $0x10,%ax + 1036f2: 8e d8 mov %eax,%ds + 1036f4: 8e c0 mov %eax,%es + 1036f6: 8e e0 mov %eax,%fs + 1036f8: 8e e8 mov %eax,%gs + 1036fa: 89 e0 mov %esp,%eax + 1036fc: 50 push %eax + +001036fd : + 1036fd: b8 04 3e 10 00 mov $0x103e04,%eax + 103702: ff d0 call *%eax + 103704: e9 df df ff ff jmp 1016e8 + +00103709 : + 103709: 6a 00 push $0x0 + 10370b: 6a d5 push $0xffffffd5 + 10370d: 0f a8 push %gs + 10370f: 0f a0 push %fs + 103711: 06 push %es + 103712: 1e push %ds + 103713: 60 pusha + 103714: 66 b8 10 00 mov $0x10,%ax + 103718: 8e d8 mov %eax,%ds + 10371a: 8e c0 mov %eax,%es + 10371c: 8e e0 mov %eax,%fs + 10371e: 8e e8 mov %eax,%gs + 103720: 89 e0 mov %esp,%eax + 103722: 50 push %eax + +00103723 : + 103723: b8 04 3e 10 00 mov $0x103e04,%eax + 103728: ff d0 call *%eax + 10372a: e9 b9 df ff ff jmp 1016e8 + +0010372f : + 10372f: 6a 00 push $0x0 + 103731: 6a d6 push $0xffffffd6 + 103733: 0f a8 push %gs + 103735: 0f a0 push %fs + 103737: 06 push %es + 103738: 1e push %ds + 103739: 60 pusha + 10373a: 66 b8 10 00 mov $0x10,%ax + 10373e: 8e d8 mov %eax,%ds + 103740: 8e c0 mov %eax,%es + 103742: 8e e0 mov %eax,%fs + 103744: 8e e8 mov %eax,%gs + 103746: 89 e0 mov %esp,%eax + 103748: 50 push %eax + +00103749 : + 103749: b8 04 3e 10 00 mov $0x103e04,%eax + 10374e: ff d0 call *%eax + 103750: e9 93 df ff ff jmp 1016e8 + +00103755 : + 103755: 6a 00 push $0x0 + 103757: 6a d7 push $0xffffffd7 + 103759: 0f a8 push %gs + 10375b: 0f a0 push %fs + 10375d: 06 push %es + 10375e: 1e push %ds + 10375f: 60 pusha + 103760: 66 b8 10 00 mov $0x10,%ax + 103764: 8e d8 mov %eax,%ds + 103766: 8e c0 mov %eax,%es + 103768: 8e e0 mov %eax,%fs + 10376a: 8e e8 mov %eax,%gs + 10376c: 89 e0 mov %esp,%eax + 10376e: 50 push %eax + +0010376f : + 10376f: b8 04 3e 10 00 mov $0x103e04,%eax + 103774: ff d0 call *%eax + 103776: e9 6d df ff ff jmp 1016e8 + +0010377b : + 10377b: 6a 00 push $0x0 + 10377d: 6a d8 push $0xffffffd8 + 10377f: 0f a8 push %gs + 103781: 0f a0 push %fs + 103783: 06 push %es + 103784: 1e push %ds + 103785: 60 pusha + 103786: 66 b8 10 00 mov $0x10,%ax + 10378a: 8e d8 mov %eax,%ds + 10378c: 8e c0 mov %eax,%es + 10378e: 8e e0 mov %eax,%fs + 103790: 8e e8 mov %eax,%gs + 103792: 89 e0 mov %esp,%eax + 103794: 50 push %eax + +00103795 : + 103795: b8 04 3e 10 00 mov $0x103e04,%eax + 10379a: ff d0 call *%eax + 10379c: e9 47 df ff ff jmp 1016e8 + +001037a1 : + 1037a1: 6a 00 push $0x0 + 1037a3: 6a d9 push $0xffffffd9 + 1037a5: 0f a8 push %gs + 1037a7: 0f a0 push %fs + 1037a9: 06 push %es + 1037aa: 1e push %ds + 1037ab: 60 pusha + 1037ac: 66 b8 10 00 mov $0x10,%ax + 1037b0: 8e d8 mov %eax,%ds + 1037b2: 8e c0 mov %eax,%es + 1037b4: 8e e0 mov %eax,%fs + 1037b6: 8e e8 mov %eax,%gs + 1037b8: 89 e0 mov %esp,%eax + 1037ba: 50 push %eax + +001037bb : + 1037bb: b8 04 3e 10 00 mov $0x103e04,%eax + 1037c0: ff d0 call *%eax + 1037c2: e9 21 df ff ff jmp 1016e8 + +001037c7 : + 1037c7: 6a 00 push $0x0 + 1037c9: 6a da push $0xffffffda + 1037cb: 0f a8 push %gs + 1037cd: 0f a0 push %fs + 1037cf: 06 push %es + 1037d0: 1e push %ds + 1037d1: 60 pusha + 1037d2: 66 b8 10 00 mov $0x10,%ax + 1037d6: 8e d8 mov %eax,%ds + 1037d8: 8e c0 mov %eax,%es + 1037da: 8e e0 mov %eax,%fs + 1037dc: 8e e8 mov %eax,%gs + 1037de: 89 e0 mov %esp,%eax + 1037e0: 50 push %eax + +001037e1 : + 1037e1: b8 04 3e 10 00 mov $0x103e04,%eax + 1037e6: ff d0 call *%eax + 1037e8: e9 fb de ff ff jmp 1016e8 + +001037ed : + 1037ed: 6a 00 push $0x0 + 1037ef: 6a db push $0xffffffdb + 1037f1: 0f a8 push %gs + 1037f3: 0f a0 push %fs + 1037f5: 06 push %es + 1037f6: 1e push %ds + 1037f7: 60 pusha + 1037f8: 66 b8 10 00 mov $0x10,%ax + 1037fc: 8e d8 mov %eax,%ds + 1037fe: 8e c0 mov %eax,%es + 103800: 8e e0 mov %eax,%fs + 103802: 8e e8 mov %eax,%gs + 103804: 89 e0 mov %esp,%eax + 103806: 50 push %eax + +00103807 : + 103807: b8 04 3e 10 00 mov $0x103e04,%eax + 10380c: ff d0 call *%eax + 10380e: e9 d5 de ff ff jmp 1016e8 + +00103813 : + 103813: 6a 00 push $0x0 + 103815: 6a dc push $0xffffffdc + 103817: 0f a8 push %gs + 103819: 0f a0 push %fs + 10381b: 06 push %es + 10381c: 1e push %ds + 10381d: 60 pusha + 10381e: 66 b8 10 00 mov $0x10,%ax + 103822: 8e d8 mov %eax,%ds + 103824: 8e c0 mov %eax,%es + 103826: 8e e0 mov %eax,%fs + 103828: 8e e8 mov %eax,%gs + 10382a: 89 e0 mov %esp,%eax + 10382c: 50 push %eax + +0010382d : + 10382d: b8 04 3e 10 00 mov $0x103e04,%eax + 103832: ff d0 call *%eax + 103834: e9 af de ff ff jmp 1016e8 + +00103839 : + 103839: 6a 00 push $0x0 + 10383b: 6a dd push $0xffffffdd + 10383d: 0f a8 push %gs + 10383f: 0f a0 push %fs + 103841: 06 push %es + 103842: 1e push %ds + 103843: 60 pusha + 103844: 66 b8 10 00 mov $0x10,%ax + 103848: 8e d8 mov %eax,%ds + 10384a: 8e c0 mov %eax,%es + 10384c: 8e e0 mov %eax,%fs + 10384e: 8e e8 mov %eax,%gs + 103850: 89 e0 mov %esp,%eax + 103852: 50 push %eax + +00103853 : + 103853: b8 04 3e 10 00 mov $0x103e04,%eax + 103858: ff d0 call *%eax + 10385a: e9 89 de ff ff jmp 1016e8 + +0010385f : + 10385f: 6a 00 push $0x0 + 103861: 6a de push $0xffffffde + 103863: 0f a8 push %gs + 103865: 0f a0 push %fs + 103867: 06 push %es + 103868: 1e push %ds + 103869: 60 pusha + 10386a: 66 b8 10 00 mov $0x10,%ax + 10386e: 8e d8 mov %eax,%ds + 103870: 8e c0 mov %eax,%es + 103872: 8e e0 mov %eax,%fs + 103874: 8e e8 mov %eax,%gs + 103876: 89 e0 mov %esp,%eax + 103878: 50 push %eax + +00103879 : + 103879: b8 04 3e 10 00 mov $0x103e04,%eax + 10387e: ff d0 call *%eax + 103880: e9 63 de ff ff jmp 1016e8 + +00103885 : + 103885: 6a 00 push $0x0 + 103887: 6a df push $0xffffffdf + 103889: 0f a8 push %gs + 10388b: 0f a0 push %fs + 10388d: 06 push %es + 10388e: 1e push %ds + 10388f: 60 pusha + 103890: 66 b8 10 00 mov $0x10,%ax + 103894: 8e d8 mov %eax,%ds + 103896: 8e c0 mov %eax,%es + 103898: 8e e0 mov %eax,%fs + 10389a: 8e e8 mov %eax,%gs + 10389c: 89 e0 mov %esp,%eax + 10389e: 50 push %eax + +0010389f : + 10389f: b8 04 3e 10 00 mov $0x103e04,%eax + 1038a4: ff d0 call *%eax + 1038a6: e9 3d de ff ff jmp 1016e8 + +001038ab : + 1038ab: 6a 00 push $0x0 + 1038ad: 6a e0 push $0xffffffe0 + 1038af: 0f a8 push %gs + 1038b1: 0f a0 push %fs + 1038b3: 06 push %es + 1038b4: 1e push %ds + 1038b5: 60 pusha + 1038b6: 66 b8 10 00 mov $0x10,%ax + 1038ba: 8e d8 mov %eax,%ds + 1038bc: 8e c0 mov %eax,%es + 1038be: 8e e0 mov %eax,%fs + 1038c0: 8e e8 mov %eax,%gs + 1038c2: 89 e0 mov %esp,%eax + 1038c4: 50 push %eax + +001038c5 : + 1038c5: b8 04 3e 10 00 mov $0x103e04,%eax + 1038ca: ff d0 call *%eax + 1038cc: e9 17 de ff ff jmp 1016e8 + +001038d1 : + 1038d1: 6a 00 push $0x0 + 1038d3: 6a e1 push $0xffffffe1 + 1038d5: 0f a8 push %gs + 1038d7: 0f a0 push %fs + 1038d9: 06 push %es + 1038da: 1e push %ds + 1038db: 60 pusha + 1038dc: 66 b8 10 00 mov $0x10,%ax + 1038e0: 8e d8 mov %eax,%ds + 1038e2: 8e c0 mov %eax,%es + 1038e4: 8e e0 mov %eax,%fs + 1038e6: 8e e8 mov %eax,%gs + 1038e8: 89 e0 mov %esp,%eax + 1038ea: 50 push %eax + +001038eb : + 1038eb: b8 04 3e 10 00 mov $0x103e04,%eax + 1038f0: ff d0 call *%eax + 1038f2: e9 f1 dd ff ff jmp 1016e8 + +001038f7 : + 1038f7: 6a 00 push $0x0 + 1038f9: 6a e2 push $0xffffffe2 + 1038fb: 0f a8 push %gs + 1038fd: 0f a0 push %fs + 1038ff: 06 push %es + 103900: 1e push %ds + 103901: 60 pusha + 103902: 66 b8 10 00 mov $0x10,%ax + 103906: 8e d8 mov %eax,%ds + 103908: 8e c0 mov %eax,%es + 10390a: 8e e0 mov %eax,%fs + 10390c: 8e e8 mov %eax,%gs + 10390e: 89 e0 mov %esp,%eax + 103910: 50 push %eax + +00103911 : + 103911: b8 04 3e 10 00 mov $0x103e04,%eax + 103916: ff d0 call *%eax + 103918: e9 cb dd ff ff jmp 1016e8 + +0010391d : + 10391d: 6a 00 push $0x0 + 10391f: 6a e3 push $0xffffffe3 + 103921: 0f a8 push %gs + 103923: 0f a0 push %fs + 103925: 06 push %es + 103926: 1e push %ds + 103927: 60 pusha + 103928: 66 b8 10 00 mov $0x10,%ax + 10392c: 8e d8 mov %eax,%ds + 10392e: 8e c0 mov %eax,%es + 103930: 8e e0 mov %eax,%fs + 103932: 8e e8 mov %eax,%gs + 103934: 89 e0 mov %esp,%eax + 103936: 50 push %eax + +00103937 : + 103937: b8 04 3e 10 00 mov $0x103e04,%eax + 10393c: ff d0 call *%eax + 10393e: e9 a5 dd ff ff jmp 1016e8 + +00103943 : + 103943: 6a 00 push $0x0 + 103945: 6a e4 push $0xffffffe4 + 103947: 0f a8 push %gs + 103949: 0f a0 push %fs + 10394b: 06 push %es + 10394c: 1e push %ds + 10394d: 60 pusha + 10394e: 66 b8 10 00 mov $0x10,%ax + 103952: 8e d8 mov %eax,%ds + 103954: 8e c0 mov %eax,%es + 103956: 8e e0 mov %eax,%fs + 103958: 8e e8 mov %eax,%gs + 10395a: 89 e0 mov %esp,%eax + 10395c: 50 push %eax + +0010395d : + 10395d: b8 04 3e 10 00 mov $0x103e04,%eax + 103962: ff d0 call *%eax + 103964: e9 7f dd ff ff jmp 1016e8 + +00103969 : + 103969: 6a 00 push $0x0 + 10396b: 6a e5 push $0xffffffe5 + 10396d: 0f a8 push %gs + 10396f: 0f a0 push %fs + 103971: 06 push %es + 103972: 1e push %ds + 103973: 60 pusha + 103974: 66 b8 10 00 mov $0x10,%ax + 103978: 8e d8 mov %eax,%ds + 10397a: 8e c0 mov %eax,%es + 10397c: 8e e0 mov %eax,%fs + 10397e: 8e e8 mov %eax,%gs + 103980: 89 e0 mov %esp,%eax + 103982: 50 push %eax + +00103983 : + 103983: b8 04 3e 10 00 mov $0x103e04,%eax + 103988: ff d0 call *%eax + 10398a: e9 59 dd ff ff jmp 1016e8 + +0010398f : + 10398f: 6a 00 push $0x0 + 103991: 6a e6 push $0xffffffe6 + 103993: 0f a8 push %gs + 103995: 0f a0 push %fs + 103997: 06 push %es + 103998: 1e push %ds + 103999: 60 pusha + 10399a: 66 b8 10 00 mov $0x10,%ax + 10399e: 8e d8 mov %eax,%ds + 1039a0: 8e c0 mov %eax,%es + 1039a2: 8e e0 mov %eax,%fs + 1039a4: 8e e8 mov %eax,%gs + 1039a6: 89 e0 mov %esp,%eax + 1039a8: 50 push %eax + +001039a9 : + 1039a9: b8 04 3e 10 00 mov $0x103e04,%eax + 1039ae: ff d0 call *%eax + 1039b0: e9 33 dd ff ff jmp 1016e8 + +001039b5 : + 1039b5: 6a 00 push $0x0 + 1039b7: 6a e7 push $0xffffffe7 + 1039b9: 0f a8 push %gs + 1039bb: 0f a0 push %fs + 1039bd: 06 push %es + 1039be: 1e push %ds + 1039bf: 60 pusha + 1039c0: 66 b8 10 00 mov $0x10,%ax + 1039c4: 8e d8 mov %eax,%ds + 1039c6: 8e c0 mov %eax,%es + 1039c8: 8e e0 mov %eax,%fs + 1039ca: 8e e8 mov %eax,%gs + 1039cc: 89 e0 mov %esp,%eax + 1039ce: 50 push %eax + +001039cf : + 1039cf: b8 04 3e 10 00 mov $0x103e04,%eax + 1039d4: ff d0 call *%eax + 1039d6: e9 0d dd ff ff jmp 1016e8 + +001039db : + 1039db: 6a 00 push $0x0 + 1039dd: 6a e8 push $0xffffffe8 + 1039df: 0f a8 push %gs + 1039e1: 0f a0 push %fs + 1039e3: 06 push %es + 1039e4: 1e push %ds + 1039e5: 60 pusha + 1039e6: 66 b8 10 00 mov $0x10,%ax + 1039ea: 8e d8 mov %eax,%ds + 1039ec: 8e c0 mov %eax,%es + 1039ee: 8e e0 mov %eax,%fs + 1039f0: 8e e8 mov %eax,%gs + 1039f2: 89 e0 mov %esp,%eax + 1039f4: 50 push %eax + +001039f5 : + 1039f5: b8 04 3e 10 00 mov $0x103e04,%eax + 1039fa: ff d0 call *%eax + 1039fc: e9 e7 dc ff ff jmp 1016e8 + +00103a01 : + 103a01: 6a 00 push $0x0 + 103a03: 6a e9 push $0xffffffe9 + 103a05: 0f a8 push %gs + 103a07: 0f a0 push %fs + 103a09: 06 push %es + 103a0a: 1e push %ds + 103a0b: 60 pusha + 103a0c: 66 b8 10 00 mov $0x10,%ax + 103a10: 8e d8 mov %eax,%ds + 103a12: 8e c0 mov %eax,%es + 103a14: 8e e0 mov %eax,%fs + 103a16: 8e e8 mov %eax,%gs + 103a18: 89 e0 mov %esp,%eax + 103a1a: 50 push %eax + +00103a1b : + 103a1b: b8 04 3e 10 00 mov $0x103e04,%eax + 103a20: ff d0 call *%eax + 103a22: e9 c1 dc ff ff jmp 1016e8 + +00103a27 : + 103a27: 6a 00 push $0x0 + 103a29: 6a ea push $0xffffffea + 103a2b: 0f a8 push %gs + 103a2d: 0f a0 push %fs + 103a2f: 06 push %es + 103a30: 1e push %ds + 103a31: 60 pusha + 103a32: 66 b8 10 00 mov $0x10,%ax + 103a36: 8e d8 mov %eax,%ds + 103a38: 8e c0 mov %eax,%es + 103a3a: 8e e0 mov %eax,%fs + 103a3c: 8e e8 mov %eax,%gs + 103a3e: 89 e0 mov %esp,%eax + 103a40: 50 push %eax + +00103a41 : + 103a41: b8 04 3e 10 00 mov $0x103e04,%eax + 103a46: ff d0 call *%eax + 103a48: e9 9b dc ff ff jmp 1016e8 + +00103a4d : + 103a4d: 6a 00 push $0x0 + 103a4f: 6a eb push $0xffffffeb + 103a51: 0f a8 push %gs + 103a53: 0f a0 push %fs + 103a55: 06 push %es + 103a56: 1e push %ds + 103a57: 60 pusha + 103a58: 66 b8 10 00 mov $0x10,%ax + 103a5c: 8e d8 mov %eax,%ds + 103a5e: 8e c0 mov %eax,%es + 103a60: 8e e0 mov %eax,%fs + 103a62: 8e e8 mov %eax,%gs + 103a64: 89 e0 mov %esp,%eax + 103a66: 50 push %eax + +00103a67 : + 103a67: b8 04 3e 10 00 mov $0x103e04,%eax + 103a6c: ff d0 call *%eax + 103a6e: e9 75 dc ff ff jmp 1016e8 + +00103a73 : + 103a73: 6a 00 push $0x0 + 103a75: 6a ec push $0xffffffec + 103a77: 0f a8 push %gs + 103a79: 0f a0 push %fs + 103a7b: 06 push %es + 103a7c: 1e push %ds + 103a7d: 60 pusha + 103a7e: 66 b8 10 00 mov $0x10,%ax + 103a82: 8e d8 mov %eax,%ds + 103a84: 8e c0 mov %eax,%es + 103a86: 8e e0 mov %eax,%fs + 103a88: 8e e8 mov %eax,%gs + 103a8a: 89 e0 mov %esp,%eax + 103a8c: 50 push %eax + +00103a8d : + 103a8d: b8 04 3e 10 00 mov $0x103e04,%eax + 103a92: ff d0 call *%eax + 103a94: e9 4f dc ff ff jmp 1016e8 + +00103a99 : + 103a99: 6a 00 push $0x0 + 103a9b: 6a ed push $0xffffffed + 103a9d: 0f a8 push %gs + 103a9f: 0f a0 push %fs + 103aa1: 06 push %es + 103aa2: 1e push %ds + 103aa3: 60 pusha + 103aa4: 66 b8 10 00 mov $0x10,%ax + 103aa8: 8e d8 mov %eax,%ds + 103aaa: 8e c0 mov %eax,%es + 103aac: 8e e0 mov %eax,%fs + 103aae: 8e e8 mov %eax,%gs + 103ab0: 89 e0 mov %esp,%eax + 103ab2: 50 push %eax + +00103ab3 : + 103ab3: b8 04 3e 10 00 mov $0x103e04,%eax + 103ab8: ff d0 call *%eax + 103aba: e9 29 dc ff ff jmp 1016e8 + +00103abf : + 103abf: 6a 00 push $0x0 + 103ac1: 6a ee push $0xffffffee + 103ac3: 0f a8 push %gs + 103ac5: 0f a0 push %fs + 103ac7: 06 push %es + 103ac8: 1e push %ds + 103ac9: 60 pusha + 103aca: 66 b8 10 00 mov $0x10,%ax + 103ace: 8e d8 mov %eax,%ds + 103ad0: 8e c0 mov %eax,%es + 103ad2: 8e e0 mov %eax,%fs + 103ad4: 8e e8 mov %eax,%gs + 103ad6: 89 e0 mov %esp,%eax + 103ad8: 50 push %eax + +00103ad9 : + 103ad9: b8 04 3e 10 00 mov $0x103e04,%eax + 103ade: ff d0 call *%eax + 103ae0: e9 03 dc ff ff jmp 1016e8 + +00103ae5 : + 103ae5: 6a 00 push $0x0 + 103ae7: 6a ef push $0xffffffef + 103ae9: 0f a8 push %gs + 103aeb: 0f a0 push %fs + 103aed: 06 push %es + 103aee: 1e push %ds + 103aef: 60 pusha + 103af0: 66 b8 10 00 mov $0x10,%ax + 103af4: 8e d8 mov %eax,%ds + 103af6: 8e c0 mov %eax,%es + 103af8: 8e e0 mov %eax,%fs + 103afa: 8e e8 mov %eax,%gs + 103afc: 89 e0 mov %esp,%eax + 103afe: 50 push %eax + +00103aff : + 103aff: b8 04 3e 10 00 mov $0x103e04,%eax + 103b04: ff d0 call *%eax + 103b06: e9 dd db ff ff jmp 1016e8 + +00103b0b : + 103b0b: 6a 00 push $0x0 + 103b0d: 6a f0 push $0xfffffff0 + 103b0f: 0f a8 push %gs + 103b11: 0f a0 push %fs + 103b13: 06 push %es + 103b14: 1e push %ds + 103b15: 60 pusha + 103b16: 66 b8 10 00 mov $0x10,%ax + 103b1a: 8e d8 mov %eax,%ds + 103b1c: 8e c0 mov %eax,%es + 103b1e: 8e e0 mov %eax,%fs + 103b20: 8e e8 mov %eax,%gs + 103b22: 89 e0 mov %esp,%eax + 103b24: 50 push %eax + +00103b25 : + 103b25: b8 04 3e 10 00 mov $0x103e04,%eax + 103b2a: ff d0 call *%eax + 103b2c: e9 b7 db ff ff jmp 1016e8 + +00103b31 : + 103b31: 6a 00 push $0x0 + 103b33: 6a f1 push $0xfffffff1 + 103b35: 0f a8 push %gs + 103b37: 0f a0 push %fs + 103b39: 06 push %es + 103b3a: 1e push %ds + 103b3b: 60 pusha + 103b3c: 66 b8 10 00 mov $0x10,%ax + 103b40: 8e d8 mov %eax,%ds + 103b42: 8e c0 mov %eax,%es + 103b44: 8e e0 mov %eax,%fs + 103b46: 8e e8 mov %eax,%gs + 103b48: 89 e0 mov %esp,%eax + 103b4a: 50 push %eax + +00103b4b : + 103b4b: b8 04 3e 10 00 mov $0x103e04,%eax + 103b50: ff d0 call *%eax + 103b52: e9 91 db ff ff jmp 1016e8 + +00103b57 : + 103b57: 6a 00 push $0x0 + 103b59: 6a f2 push $0xfffffff2 + 103b5b: 0f a8 push %gs + 103b5d: 0f a0 push %fs + 103b5f: 06 push %es + 103b60: 1e push %ds + 103b61: 60 pusha + 103b62: 66 b8 10 00 mov $0x10,%ax + 103b66: 8e d8 mov %eax,%ds + 103b68: 8e c0 mov %eax,%es + 103b6a: 8e e0 mov %eax,%fs + 103b6c: 8e e8 mov %eax,%gs + 103b6e: 89 e0 mov %esp,%eax + 103b70: 50 push %eax + +00103b71 : + 103b71: b8 04 3e 10 00 mov $0x103e04,%eax + 103b76: ff d0 call *%eax + 103b78: e9 6b db ff ff jmp 1016e8 + +00103b7d : + 103b7d: 6a 00 push $0x0 + 103b7f: 6a f3 push $0xfffffff3 + 103b81: 0f a8 push %gs + 103b83: 0f a0 push %fs + 103b85: 06 push %es + 103b86: 1e push %ds + 103b87: 60 pusha + 103b88: 66 b8 10 00 mov $0x10,%ax + 103b8c: 8e d8 mov %eax,%ds + 103b8e: 8e c0 mov %eax,%es + 103b90: 8e e0 mov %eax,%fs + 103b92: 8e e8 mov %eax,%gs + 103b94: 89 e0 mov %esp,%eax + 103b96: 50 push %eax + +00103b97 : + 103b97: b8 04 3e 10 00 mov $0x103e04,%eax + 103b9c: ff d0 call *%eax + 103b9e: e9 45 db ff ff jmp 1016e8 + +00103ba3 : + 103ba3: 6a 00 push $0x0 + 103ba5: 6a f4 push $0xfffffff4 + 103ba7: 0f a8 push %gs + 103ba9: 0f a0 push %fs + 103bab: 06 push %es + 103bac: 1e push %ds + 103bad: 60 pusha + 103bae: 66 b8 10 00 mov $0x10,%ax + 103bb2: 8e d8 mov %eax,%ds + 103bb4: 8e c0 mov %eax,%es + 103bb6: 8e e0 mov %eax,%fs + 103bb8: 8e e8 mov %eax,%gs + 103bba: 89 e0 mov %esp,%eax + 103bbc: 50 push %eax + +00103bbd : + 103bbd: b8 04 3e 10 00 mov $0x103e04,%eax + 103bc2: ff d0 call *%eax + 103bc4: e9 1f db ff ff jmp 1016e8 + +00103bc9 : + 103bc9: 6a 00 push $0x0 + 103bcb: 6a f5 push $0xfffffff5 + 103bcd: 0f a8 push %gs + 103bcf: 0f a0 push %fs + 103bd1: 06 push %es + 103bd2: 1e push %ds + 103bd3: 60 pusha + 103bd4: 66 b8 10 00 mov $0x10,%ax + 103bd8: 8e d8 mov %eax,%ds + 103bda: 8e c0 mov %eax,%es + 103bdc: 8e e0 mov %eax,%fs + 103bde: 8e e8 mov %eax,%gs + 103be0: 89 e0 mov %esp,%eax + 103be2: 50 push %eax + +00103be3 : + 103be3: b8 04 3e 10 00 mov $0x103e04,%eax + 103be8: ff d0 call *%eax + 103bea: e9 f9 da ff ff jmp 1016e8 + +00103bef : + 103bef: 6a 00 push $0x0 + 103bf1: 6a f6 push $0xfffffff6 + 103bf3: 0f a8 push %gs + 103bf5: 0f a0 push %fs + 103bf7: 06 push %es + 103bf8: 1e push %ds + 103bf9: 60 pusha + 103bfa: 66 b8 10 00 mov $0x10,%ax + 103bfe: 8e d8 mov %eax,%ds + 103c00: 8e c0 mov %eax,%es + 103c02: 8e e0 mov %eax,%fs + 103c04: 8e e8 mov %eax,%gs + 103c06: 89 e0 mov %esp,%eax + 103c08: 50 push %eax + +00103c09 : + 103c09: b8 04 3e 10 00 mov $0x103e04,%eax + 103c0e: ff d0 call *%eax + 103c10: e9 d3 da ff ff jmp 1016e8 + +00103c15 : + 103c15: 6a 00 push $0x0 + 103c17: 6a f7 push $0xfffffff7 + 103c19: 0f a8 push %gs + 103c1b: 0f a0 push %fs + 103c1d: 06 push %es + 103c1e: 1e push %ds + 103c1f: 60 pusha + 103c20: 66 b8 10 00 mov $0x10,%ax + 103c24: 8e d8 mov %eax,%ds + 103c26: 8e c0 mov %eax,%es + 103c28: 8e e0 mov %eax,%fs + 103c2a: 8e e8 mov %eax,%gs + 103c2c: 89 e0 mov %esp,%eax + 103c2e: 50 push %eax + +00103c2f : + 103c2f: b8 04 3e 10 00 mov $0x103e04,%eax + 103c34: ff d0 call *%eax + 103c36: e9 ad da ff ff jmp 1016e8 + +00103c3b : + 103c3b: 6a 00 push $0x0 + 103c3d: 6a f8 push $0xfffffff8 + 103c3f: 0f a8 push %gs + 103c41: 0f a0 push %fs + 103c43: 06 push %es + 103c44: 1e push %ds + 103c45: 60 pusha + 103c46: 66 b8 10 00 mov $0x10,%ax + 103c4a: 8e d8 mov %eax,%ds + 103c4c: 8e c0 mov %eax,%es + 103c4e: 8e e0 mov %eax,%fs + 103c50: 8e e8 mov %eax,%gs + 103c52: 89 e0 mov %esp,%eax + 103c54: 50 push %eax + +00103c55 : + 103c55: b8 04 3e 10 00 mov $0x103e04,%eax + 103c5a: ff d0 call *%eax + 103c5c: e9 87 da ff ff jmp 1016e8 + +00103c61 : + 103c61: 6a 00 push $0x0 + 103c63: 6a f9 push $0xfffffff9 + 103c65: 0f a8 push %gs + 103c67: 0f a0 push %fs + 103c69: 06 push %es + 103c6a: 1e push %ds + 103c6b: 60 pusha + 103c6c: 66 b8 10 00 mov $0x10,%ax + 103c70: 8e d8 mov %eax,%ds + 103c72: 8e c0 mov %eax,%es + 103c74: 8e e0 mov %eax,%fs + 103c76: 8e e8 mov %eax,%gs + 103c78: 89 e0 mov %esp,%eax + 103c7a: 50 push %eax + +00103c7b : + 103c7b: b8 04 3e 10 00 mov $0x103e04,%eax + 103c80: ff d0 call *%eax + 103c82: e9 61 da ff ff jmp 1016e8 + +00103c87 : + 103c87: 6a 00 push $0x0 + 103c89: 6a fa push $0xfffffffa + 103c8b: 0f a8 push %gs + 103c8d: 0f a0 push %fs + 103c8f: 06 push %es + 103c90: 1e push %ds + 103c91: 60 pusha + 103c92: 66 b8 10 00 mov $0x10,%ax + 103c96: 8e d8 mov %eax,%ds + 103c98: 8e c0 mov %eax,%es + 103c9a: 8e e0 mov %eax,%fs + 103c9c: 8e e8 mov %eax,%gs + 103c9e: 89 e0 mov %esp,%eax + 103ca0: 50 push %eax + +00103ca1 : + 103ca1: b8 04 3e 10 00 mov $0x103e04,%eax + 103ca6: ff d0 call *%eax + 103ca8: e9 3b da ff ff jmp 1016e8 + +00103cad : + 103cad: 6a 00 push $0x0 + 103caf: 6a fb push $0xfffffffb + 103cb1: 0f a8 push %gs + 103cb3: 0f a0 push %fs + 103cb5: 06 push %es + 103cb6: 1e push %ds + 103cb7: 60 pusha + 103cb8: 66 b8 10 00 mov $0x10,%ax + 103cbc: 8e d8 mov %eax,%ds + 103cbe: 8e c0 mov %eax,%es + 103cc0: 8e e0 mov %eax,%fs + 103cc2: 8e e8 mov %eax,%gs + 103cc4: 89 e0 mov %esp,%eax + 103cc6: 50 push %eax + +00103cc7 : + 103cc7: b8 04 3e 10 00 mov $0x103e04,%eax + 103ccc: ff d0 call *%eax + 103cce: e9 15 da ff ff jmp 1016e8 + +00103cd3 : + 103cd3: 6a 00 push $0x0 + 103cd5: 6a fc push $0xfffffffc + 103cd7: 0f a8 push %gs + 103cd9: 0f a0 push %fs + 103cdb: 06 push %es + 103cdc: 1e push %ds + 103cdd: 60 pusha + 103cde: 66 b8 10 00 mov $0x10,%ax + 103ce2: 8e d8 mov %eax,%ds + 103ce4: 8e c0 mov %eax,%es + 103ce6: 8e e0 mov %eax,%fs + 103ce8: 8e e8 mov %eax,%gs + 103cea: 89 e0 mov %esp,%eax + 103cec: 50 push %eax + +00103ced : + 103ced: b8 04 3e 10 00 mov $0x103e04,%eax + 103cf2: ff d0 call *%eax + 103cf4: e9 ef d9 ff ff jmp 1016e8 + +00103cf9 : + 103cf9: 6a 00 push $0x0 + 103cfb: 6a fd push $0xfffffffd + 103cfd: 0f a8 push %gs + 103cff: 0f a0 push %fs + 103d01: 06 push %es + 103d02: 1e push %ds + 103d03: 60 pusha + 103d04: 66 b8 10 00 mov $0x10,%ax + 103d08: 8e d8 mov %eax,%ds + 103d0a: 8e c0 mov %eax,%es + 103d0c: 8e e0 mov %eax,%fs + 103d0e: 8e e8 mov %eax,%gs + 103d10: 89 e0 mov %esp,%eax + 103d12: 50 push %eax + +00103d13 : + 103d13: b8 04 3e 10 00 mov $0x103e04,%eax + 103d18: ff d0 call *%eax + 103d1a: e9 c9 d9 ff ff jmp 1016e8 + +00103d1f : + 103d1f: 6a 00 push $0x0 + 103d21: 6a fe push $0xfffffffe + 103d23: 0f a8 push %gs + 103d25: 0f a0 push %fs + 103d27: 06 push %es + 103d28: 1e push %ds + 103d29: 60 pusha + 103d2a: 66 b8 10 00 mov $0x10,%ax + 103d2e: 8e d8 mov %eax,%ds + 103d30: 8e c0 mov %eax,%es + 103d32: 8e e0 mov %eax,%fs + 103d34: 8e e8 mov %eax,%gs + 103d36: 89 e0 mov %esp,%eax + 103d38: 50 push %eax + +00103d39 : + 103d39: b8 04 3e 10 00 mov $0x103e04,%eax + 103d3e: ff d0 call *%eax + 103d40: e9 a3 d9 ff ff jmp 1016e8 + +00103d45 : + 103d45: 6a 00 push $0x0 + 103d47: 6a ff push $0xffffffff + 103d49: 0f a8 push %gs + 103d4b: 0f a0 push %fs + 103d4d: 06 push %es + 103d4e: 1e push %ds + 103d4f: 60 pusha + 103d50: 66 b8 10 00 mov $0x10,%ax + 103d54: 8e d8 mov %eax,%ds + 103d56: 8e c0 mov %eax,%es + 103d58: 8e e0 mov %eax,%fs + 103d5a: 8e e8 mov %eax,%gs + 103d5c: 89 e0 mov %esp,%eax + 103d5e: 50 push %eax + +00103d5f : + 103d5f: b8 04 3e 10 00 mov $0x103e04,%eax + 103d64: ff d0 call *%eax + 103d66: e9 7d d9 ff ff jmp 1016e8 + ... + +00103d6c : +/** + * printf/kprintf helper + */ +static int kprintf_help(unsigned c, void **ptr) +{ + 103d6c: 55 push %ebp + 103d6d: 89 e5 mov %esp,%ebp + 103d6f: 83 ec 14 sub $0x14,%esp + /** + * Leave this for now + */ + ptr = ptr; + + putch(c); + 103d72: ff 75 08 pushl 0x8(%ebp) + 103d75: e8 86 0d 00 00 call 104b00 + return 0; +} + 103d7a: 31 c0 xor %eax,%eax + 103d7c: c9 leave + 103d7d: c3 ret + 103d7e: 89 f6 mov %esi,%esi + +00103d80 : + +/** + * Format output and print it to stdout (vtty0) + * Just like on any other operating system + */ +/*void printf(const char *fmt, ...) +{ + va_list args; + + va_start(args, fmt); + (void)do_printf(fmt, args, kprintf_help, NULL); + va_end(args); +}*/ + +void kprintf(const char *fmt, ...) +{ + 103d80: 55 push %ebp + 103d81: 89 e5 mov %esp,%ebp + 103d83: 83 ec 08 sub $0x8,%esp + va_list args; + + va_start(args, fmt); + (void)do_printf(fmt, args, kprintf_help, NULL); + 103d86: 6a 00 push $0x0 + 103d88: 68 6c 3d 10 00 push $0x103d6c + 103d8d: 8d 45 0c lea 0xc(%ebp),%eax + 103d90: 50 push %eax + 103d91: ff 75 08 pushl 0x8(%ebp) + 103d94: e8 37 0f 00 00 call 104cd0 + va_end(args); +} + 103d99: c9 leave + 103d9a: c3 ret + 103d9b: 90 nop + +00103d9c : + +/** + * Format output and print it to stdout (vtty0) + * Just like on any other operating system + */ +void printk(const char *fmt, ...) +{ + 103d9c: 55 push %ebp + 103d9d: 89 e5 mov %esp,%ebp + 103d9f: 83 ec 08 sub $0x8,%esp + va_list args; + + /** + * TODO + * + * Select vtty0 + */ + va_start(args, fmt); + (void)do_printf(fmt, args, kprintf_help, NULL); + 103da2: 6a 00 push $0x0 + 103da4: 68 6c 3d 10 00 push $0x103d6c + 103da9: 8d 45 0c lea 0xc(%ebp),%eax + 103dac: 50 push %eax + 103dad: ff 75 08 pushl 0x8(%ebp) + 103db0: e8 1b 0f 00 00 call 104cd0 + va_end(args); +} + 103db5: c9 leave + 103db6: c3 ret + 103db7: 90 nop + +00103db8 : + +/** + * Oh yeah, the fun function ;) + */ +void panic(const char *fmt, ...) +{ + 103db8: 55 push %ebp + 103db9: 89 e5 mov %esp,%ebp + 103dbb: 53 push %ebx + 103dbc: 50 push %eax + va_list args; + + disable(); /* interrupts off */ + 103dbd: e8 06 0f 00 00 call 104cc8 + va_start(args, fmt); + _vc[0].attrib = 15; + printf("\n\npanic: "); + 103dc2: 83 ec 0c sub $0xc,%esp + 103dc5: 68 cd 58 10 00 push $0x1058cd + 103dca: c7 05 f8 a2 19 00 0f movl $0xf,0x19a2f8 + 103dd1: 00 00 00 + 103dd4: e8 fb 12 00 00 call 1050d4 + (void)do_printf(fmt, args, kprintf_help, NULL); + 103dd9: 6a 00 push $0x0 + 103ddb: 68 6c 3d 10 00 push $0x103d6c + 103de0: 8d 5d 0c lea 0xc(%ebp),%ebx + 103de3: 53 push %ebx + 103de4: ff 75 08 pushl 0x8(%ebp) + 103de7: e8 e4 0e 00 00 call 104cd0 + + printf("\n\nSystem halted."); + 103dec: 83 c4 14 add $0x14,%esp + 103def: 68 d7 58 10 00 push $0x1058d7 + 103df4: e8 db 12 00 00 call 1050d4 + __asm__ __volatile__ ("hlt"); + 103df9: f4 hlt + + while(1) + 103dfa: 83 c4 10 add $0x10,%esp + 103dfd: 8d 76 00 lea 0x0(%esi),%esi + 103e00: eb fe jmp 103e00 + 103e02: 89 f6 mov %esi,%esi + +00103e04 : + /* freeze */; +} + +/** + * Called when a kernel fault is detected. This does not + * (normally) get called when something goes awry in + * user-space, therefore it is designed for kernel-space + */ +void fault(regs_t *regs) +{ + 103e04: 55 push %ebp + 103e05: 89 e5 mov %esp,%ebp + 103e07: 53 push %ebx + 103e08: 52 push %edx + 103e09: 8b 5d 08 mov 0x8(%ebp),%ebx + struct exception + { + char *message; + int signal; + int processor; + }; + + static const struct exception ex[] = + { + {"Divide error", SIGFPE, 86}, + {"Debug exception", SIGTRAP, 86}, + {"Nonmaskable interrupt (NMI)", SIGBUS, 86}, + {"Breakpoint (INT3)", SIGEMT, 86}, + {"Overflow (INTO)", SIGFPE, 186}, + {"Bounds check", SIGFPE, 186}, + {"Invalid opcode", SIGILL, 186}, + {"Coprocessor not available", SIGFPE, 186}, + {"Double fault", SIGBUS, 286}, + {"Coprocessor segment overrun", SIGSEGV, 286}, + {"Invalid TSS", SIGSEGV, 286}, + {"Segment not present", SIGSEGV, 286}, + {"Stack exception", SIGSEGV, 286}, + {"General Protection Fault", SIGSEGV, 286}, + {"Page fault", SIGSEGV, 386}, + {NULL, SIGILL, 0}, + {"Coprocessor error", SIGFPE, 386}, + {"Alignment check",0,0}, + {"??",0,0}, + {"??",0,0}, + {"??",0,0}, + {"??",0,0}, + {"??",0,0}, + {"??",0,0}, + {"??",0,0}, + {"??",0,0}, + {"??",0,0}, + {"??",0,0}, + {"??",0,0}, + {"??",0,0}, + {"??",0,0}, + {"??",0,0}, + {"IRQ0",0,0}, + {"IRQ1",0,0}, + {"IRQ2",0,0}, + {"IRQ3",0,0}, + {"IRQ4",0,0}, + {"IRQ5",0,0}, + {"IRQ6",0,0}, + {"IRQ7",0,0}, + {"IRQ8",0,0}, + {"IRQ9",0,0}, + {"IRQ10",0,0}, + {"IRQ11",0,0}, + {"IRQ12",0,0}, + {"IRQ13",0,0}, + {"IRQ14",0,0}, + {"IRQ15",0,0}, + {"syscall",0,0} + }; + + + switch(regs->which_int) + 103e0c: 83 7b 30 20 cmpl $0x20,0x30(%ebx) + 103e10: 74 6e je 103e80 + { + /** + * this handler installed at compile-time + * Keyboard handler is installed at run-time (see below) + */ + case 0x20: /* timer IRQ 0 */ + //blink(); + /** + * reset hardware interrupt at 8259 chip + */ + outportb(0x20, 0x20); + break; + default: + _vc[0].attrib = 15; + printf("\n\npanic: Exception 0x%08X", regs->which_int); + 103e12: 83 ec 08 sub $0x8,%esp + 103e15: c7 05 f8 a2 19 00 0f movl $0xf,0x19a2f8 + 103e1c: 00 00 00 + 103e1f: ff 73 30 pushl 0x30(%ebx) + 103e22: 68 79 5a 10 00 push $0x105a79 + 103e27: e8 a8 12 00 00 call 1050d4 + if(regs->which_int <= sizeof(ex) / sizeof(ex[0].message)) + 103e2c: 8b 43 30 mov 0x30(%ebx),%eax + 103e2f: 83 c4 10 add $0x10,%esp + 103e32: 3d 93 00 00 00 cmp $0x93,%eax + 103e37: 76 2b jbe 103e64 + printf(" (%s)", ex[regs->which_int].message); + printf("\n"); + 103e39: 83 ec 0c sub $0xc,%esp + 103e3c: 68 f8 5a 10 00 push $0x105af8 + 103e41: e8 8e 12 00 00 call 1050d4 + dump_regs(regs); + 103e46: 89 1c 24 mov %ebx,(%esp,1) + 103e49: e8 7e c3 ff ff call 1001cc + printf("\n\nSystem halted."); + 103e4e: c7 04 24 d7 58 10 00 movl $0x1058d7,(%esp,1) + 103e55: e8 7a 12 00 00 call 1050d4 + __asm__ __volatile__ ("hlt"); + 103e5a: f4 hlt + break; + 103e5b: 83 c4 10 add $0x10,%esp + } +} + 103e5e: 8b 5d fc mov 0xfffffffc(%ebp),%ebx + 103e61: c9 leave + 103e62: c3 ret + 103e63: 90 nop + 103e64: 83 ec 08 sub $0x8,%esp + 103e67: 8d 04 40 lea (%eax,%eax,2),%eax + 103e6a: ff 34 85 00 5b 10 00 pushl 0x105b00(,%eax,4) + 103e71: 68 93 5a 10 00 push $0x105a93 + 103e76: e8 59 12 00 00 call 1050d4 + 103e7b: 83 c4 10 add $0x10,%esp + 103e7e: eb b9 jmp 103e39 + 103e80: 83 ec 08 sub $0x8,%esp + 103e83: 6a 20 push $0x20 + 103e85: 6a 20 push $0x20 + 103e87: e8 28 12 00 00 call 1050b4 + 103e8c: eb cd jmp 103e5b + 103e8e: 89 f6 mov %esi,%esi + +00103e90 : + +/** + * ?? + */ +static void init_8259s(void) +{ + 103e90: 55 push %ebp + 103e91: 89 e5 mov %esp,%ebp + 103e93: 83 ec 10 sub $0x10,%esp + static const unsigned irq0_int = 0x20, irq8_int = 0x28; + + /** + * Initialization Control Word #1 (ICW1) + */ + outportb(0x20, 0x11); + 103e96: 6a 11 push $0x11 + 103e98: 6a 20 push $0x20 + 103e9a: e8 15 12 00 00 call 1050b4 + outportb(0xA0, 0x11); + 103e9f: 59 pop %ecx + 103ea0: 58 pop %eax + 103ea1: 6a 11 push $0x11 + 103ea3: 68 a0 00 00 00 push $0xa0 + 103ea8: e8 07 12 00 00 call 1050b4 + + /** + * ICW2: + * route IRQs 0-7 to INTs 20h-27h + */ + outportb(0x21, irq0_int); + 103ead: 58 pop %eax + 103eae: 5a pop %edx + 103eaf: 6a 20 push $0x20 + 103eb1: 6a 21 push $0x21 + 103eb3: e8 fc 11 00 00 call 1050b4 + + /** + * route IRQs 8-15 to INTs 28h-2Fh + */ + outportb(0xA1, irq8_int); + 103eb8: 59 pop %ecx + 103eb9: 58 pop %eax + 103eba: 6a 28 push $0x28 + 103ebc: 68 a1 00 00 00 push $0xa1 + 103ec1: e8 ee 11 00 00 call 1050b4 + + /** + * ICW3 + */ + outportb(0x21, 0x04); + 103ec6: 58 pop %eax + 103ec7: 5a pop %edx + 103ec8: 6a 04 push $0x4 + 103eca: 6a 21 push $0x21 + 103ecc: e8 e3 11 00 00 call 1050b4 + outportb(0xA1, 0x02); + 103ed1: 59 pop %ecx + 103ed2: 58 pop %eax + 103ed3: 6a 02 push $0x2 + 103ed5: 68 a1 00 00 00 push $0xa1 + 103eda: e8 d5 11 00 00 call 1050b4 + + /** + * ICW4 + */ + outportb(0x21, 0x01); + 103edf: 58 pop %eax + 103ee0: 5a pop %edx + 103ee1: 6a 01 push $0x1 + 103ee3: 6a 21 push $0x21 + 103ee5: e8 ca 11 00 00 call 1050b4 + outportb(0xA1, 0x01); + 103eea: 59 pop %ecx + 103eeb: 58 pop %eax + 103eec: 6a 01 push $0x1 + 103eee: 68 a1 00 00 00 push $0xa1 + 103ef3: e8 bc 11 00 00 call 1050b4 + + /** + * enable IRQ0 (timer) and IRQ1 (keyboard) + */ + outportb(0x21, ~0x03); + 103ef8: 58 pop %eax + 103ef9: 5a pop %edx + 103efa: 6a fc push $0xfffffffc + 103efc: 6a 21 push $0x21 + 103efe: e8 b1 11 00 00 call 1050b4 + outportb(0xA1, ~0x00); + 103f03: 59 pop %ecx + 103f04: 58 pop %eax + 103f05: 6a ff push $0xffffffff + 103f07: 68 a1 00 00 00 push $0xa1 + 103f0c: e8 a3 11 00 00 call 1050b4 +} + 103f11: c9 leave + 103f12: c3 ret + 103f13: 90 nop + +00103f14 : + +/** + * MinGW32 + */ +#ifdef __WIN32__ +#if __GNUC__<3 +#error Do not use MinGW GCC 2.x with NASM +#endif + int __main(void) { return 0; } + void _alloca(void) { } +#endif + +/** + * malloc, realloc, free, etc + */ +static char *g_heap_bot, *g_kbrk, *g_heap_top; +static void dump_heap(void) +{ + 103f14: 55 push %ebp + 103f15: 89 e5 mov %esp,%ebp + 103f17: 57 push %edi + 103f18: 56 push %esi + 103f19: 53 push %ebx + 103f1a: 83 ec 18 sub $0x18,%esp + unsigned blks_used = 0, blks_free = 0; + size_t bytes_used = 0, bytes_free = 0; + malloc_t *m; + int total; + + kprintf("===============================================\n"); + 103f1d: 68 60 5d 10 00 push $0x105d60 + 103f22: c7 45 f0 00 00 00 00 movl $0x0,0xfffffff0(%ebp) + 103f29: c7 45 ec 00 00 00 00 movl $0x0,0xffffffec(%ebp) + 103f30: e8 4b fe ff ff call 103d80 + for(m = (malloc_t *)g_heap_bot; m != NULL; m = m->next) + 103f35: 8b 1d e0 36 18 00 mov 0x1836e0,%ebx + 103f3b: 31 ff xor %edi,%edi + 103f3d: 31 f6 xor %esi,%esi + 103f3f: 83 c4 10 add $0x10,%esp + 103f42: 85 db test %ebx,%ebx + 103f44: 74 39 je 103f7f + 103f46: 89 f6 mov %esi,%esi + { + printk("block %5p: %6u bytes %s\n", m, + 103f48: f6 43 09 80 testb $0x80,0x9(%ebx) + 103f4c: 0f 84 be 00 00 00 je 104010 + 103f52: b8 99 5a 10 00 mov $0x105a99,%eax + 103f57: 50 push %eax + 103f58: ff 33 pushl (%ebx) + 103f5a: 53 push %ebx + 103f5b: 68 9e 5a 10 00 push $0x105a9e + 103f60: e8 37 fe ff ff call 103d9c + m->size, m->used ? "used" : "free"); + if(m->used) + 103f65: 83 c4 10 add $0x10,%esp + 103f68: f6 43 09 80 testb $0x80,0x9(%ebx) + 103f6c: 0f 84 92 00 00 00 je 104004 + { + blks_used++; + bytes_used += m->size; + 103f72: 8b 03 mov (%ebx),%eax + 103f74: 47 inc %edi + 103f75: 01 45 f0 add %eax,0xfffffff0(%ebp) + 103f78: 8b 5b 04 mov 0x4(%ebx),%ebx + 103f7b: 85 db test %ebx,%ebx + 103f7d: 75 c9 jne 103f48 + } + else + { + blks_free++; + bytes_free += m->size; + } + } + kprintf("blocks: %6u used, %6u free, %6u total\n", blks_used, + 103f7f: 8d 1c 3e lea (%esi,%edi,1),%ebx + 103f82: 53 push %ebx + 103f83: 56 push %esi + 103f84: 57 push %edi + 103f85: 68 a0 5d 10 00 push $0x105da0 + 103f8a: e8 f1 fd ff ff call 103d80 + blks_free, blks_used + blks_free); + kprintf(" bytes: %6u used, %6u free, %6u total\n", bytes_used, + 103f8f: 8b 75 f0 mov 0xfffffff0(%ebp),%esi + 103f92: 03 75 ec add 0xffffffec(%ebp),%esi + 103f95: 56 push %esi + 103f96: ff 75 ec pushl 0xffffffec(%ebp) + 103f99: ff 75 f0 pushl 0xfffffff0(%ebp) + 103f9c: 68 e0 5d 10 00 push $0x105de0 + 103fa1: e8 da fd ff ff call 103d80 + bytes_free, bytes_used + bytes_free); + kprintf("g_heap_bot=0x%p, g_kbrk=0x%p, g_heap_top=0x%p\n", + 103fa6: 83 c4 20 add $0x20,%esp + 103fa9: ff 35 e8 36 18 00 pushl 0x1836e8 + 103faf: ff 35 e4 36 18 00 pushl 0x1836e4 + 103fb5: ff 35 e0 36 18 00 pushl 0x1836e0 + 103fbb: 68 20 5e 10 00 push $0x105e20 + 103fc0: e8 bb fd ff ff call 103d80 + g_heap_bot, g_kbrk, g_heap_top); + total = (bytes_used + bytes_free) + + 103fc5: 8d 1c 5b lea (%ebx,%ebx,2),%ebx + (blks_used + blks_free) * sizeof(malloc_t); + if(total != g_kbrk - g_heap_bot) + 103fc8: a1 e4 36 18 00 mov 0x1836e4,%eax + 103fcd: 8d 1c 9e lea (%esi,%ebx,4),%ebx + 103fd0: 2b 05 e0 36 18 00 sub 0x1836e0,%eax + 103fd6: 83 c4 10 add $0x10,%esp + 103fd9: 39 c3 cmp %eax,%ebx + 103fdb: 74 10 je 103fed + kprintf("*** some heap memory is not accounted for\n"); + 103fdd: 83 ec 0c sub $0xc,%esp + 103fe0: 68 60 5e 10 00 push $0x105e60 + 103fe5: e8 96 fd ff ff call 103d80 + 103fea: 83 c4 10 add $0x10,%esp + kprintf("===============================================\n"); + 103fed: 83 ec 0c sub $0xc,%esp + 103ff0: 68 60 5d 10 00 push $0x105d60 + 103ff5: e8 86 fd ff ff call 103d80 +} + 103ffa: 8d 65 f4 lea 0xfffffff4(%ebp),%esp + 103ffd: 5b pop %ebx + 103ffe: 5e pop %esi + 103fff: 5f pop %edi + 104000: c9 leave + 104001: c3 ret + 104002: 89 f6 mov %esi,%esi + 104004: 8b 03 mov (%ebx),%eax + 104006: 46 inc %esi + 104007: 01 45 ec add %eax,0xffffffec(%ebp) + 10400a: e9 69 ff ff ff jmp 103f78 + 10400f: 90 nop + 104010: b8 b7 5a 10 00 mov $0x105ab7,%eax + 104015: e9 3d ff ff ff jmp 103f57 + 10401a: 89 f6 mov %esi,%esi + +0010401c : + +void dumpheapk(void) +{ + 10401c: 55 push %ebp + 10401d: 89 e5 mov %esp,%ebp + dump_heap(); + 10401f: c9 leave + 104020: e9 ef fe ff ff jmp 103f14 + 104025: 8d 76 00 lea 0x0(%esi),%esi + +00104028 : +} + +/** + * POSIX sbrk() looks like this + * void *sbrk(int incr); + * + * Mine is a bit different so I can signal the calling function + * if more memory than desired was allocated (e.g. in a system with paging) + * If your kbrk()/sbrk() always allocates the amount of memory you ask for, + * this code can be easily changed. + * + * int brk( void *sbrk( void *kbrk( + * function void *adr); int delta); int *delta); + * ---------------------- ------------ ------------ ------------- + * POSIX? yes yes NO + * return value if error -1 -1 NULL + * get break value . sbrk(0) int x=0; kbrk(&x); + * set break value to X brk(X) sbrk(X - sbrk(0)) int x=X, y=0; kbrk(&x) - kbrk(&y); + * enlarge heap by N bytes . sbrk(+N) int x=N; kbrk(&x); + * shrink heap by N bytes . sbrk(-N) int x=-N; kbrk(&x); + * can you tell if you're + * given more memory + * than you wanted? no no yes + */ +static void *kbrk(int *delta) +{ + static char heap[HEAP_SIZE]; + char *new_brk, *old_brk; + + /** + * heap doesn't exist yet + */ + if(g_heap_bot == NULL) + 104028: 8b 0d e0 36 18 00 mov 0x1836e0,%ecx + 10402e: 55 push %ebp + 10402f: 85 c9 test %ecx,%ecx + 104031: 89 e5 mov %esp,%ebp + 104033: 53 push %ebx + 104034: 75 1f jne 104055 + { + g_heap_bot = g_kbrk = heap; + 104036: b9 c0 95 10 00 mov $0x1095c0,%ecx + 10403b: c7 05 e4 36 18 00 c0 movl $0x1095c0,0x1836e4 + 104042: 95 10 00 + 104045: 89 0d e0 36 18 00 mov %ecx,0x1836e0 + g_heap_top = g_heap_bot + HEAP_SIZE; + 10404b: c7 05 e8 36 18 00 e0 movl $0x1836e0,0x1836e8 + 104052: 36 18 00 + } + new_brk = g_kbrk + (*delta); + 104055: 8b 1d e4 36 18 00 mov 0x1836e4,%ebx + 10405b: 8b 45 08 mov 0x8(%ebp),%eax + 10405e: 89 da mov %ebx,%edx + 104060: 03 10 add (%eax),%edx + + /** + * too low: return NULL + */ + if(new_brk < g_heap_bot) + 104062: 31 c0 xor %eax,%eax + 104064: 39 ca cmp %ecx,%edx + 104066: 72 10 jb 104078 + return NULL; + + /** + * too high: return NULL + */ + if(new_brk >= g_heap_top) + 104068: 3b 15 e8 36 18 00 cmp 0x1836e8,%edx + 10406e: 73 08 jae 104078 + return NULL; + + /** + * success: adjust brk value... + */ + old_brk = g_kbrk; + g_kbrk = new_brk; + 104070: 89 15 e4 36 18 00 mov %edx,0x1836e4 + + /** + * ...return actual delta... (for this sbrk(), they are the same) + * (*delta) = (*delta); + * ...return old brk value + */ + return old_brk; + 104076: 89 d8 mov %ebx,%eax +} + 104078: 8b 1c 24 mov (%esp,1),%ebx + 10407b: c9 leave + 10407c: c3 ret + 10407d: 8d 76 00 lea 0x0(%esi),%esi + +00104080 : + +/** + * malloc() and free() use g_heap_bot, but not g_kbrk nor g_heap_top + */ +void *kmalloc(size_t size) +{ + 104080: 55 push %ebp + 104081: 89 e5 mov %esp,%ebp + 104083: 57 push %edi + 104084: 56 push %esi + 104085: 53 push %ebx + 104086: 83 ec 0c sub $0xc,%esp + 104089: 8b 7d 08 mov 0x8(%ebp),%edi + unsigned total_size; + malloc_t *m, *n; + int delta; + + if(size == 0) + 10408c: 31 c0 xor %eax,%eax + 10408e: 85 ff test %edi,%edi + 104090: 0f 84 af 00 00 00 je 104145 + return NULL; + total_size = size + sizeof(malloc_t); + + /** + * search heap for free block (FIRST FIT) + */ + m = (malloc_t *)g_heap_bot; + 104096: 8b 1d e0 36 18 00 mov 0x1836e0,%ebx + + /** + * g_heap_bot == 0 == NULL if heap does not yet exist + */ + if(m != NULL) + 10409c: 85 db test %ebx,%ebx + 10409e: 8d 77 0c lea 0xc(%edi),%esi + 1040a1: 74 35 je 1040d8 + { + if(m->magic != MALLOC_MAGIC) + 1040a3: 0f b7 43 08 movzwl 0x8(%ebx),%eax + 1040a7: 25 ff 7f 00 00 and $0x7fff,%eax + 1040ac: 3d 92 6d 00 00 cmp $0x6d92,%eax + 1040b1: 0f 85 e5 00 00 00 jne 10419c + { + /*printf("*** kernel heap is corrupt in kmalloc()\n");*/ + panic("kernel heap is corrupt in malloc()"); + return NULL; + } + for(; m->next != NULL; m = m->next) + 1040b7: 8b 43 04 mov 0x4(%ebx),%eax + 1040ba: 85 c0 test %eax,%eax + 1040bc: 74 1a je 1040d8 + 1040be: 89 f6 mov %esi,%esi + { + if(m->used) + 1040c0: 8a 53 09 mov 0x9(%ebx),%dl + 1040c3: f6 c2 80 test $0x80,%dl + 1040c6: 0f 84 8c 00 00 00 je 104158 + 1040cc: 89 c3 mov %eax,%ebx + 1040ce: 8b 40 04 mov 0x4(%eax),%eax + 1040d1: 85 c0 test %eax,%eax + 1040d3: 75 eb jne 1040c0 + 1040d5: 8d 76 00 lea 0x0(%esi),%esi + continue; + + /** + * size == m->size is a perfect fit + */ + if(size == m->size) + m->used = 1; + else + { + /** + * otherwise, we need an extra sizeof(malloc_t) bytes for the header + * of a second, free block + */ + if(total_size > m->size) + continue; + + /** + * create a new, smaller free block after this one + */ + n = (malloc_t *)((char *)m + total_size); + n->size = m->size - total_size; + n->next = m->next; + n->magic = MALLOC_MAGIC; + n->used = 0; + + /** + * reduce the size of this block and mark it used + */ + m->size = size; + m->next = n; + m->used = 1; + } + return (char *)m + sizeof(malloc_t); + } + } + + /** + * use kbrk() to enlarge (or create!) heap + */ + delta = total_size; + n = kbrk(&delta); + 1040d8: 83 ec 0c sub $0xc,%esp + 1040db: 8d 45 f0 lea 0xfffffff0(%ebp),%eax + 1040de: 50 push %eax + 1040df: 89 75 f0 mov %esi,0xfffffff0(%ebp) + 1040e2: e8 41 ff ff ff call 104028 + 1040e7: 89 c2 mov %eax,%edx + + /** + * uh-oh + */ + if(n == NULL) + 1040e9: 83 c4 10 add $0x10,%esp + 1040ec: 31 c0 xor %eax,%eax + 1040ee: 85 d2 test %edx,%edx + 1040f0: 74 53 je 104145 + return NULL; + + if(m != NULL) + 1040f2: 85 db test %ebx,%ebx + 1040f4: 74 03 je 1040f9 + m->next = n; + 1040f6: 89 53 04 mov %edx,0x4(%ebx) + + n->size = size; + n->magic = MALLOC_MAGIC; + 1040f9: 66 8b 42 08 mov 0x8(%edx),%ax + 1040fd: 25 00 80 ff ff and $0xffff8000,%eax + 104102: 0d 92 6d 00 00 or $0x6d92,%eax + 104107: 66 89 42 08 mov %ax,0x8(%edx) + n->used = 1; + 10410b: 80 4a 09 80 orb $0x80,0x9(%edx) + + /** + * did kbrk() return the exact amount of memory we wanted? + * cast to make "gcc -Wall -W ..." shut the hell up + */ + if((int)total_size == delta) + 10410f: 8b 45 f0 mov 0xfffffff0(%ebp),%eax + 104112: 39 c6 cmp %eax,%esi + 104114: 89 3a mov %edi,(%edx) + 104116: 74 35 je 10414d + n->next = NULL; + else + { + + /** + * it returned more than we wanted (it will never return less): + * create a new, free block + */ + m = (malloc_t *)((char *)n + total_size); + m->size = delta - total_size - sizeof(malloc_t); + 104118: 29 f0 sub %esi,%eax + 10411a: 8d 1c 16 lea (%esi,%edx,1),%ebx + 10411d: 83 e8 0c sub $0xc,%eax + 104120: 89 03 mov %eax,(%ebx) + m->next = NULL; + m->magic = MALLOC_MAGIC; + 104122: 66 8b 43 08 mov 0x8(%ebx),%ax + 104126: 25 00 80 ff ff and $0xffff8000,%eax + 10412b: 0d 92 6d 00 00 or $0x6d92,%eax + 104130: 66 89 43 08 mov %ax,0x8(%ebx) + 104134: c7 43 04 00 00 00 00 movl $0x0,0x4(%ebx) + m->used = 0; + 10413b: 80 63 09 7f andb $0x7f,0x9(%ebx) + + n->next = m; + 10413f: 89 5a 04 mov %ebx,0x4(%edx) + } + return (char *)n + sizeof(malloc_t); + 104142: 8d 42 0c lea 0xc(%edx),%eax +} + 104145: 8d 65 f4 lea 0xfffffff4(%ebp),%esp + 104148: 5b pop %ebx + 104149: 5e pop %esi + 10414a: 5f pop %edi + 10414b: c9 leave + 10414c: c3 ret + 10414d: c7 42 04 00 00 00 00 movl $0x0,0x4(%edx) + 104154: eb ec jmp 104142 + 104156: 89 f6 mov %esi,%esi + 104158: 8b 0b mov (%ebx),%ecx + 10415a: 39 cf cmp %ecx,%edi + 10415c: 74 36 je 104194 + 10415e: 39 ce cmp %ecx,%esi + 104160: 0f 87 66 ff ff ff ja 1040cc + 104166: 8d 14 1e lea (%esi,%ebx,1),%edx + 104169: 89 42 04 mov %eax,0x4(%edx) + 10416c: 66 8b 42 08 mov 0x8(%edx),%ax + 104170: 25 00 80 ff ff and $0xffff8000,%eax + 104175: 0d 92 6d 00 00 or $0x6d92,%eax + 10417a: 66 89 42 08 mov %ax,0x8(%edx) + 10417e: 29 f1 sub %esi,%ecx + 104180: 80 62 09 7f andb $0x7f,0x9(%edx) + 104184: 89 0a mov %ecx,(%edx) + 104186: 89 53 04 mov %edx,0x4(%ebx) + 104189: 89 3b mov %edi,(%ebx) + 10418b: 80 4b 09 80 orb $0x80,0x9(%ebx) + 10418f: 8d 43 0c lea 0xc(%ebx),%eax + 104192: eb b1 jmp 104145 + 104194: 83 ca 80 or $0xffffff80,%edx + 104197: 88 53 09 mov %dl,0x9(%ebx) + 10419a: eb f3 jmp 10418f + 10419c: 83 ec 0c sub $0xc,%esp + 10419f: 68 a0 5e 10 00 push $0x105ea0 + 1041a4: e8 0f fc ff ff call 103db8 + 1041a9: 31 c0 xor %eax,%eax + 1041ab: eb 98 jmp 104145 + 1041ad: 8d 76 00 lea 0x0(%esi),%esi + +001041b0 : + +void kfree(void *blk) +{ + 1041b0: 55 push %ebp + 1041b1: 89 e5 mov %esp,%ebp + 1041b3: 56 push %esi + 1041b4: 53 push %ebx + 1041b5: 8b 5d 08 mov 0x8(%ebp),%ebx + malloc_t *m, *n; + + /** + * get address of header + */ + m = (malloc_t *)((char *)blk - sizeof(malloc_t)); + 1041b8: 8d 4b f4 lea 0xfffffff4(%ebx),%ecx + if(m->magic != MALLOC_MAGIC) + 1041bb: 0f b7 41 08 movzwl 0x8(%ecx),%eax + 1041bf: 25 ff 7f 00 00 and $0x7fff,%eax + 1041c4: 3d 92 6d 00 00 cmp $0x6d92,%eax + 1041c9: 74 15 je 1041e0 + { + /*printf("*** attempt to kfree() block at 0x%p with bad magic value\n", blk);*/ + panic("attempt to free() block at 0x%p with bad magic value", blk); + 1041cb: 83 ec 08 sub $0x8,%esp + 1041ce: 53 push %ebx + 1041cf: 68 e0 5e 10 00 push $0x105ee0 + 1041d4: e8 df fb ff ff call 103db8 + return; + } + + /** + * find this block in the heap + */ + n = (malloc_t *)g_heap_bot; + if(n->magic != MALLOC_MAGIC) + { + /*printf("*** kernel heap is corrupt in kfree()\n");*/ + panic("kernel heap is corrupt in free()"); + return; + } + for(; n != NULL; n = n->next) + { + if(n == m) + break; + } + + /** + * not found? bad pointer or no heap or something else? + */ + if(n == NULL) + { + /*printf("*** attempt to kfree() block at 0x%p that is not in the heap\n", blk);*/ + panic("attempt to free() block at 0x%p that is not in the heap", blk); + return; + } + + /** + * free the block + */ + m->used = 0; + + /** + * coalesce adjacent free blocks + * Hard to spell, hard to do + */ + for(m = (malloc_t *)g_heap_bot; m != NULL; m = m->next) + { + while(!m->used && m->next != NULL && !m->next->used) + { + /** + * resize this block + */ + m->size += sizeof(malloc_t) + m->next->size; + + /** + * merge with next block + */ + m->next = m->next->next; + } + } +} + 1041d9: 8d 65 f8 lea 0xfffffff8(%ebp),%esp + 1041dc: 5b pop %ebx + 1041dd: 5e pop %esi + 1041de: c9 leave + 1041df: c3 ret + 1041e0: 8b 15 e0 36 18 00 mov 0x1836e0,%edx + 1041e6: 0f b7 42 08 movzwl 0x8(%edx),%eax + 1041ea: 25 ff 7f 00 00 and $0x7fff,%eax + 1041ef: 3d 92 6d 00 00 cmp $0x6d92,%eax + 1041f4: 74 12 je 104208 + 1041f6: c7 45 08 20 5f 10 00 movl $0x105f20,0x8(%ebp) + 1041fd: 8d 65 f8 lea 0xfffffff8(%ebp),%esp + 104200: 5b pop %ebx + 104201: 5e pop %esi + 104202: c9 leave + 104203: e9 b0 fb ff ff jmp 103db8 + 104208: 85 d2 test %edx,%edx + 10420a: 74 0b je 104217 + 10420c: 39 ca cmp %ecx,%edx + 10420e: 74 12 je 104222 + 104210: 8b 52 04 mov 0x4(%edx),%edx + 104213: 85 d2 test %edx,%edx + 104215: 75 f5 jne 10420c + 104217: 83 ec 08 sub $0x8,%esp + 10421a: 53 push %ebx + 10421b: 68 60 5f 10 00 push $0x105f60 + 104220: eb b2 jmp 1041d4 + 104222: 85 d2 test %edx,%edx + 104224: 74 f1 je 104217 + 104226: 80 61 09 7f andb $0x7f,0x9(%ecx) + 10422a: 8b 0d e0 36 18 00 mov 0x1836e0,%ecx + 104230: 85 c9 test %ecx,%ecx + 104232: 74 a5 je 1041d9 + 104234: f6 41 09 80 testb $0x80,0x9(%ecx) + 104238: 75 46 jne 104280 + 10423a: 8b 51 04 mov 0x4(%ecx),%edx + 10423d: 85 d2 test %edx,%edx + 10423f: 89 d3 mov %edx,%ebx + 104241: 74 31 je 104274 + 104243: f6 42 09 80 testb $0x80,0x9(%edx) + 104247: 75 2b jne 104274 + 104249: 31 f6 xor %esi,%esi + 10424b: 90 nop + 10424c: 8b 03 mov (%ebx),%eax + 10424e: 03 01 add (%ecx),%eax + 104250: 83 c0 0c add $0xc,%eax + 104253: 89 01 mov %eax,(%ecx) + 104255: 85 f6 test %esi,%esi + 104257: 8b 43 04 mov 0x4(%ebx),%eax + 10425a: 89 41 04 mov %eax,0x4(%ecx) + 10425d: 89 c2 mov %eax,%edx + 10425f: 75 13 jne 104274 + 104261: 31 d2 xor %edx,%edx + 104263: 85 c0 test %eax,%eax + 104265: 74 0d je 104274 + 104267: f6 40 09 80 testb $0x80,0x9(%eax) + 10426b: 89 c3 mov %eax,%ebx + 10426d: 74 dd je 10424c + 10426f: 89 c2 mov %eax,%edx + 104271: 8d 76 00 lea 0x0(%esi),%esi + 104274: 85 d2 test %edx,%edx + 104276: 89 d1 mov %edx,%ecx + 104278: 75 ba jne 104234 + 10427a: e9 5a ff ff ff jmp 1041d9 + 10427f: 90 nop + 104280: 8b 51 04 mov 0x4(%ecx),%edx + 104283: eb ef jmp 104274 + 104285: 8d 76 00 lea 0x0(%esi),%esi + +00104288 : + +void testheap(void) +{ + 104288: 55 push %ebp + 104289: 89 e5 mov %esp,%ebp + 10428b: 83 ec 14 sub $0x14,%esp + //int i; + //char *t; + //kprintf("before char *t = kmalloc((size_t *)25):\n"); + //dump_heap(); + //t = kmalloc(25); + //strcpy(t, "123456789012345678901234"); + //kprintf("after char *t = kmalloc((size_t *)25):\n"); + //dump_heap(); + //kfree(t); + //kprintf("after kfree(t):\n"); + //dump_heap(); + //kprintf("before char *t = kmalloc((size_t *)25):\n"); + + kprintf("Unable to run testheap -- kmalloc() is broken.\n"); + 10428e: 68 a0 5f 10 00 push $0x105fa0 + 104293: e8 e8 fa ff ff call 103d80 +} + 104298: c9 leave + 104299: c3 ret + 10429a: 89 f6 mov %esi,%esi + +0010429c : + +void *krealloc(void *blk, size_t size) +{ + 10429c: 55 push %ebp + 10429d: 89 e5 mov %esp,%ebp + 10429f: 57 push %edi + 1042a0: 56 push %esi + 1042a1: 53 push %ebx + 1042a2: 83 ec 0c sub $0xc,%esp + 1042a5: 8b 5d 0c mov 0xc(%ebp),%ebx + void *new_blk; + malloc_t *m; + + /** + * size == 0: free block + */ + if(size == 0) + 1042a8: 85 db test %ebx,%ebx + 1042aa: 8b 75 08 mov 0x8(%ebp),%esi + 1042ad: 75 1d jne 1042cc + { + if(blk != NULL) + 1042af: 85 f6 test %esi,%esi + 1042b1: 74 0c je 1042bf + kfree(blk); + 1042b3: 83 ec 0c sub $0xc,%esp + 1042b6: 56 push %esi + 1042b7: e8 f4 fe ff ff call 1041b0 + 1042bc: 83 c4 10 add $0x10,%esp + new_blk = NULL; + 1042bf: 31 ff xor %edi,%edi + } + else + { + /** + * allocate new block + */ + new_blk = kmalloc(size); + + /** + * if allocation OK, and if old block exists, copy old block to new + */ + if(new_blk != NULL && blk != NULL) + { + m = (malloc_t *)((char *)blk - sizeof(malloc_t)); + if(m->magic != MALLOC_MAGIC) + { + /*printf("*** attempt to krealloc() block at 0x%p with bad magic value\n", blk);*/ + panic("attempt to realloc() block at 0x%p with bad magic value", blk); + return NULL; + } + + /** + * copy minimum of old and new block sizes + */ + if(size > m->size) + size = m->size; + memcpy(new_blk, blk, size); + + /** + * free the old block + */ + kfree(blk); + } + } + return new_blk; + 1042c1: 89 f8 mov %edi,%eax +} + 1042c3: 8d 65 f4 lea 0xfffffff4(%ebp),%esp + 1042c6: 5b pop %ebx + 1042c7: 5e pop %esi + 1042c8: 5f pop %edi + 1042c9: c9 leave + 1042ca: c3 ret + 1042cb: 90 nop + 1042cc: 83 ec 0c sub $0xc,%esp + 1042cf: 53 push %ebx + 1042d0: e8 ab fd ff ff call 104080 + 1042d5: 83 c4 10 add $0x10,%esp + 1042d8: 85 c0 test %eax,%eax + 1042da: 89 c7 mov %eax,%edi + 1042dc: 74 e3 je 1042c1 + 1042de: 85 f6 test %esi,%esi + 1042e0: 74 df je 1042c1 + 1042e2: 0f b7 46 fc movzwl 0xfffffffc(%esi),%eax + 1042e6: 25 ff 7f 00 00 and $0x7fff,%eax + 1042eb: 3d 92 6d 00 00 cmp $0x6d92,%eax + 1042f0: 75 1f jne 104311 + 1042f2: 8b 46 f4 mov 0xfffffff4(%esi),%eax + 1042f5: 39 c3 cmp %eax,%ebx + 1042f7: 76 02 jbe 1042fb + 1042f9: 89 c3 mov %eax,%ebx + 1042fb: 50 push %eax + 1042fc: 53 push %ebx + 1042fd: 56 push %esi + 1042fe: 57 push %edi + 1042ff: e8 58 0d 00 00 call 10505c + 104304: 89 34 24 mov %esi,(%esp,1) + 104307: e8 a4 fe ff ff call 1041b0 + 10430c: 83 c4 10 add $0x10,%esp + 10430f: eb b0 jmp 1042c1 + 104311: 83 ec 08 sub $0x8,%esp + 104314: 56 push %esi + 104315: 68 e0 5f 10 00 push $0x105fe0 + 10431a: e8 99 fa ff ff call 103db8 + 10431f: 31 c0 xor %eax,%eax + 104321: eb a0 jmp 1042c3 + 104323: 90 nop + +00104324
: + +void keyboardISR(void); + +int main(void) +{ + 104324: 55 push %ebp + 104325: 89 e5 mov %esp,%ebp + 104327: 83 ec 08 sub $0x8,%esp + 10432a: 83 e4 f0 and $0xfffffff0,%esp + /** + * keyboard interrupt init + */ + vector_t v; + unsigned i; + + init_video(); + 10432d: e8 e6 07 00 00 call 104b18 + init_keyboard(); + 104332: e8 45 d2 ff ff call 10157c + init_8259s(); + 104337: e8 54 fb ff ff call 103e90 + + /** + * XXX: + * i know this is a very ugly way of doing this, + * however it is the only way it can be done for now. + * in the future, i will implement a kprintf function + * whose sole purpose will be writing boot messages. + * + * Also, the color codes need to be mapped to constants + * in order to make using them a hell of a lot easier. + */ + + klog("init", "Installing keyboard interrupt handler", K_KLOG_PENDING, &_vc[0]); + 10433c: 68 e0 a2 19 00 push $0x19a2e0 + 104341: 6a 01 push $0x1 + 104343: 68 20 60 10 00 push $0x106020 + 104348: 68 bc 5a 10 00 push $0x105abc + 10434d: e8 ae bc ff ff call 100000 + /* we don't save the old vector */ + v.eip = (unsigned)keyboard_irq; + v.access_byte = 0x8E; /* present, ring 0, '386 interrupt gate */ + setvect(&v, 0x21); + 104352: 58 pop %eax + 104353: 5a pop %edx + 104354: 8d 45 f8 lea 0xfffffff8(%ebp),%eax + 104357: 6a 21 push $0x21 + 104359: 50 push %eax + 10435a: c7 45 fc 1c 13 10 00 movl $0x10131c,0xfffffffc(%ebp) + 104361: c7 45 f8 8e 00 00 00 movl $0x8e,0xfffffff8(%ebp) + 104368: e8 c4 d3 ff ff call 101731 <_setvect> + klog(NULL, NULL, K_KLOG_SUCCESS, &_vc[0]); + 10436d: 68 e0 a2 19 00 push $0x19a2e0 + 104372: 6a 00 push $0x0 + 104374: 6a 00 push $0x0 + 104376: 6a 00 push $0x0 + 104378: e8 83 bc ff ff call 100000 + + /*init_tasks();*/ + + klog("init", "Enabling hardware interrupts", K_KLOG_PENDING, &_vc[0]); + 10437d: 83 c4 20 add $0x20,%esp + 104380: 68 e0 a2 19 00 push $0x19a2e0 + 104385: 6a 01 push $0x1 + 104387: 68 c1 5a 10 00 push $0x105ac1 + 10438c: 68 bc 5a 10 00 push $0x105abc + 104391: e8 6a bc ff ff call 100000 + enable(); + 104396: e8 71 0c 00 00 call 10500c + /*for(i = 0; i < 0xFFFFFFF; i++);*/ + klog(NULL, NULL, K_KLOG_SUCCESS, &_vc[0]); + 10439b: 68 e0 a2 19 00 push $0x19a2e0 + 1043a0: 6a 00 push $0x0 + 1043a2: 6a 00 push $0x0 + 1043a4: 6a 00 push $0x0 + 1043a6: e8 55 bc ff ff call 100000 + + /** + * Initialize memory management + */ + /*_mm_init();*/ + + /** + * finished init, time for some gooey ;) + */ + printf(" _ _ _ _ ____ _____ ___ "); + 1043ab: 83 c4 14 add $0x14,%esp + 1043ae: 68 60 60 10 00 push $0x106060 + 1043b3: e8 1c 0d 00 00 call 1050d4 + printf(" ( )_( )( \\/ )( _ \\( _ )/ __) "); + 1043b8: c7 04 24 c0 60 10 00 movl $0x1060c0,(%esp,1) + 1043bf: e8 10 0d 00 00 call 1050d4 + printf(" ) _ ( \\ / ) _ < )(_)( \\__ \\ "); + 1043c4: c7 04 24 20 61 10 00 movl $0x106120,(%esp,1) + 1043cb: e8 04 0d 00 00 call 1050d4 + printf(" (_) (_) (__) (____/(_____)(___/ \n"); + 1043d0: c7 04 24 80 61 10 00 movl $0x106180,(%esp,1) + 1043d7: e8 f8 0c 00 00 call 1050d4 + + printf(" Hybrid Operating System (HybOS) \n"); + 1043dc: c7 04 24 e0 61 10 00 movl $0x1061e0,(%esp,1) + 1043e3: e8 ec 0c 00 00 call 1050d4 + + /** + * XXX: debug only + */ + printf("ALT + F1 - F8 for virtual terminals\n"); + 1043e8: c7 04 24 40 62 10 00 movl $0x106240,(%esp,1) + 1043ef: e8 e0 0c 00 00 call 1050d4 + printf("Three finger salute to restart\n"); + 1043f4: c7 04 24 80 62 10 00 movl $0x106280,(%esp,1) + 1043fb: e8 d4 0c 00 00 call 1050d4 + printf("More work needs to be done\n"); + 104400: c7 04 24 de 5a 10 00 movl $0x105ade,(%esp,1) + 104407: e8 c8 0c 00 00 call 1050d4 + printf("$ "); + 10440c: c7 04 24 d6 54 10 00 movl $0x1054d6,(%esp,1) + 104413: e8 bc 0c 00 00 call 1050d4 + + /** + * fork (kfork()) control over to a shell + */ + /*init_shell();*/ + + /** + * idle task/thread + */ + while(1) + 104418: 83 c4 10 add $0x10,%esp + 10441b: 90 nop + { + schedule(); + 10441c: e8 47 01 00 00 call 104568 + 104421: eb f9 jmp 10441c + ... + +00104424 <_mm_init>: +void _mm_page_copy_dword(uint32_t dest, uint32_t src); +void _mm_virtual_init(void); + +void _mm_init(void) +{ + 104424: 55 push %ebp + 104425: 89 e5 mov %esp,%ebp + 104427: 83 ec 08 sub $0x8,%esp + klog("init", "Initializing memory management", K_KLOG_PENDING, &_vc[0]); + 10442a: 68 e0 a2 19 00 push $0x19a2e0 + 10442f: 6a 01 push $0x1 + 104431: 68 a0 62 10 00 push $0x1062a0 + 104436: 68 bc 5a 10 00 push $0x105abc + 10443b: e8 c0 bb ff ff call 100000 + _mm_physical_init(); + 104440: e8 17 00 00 00 call 10445c <_mm_physical_init> + _mm_virtual_init(); + 104445: e8 ce 00 00 00 call 104518 <_mm_virtual_init> + klog((void *)0, (void *)0, K_KLOG_SUCCESS, &_vc[0]); + 10444a: 68 e0 a2 19 00 push $0x19a2e0 + 10444f: 6a 00 push $0x0 + 104451: 6a 00 push $0x0 + 104453: 6a 00 push $0x0 + 104455: e8 a6 bb ff ff call 100000 +} + 10445a: c9 leave + 10445b: c3 ret + +0010445c <_mm_physical_init>: + +void _mm_physical_init(void) +{ + 10445c: 55 push %ebp + 10445d: 89 e5 mov %esp,%ebp + unsigned i; + unsigned size = 16 * 1024 * 1024; + + size /= PAGESIZE; + size++; + size /= 32; + + buffer = (unsigned *)0x40000; + 10445f: ba 00 00 04 00 mov $0x40000,%edx + 104464: c7 05 84 72 19 00 00 movl $0x40000,0x197284 + 10446b: 00 04 00 + bufferIterator = (unsigned *)0x40000; + 10446e: c7 05 80 72 19 00 00 movl $0x40000,0x197280 + 104475: 00 04 00 + + for(i = 0; i < 72; i++) + 104478: 31 c0 xor %eax,%eax + 10447a: 89 f6 mov %esi,%esi + buffer[i] = 0xFFFFFFFF; + 10447c: c7 04 82 ff ff ff ff movl $0xffffffff,(%edx,%eax,4) + 104483: 40 inc %eax + 104484: 83 f8 47 cmp $0x47,%eax + 104487: 76 f3 jbe 10447c <_mm_physical_init+0x20> + 104489: b8 48 00 00 00 mov $0x48,%eax + 10448e: 89 f6 mov %esi,%esi + + for(i = 72; i < size; i++) + buffer[i] = 0x00000000; + 104490: c7 04 82 00 00 00 00 movl $0x0,(%edx,%eax,4) + 104497: 40 inc %eax + 104498: 3d 80 00 00 00 cmp $0x80,%eax + 10449d: 72 f1 jb 104490 <_mm_physical_init+0x34> +} + 10449f: c9 leave + 1044a0: c3 ret + 1044a1: 8d 76 00 lea 0x0(%esi),%esi + +001044a4 <_mm_physical_alloc>: + +unsigned _mm_physical_alloc(void) +{ + 1044a4: 55 push %ebp + 1044a5: 89 e5 mov %esp,%ebp + 1044a7: 56 push %esi + 1044a8: 53 push %ebx + unsigned mask = 0x00000001; + unsigned bit = 0; + + /** + * Search for a free space + */ + while(*bufferIterator == 0xFFFFFFFF) + 1044a9: 8b 15 80 72 19 00 mov 0x197280,%edx + 1044af: 31 f6 xor %esi,%esi + 1044b1: 83 3a ff cmpl $0xffffffff,(%edx) + 1044b4: b9 01 00 00 00 mov $0x1,%ecx + 1044b9: 74 1f je 1044da <_mm_physical_alloc+0x36> + bufferIterator++; + + /** + * Search for a bit that indicates a free page + */ + while(*bufferIterator & mask) + 1044bb: 8b 02 mov (%edx),%eax + 1044bd: a8 01 test $0x1,%al + 1044bf: 74 0a je 1044cb <_mm_physical_alloc+0x27> + 1044c1: 8d 76 00 lea 0x0(%esi),%esi + { + mask <<= 1; + 1044c4: d1 e1 shl %ecx + bit++; + 1044c6: 46 inc %esi + 1044c7: 85 c1 test %eax,%ecx + 1044c9: 75 f9 jne 1044c4 <_mm_physical_alloc+0x20> + } + + *bufferIterator |= mask; + 1044cb: 09 0a or %ecx,(%edx) + + return 32 * (bufferIterator - buffer) + bit; +} + 1044cd: 5b pop %ebx + 1044ce: 2b 15 84 72 19 00 sub 0x197284,%edx + 1044d4: 8d 04 d6 lea (%esi,%edx,8),%eax + 1044d7: 5e pop %esi + 1044d8: c9 leave + 1044d9: c3 ret + 1044da: 8d 42 04 lea 0x4(%edx),%eax + 1044dd: 8d 76 00 lea 0x0(%esi),%esi + 1044e0: 89 c2 mov %eax,%edx + 1044e2: 8d 40 04 lea 0x4(%eax),%eax + 1044e5: 83 78 fc ff cmpl $0xffffffff,0xfffffffc(%eax) + 1044e9: 74 f5 je 1044e0 <_mm_physical_alloc+0x3c> + 1044eb: 89 15 80 72 19 00 mov %edx,0x197280 + 1044f1: eb c8 jmp 1044bb <_mm_physical_alloc+0x17> + 1044f3: 90 nop + +001044f4 <_mm_physical_free>: + +void _mm_physical_free(unsigned page) +{ + 1044f4: 55 push %ebp + 1044f5: 89 e5 mov %esp,%ebp + 1044f7: 8b 4d 08 mov 0x8(%ebp),%ecx + 1044fa: 53 push %ebx + buffer[page >> 5] &= ~(1 << (page & 0x1F)); /* confused yet?!? */ + 1044fb: b8 fe ff ff ff mov $0xfffffffe,%eax + 104500: 89 cb mov %ecx,%ebx + 104502: 83 e1 1f and $0x1f,%ecx + 104505: c1 eb 05 shr $0x5,%ebx + 104508: 8b 15 84 72 19 00 mov 0x197284,%edx + 10450e: d3 c0 rol %cl,%eax + 104510: 21 04 9a and %eax,(%edx,%ebx,4) +} + 104513: 8b 1c 24 mov (%esp,1),%ebx + 104516: c9 leave + 104517: c3 ret + +00104518 <_mm_virtual_init>: + +void _mm_virtual_init(void) +{ + 104518: 55 push %ebp + 104519: 89 e5 mov %esp,%ebp + 10451b: c9 leave + 10451c: c3 ret + 10451d: 8d 76 00 lea 0x0(%esi),%esi + +00104520 <_mm_page_copy_byte>: +} + +void _mm_page_copy_byte(uint32_t dest, uint32_t src) +{ + 104520: 55 push %ebp + 104521: 89 e5 mov %esp,%ebp + 104523: 57 push %edi + 104524: 56 push %esi + 104525: 8b 7d 08 mov 0x8(%ebp),%edi + 104528: 8b 75 0c mov 0xc(%ebp),%esi + __asm__ __volatile__ + 10452b: b9 00 00 10 00 mov $0x100000,%ecx + 104530: fc cld + 104531: f3 a4 repz movsb %ds:(%esi),%es:(%edi) + ( + "cld;" + "rep; movsb;" + : + : "c" (1024*1024), "D" (dest), "S" (src) + : "memory" + ); +} + 104533: 5e pop %esi + 104534: 5f pop %edi + 104535: c9 leave + 104536: c3 ret + 104537: 90 nop + +00104538 <_mm_page_copy_word>: + +void _mm_page_copy_word(uint32_t dest, uint32_t src) +{ + 104538: 55 push %ebp + 104539: 89 e5 mov %esp,%ebp + 10453b: 57 push %edi + 10453c: 56 push %esi + 10453d: 8b 7d 08 mov 0x8(%ebp),%edi + 104540: 8b 75 0c mov 0xc(%ebp),%esi + __asm__ __volatile__ + 104543: b9 00 00 08 00 mov $0x80000,%ecx + 104548: fc cld + 104549: f3 66 a5 repz movsw %ds:(%esi),%es:(%edi) + ( + "cld;" + "rep; movsw;" + : + : "c" (512*1024), "D" (dest), "S" (src) + : "memory" + ); +} + 10454c: 5e pop %esi + 10454d: 5f pop %edi + 10454e: c9 leave + 10454f: c3 ret + +00104550 <_mm_page_copy_dword>: + +void _mm_page_copy_dword(uint32_t dest, uint32_t src) +{ + 104550: 55 push %ebp + 104551: 89 e5 mov %esp,%ebp + 104553: 57 push %edi + 104554: 56 push %esi + 104555: 8b 7d 08 mov 0x8(%ebp),%edi + 104558: 8b 75 0c mov 0xc(%ebp),%esi + __asm__ __volatile__ + 10455b: b9 00 00 04 00 mov $0x40000,%ecx + 104560: fc cld + 104561: f3 a5 repz movsl %ds:(%esi),%es:(%edi) + ( + "cld;" + "rep; movsl;" + : + : "c" (256*1024), "D" (dest), "S" (src) + : "memory" + ); +} + 104563: 5e pop %esi + 104564: 5f pop %edi + 104565: c9 leave + 104566: c3 ret + ... + +00104568 : + * schedule() + * + */ +void schedule(void) +{ + 104568: 55 push %ebp + 104569: 89 e5 mov %esp,%ebp + 10456b: 83 ec 08 sub $0x8,%esp + static unsigned current; + + /** + * If setjmp() returns non-zero it means that we came here through + * hyperspace from our call to longjmp() below, so just return + */ +/** UBU + if(setjmp(_curr_task->state) != 0) + return; +**/ + + /** + * Try to find the next runnable task + */ + do + 10456e: 8b 15 00 37 18 00 mov 0x183700,%edx + { + current++; + 104574: 42 inc %edx + if(current >= MAX_TASK) + 104575: 83 fa 0f cmp $0xf,%edx + 104578: 89 d0 mov %edx,%eax + 10457a: 76 04 jbe 104580 + current = 0; + 10457c: 31 c0 xor %eax,%eax + 10457e: 31 d2 xor %edx,%edx + _curr_task = _tasks + current; + 104580: 8d 04 40 lea (%eax,%eax,2),%eax + 104583: c1 e0 04 shl $0x4,%eax + 104586: 05 20 37 18 00 add $0x183720,%eax + } while(_curr_task->status != TS_RUNNABLE); + 10458b: 83 78 2c 01 cmpl $0x1,0x2c(%eax) + 10458f: 75 e3 jne 104574 + + /** + * Jump to the new task + */ + longjmp(_curr_task->state, 1); + 104591: 83 ec 08 sub $0x8,%esp + 104594: a3 a0 a2 19 00 mov %eax,0x19a2a0 + 104599: 6a 01 push $0x1 + 10459b: 83 c0 04 add $0x4,%eax + 10459e: 50 push %eax + 10459f: 89 15 00 37 18 00 mov %edx,0x183700 + 1045a5: e8 76 0a 00 00 call 105020 + 1045aa: 89 f6 mov %esi,%esi + +001045ac : +} +/***************************************************************************** +*****************************************************************************/ +#define NUM_TASKS 0 + +/** + * init_tasks() + * + */ +void init_tasks(void) +{ + 1045ac: 55 push %ebp + 1045ad: 89 e5 mov %esp,%ebp + 1045af: 83 ec 08 sub $0x8,%esp + static unsigned char stacks[NUM_TASKS][USER_STACK_SIZE]; + /*static unsigned entry[NUM_TASKS] = + { + 0, (unsigned)task1, + (unsigned)task2, (unsigned)task3, + (unsigned)task4 + };*/ + static unsigned entry[NUM_TASKS]; + + unsigned adr, i; + + klog("init", "task handler", K_KLOG_PENDING, &_vc[0]); + 1045b2: 68 e0 a2 19 00 push $0x19a2e0 + 1045b7: 6a 01 push $0x1 + 1045b9: 68 c4 62 10 00 push $0x1062c4 + 1045be: 68 bc 5a 10 00 push $0x105abc + 1045c3: e8 38 ba ff ff call 100000 + + /** + * For user taskes, initialize the saved state + */ + for(i = 1; i < NUM_TASKS; i++) + 1045c8: 83 c4 10 add $0x10,%esp + { + (void)setjmp(_tasks[i].state); + + /** + * especially the stack pointer + */ + adr = (unsigned)(stacks[i] + USER_STACK_SIZE); + _tasks[i].state[0].JMPBUF_SP = adr; + + /** + * and program counter + */ + _tasks[i].state[0].JMPBUF_IP = entry[i]; + + /** + * enable interrupts (by setting EFLAGS value) + */ + _tasks[i].state[0].JMPBUF_FLAGS = 0x200; + + /** + * allocate a virtual console to this task + */ + _tasks[i].vc = _vc + i; + + /** + * and mark it as runnable + */ + _tasks[i].status = TS_RUNNABLE; + } + + /** + * mark task 0 runnable (idle task) + */ + _tasks[0].status = TS_RUNNABLE; + 1045cb: c7 05 4c 37 18 00 01 movl $0x1,0x18374c + 1045d2: 00 00 00 + + /** + * set _curr_task so schedule() will save state + * of task 0 + */ + _curr_task = _tasks + 0; + + klog(NULL, NULL, K_KLOG_SUCCESS, &_vc[0]); + 1045d5: 68 e0 a2 19 00 push $0x19a2e0 + 1045da: 6a 00 push $0x0 + 1045dc: 6a 00 push $0x0 + 1045de: 6a 00 push $0x0 + 1045e0: c7 05 a0 a2 19 00 20 movl $0x183720,0x19a2a0 + 1045e7: 37 18 00 + 1045ea: e8 11 ba ff ff call 100000 +} + 1045ef: c9 leave + 1045f0: c3 ret + 1045f1: 00 00 add %al,(%eax) + ... + +001045f4 : + * write() + * + */ +static int write(const unsigned char *str, unsigned len) +{ + 1045f4: 55 push %ebp + 1045f5: 89 e5 mov %esp,%ebp + 1045f7: 57 push %edi + 1045f8: 56 push %esi + 1045f9: 53 push %ebx + 1045fa: 83 ec 0c sub $0xc,%esp + 1045fd: 8b 7d 0c mov 0xc(%ebp),%edi + unsigned i; + + for(i = 0; i < len; i++) + 104600: 31 f6 xor %esi,%esi + 104602: 39 fe cmp %edi,%esi + 104604: 8b 5d 08 mov 0x8(%ebp),%ebx + 104607: 72 0b jb 104614 + { + putch_help(_curr_task->vc, *str); + str++; + } + return i; +} + 104609: 8d 65 f4 lea 0xfffffff4(%ebp),%esp + 10460c: 5b pop %ebx + 10460d: 89 f0 mov %esi,%eax + 10460f: 5e pop %esi + 104610: 5f pop %edi + 104611: c9 leave + 104612: c3 ret + 104613: 90 nop + 104614: 83 ec 08 sub $0x8,%esp + 104617: 0f b6 03 movzbl (%ebx),%eax + 10461a: 50 push %eax + 10461b: a1 a0 a2 19 00 mov 0x19a2a0,%eax + 104620: ff 30 pushl (%eax) + 104622: 46 inc %esi + 104623: e8 68 02 00 00 call 104890 + 104628: 43 inc %ebx + 104629: 83 c4 10 add $0x10,%esp + 10462c: 39 fe cmp %edi,%esi + 10462e: 72 e4 jb 104614 + 104630: eb d7 jmp 104609 + 104632: 89 f6 mov %esi,%esi + +00104634 : + +/** + * yield() + * + */ +static void yield(void) +{ + 104634: 55 push %ebp + 104635: 89 e5 mov %esp,%ebp + schedule(); + 104637: c9 leave + 104638: e9 2b ff ff ff jmp 104568 + 10463d: 8d 76 00 lea 0x0(%esi),%esi + +00104640 : +} + +#define WAIT 0xFFFFFL + +/** + * wait() + */ +static void wait(void) +{ + 104640: 55 push %ebp + 104641: 89 e5 mov %esp,%ebp + unsigned long wait; + + for(wait = WAIT; wait != 0; wait--) + 104643: b8 ff ff 0f 00 mov $0xfffff,%eax + 104648: 48 dec %eax + 104649: 75 fd jne 104648 + /* nothing */; +} + 10464b: c9 leave + 10464c: c3 ret + 10464d: 8d 76 00 lea 0x0(%esi),%esi + +00104650 : + +/** + * task1() + * + */ +void task1(void) +{ + 104650: 55 push %ebp + 104651: 89 e5 mov %esp,%ebp + 104653: 83 ec 08 sub $0x8,%esp + 104656: 89 f6 mov %esi,%esi + //static const unsigned char msg_a[] = "root@hybos $ "; +/**/ + + //write(msg_a, sizeof(msg_a)); + wait(); + 104658: e8 e3 ff ff ff call 104640 + while(1) + { + /* so we can process other events */ + yield(); + 10465d: e8 d2 ff ff ff call 104634 + wait(); + 104662: eb f4 jmp 104658 + +00104664 : + } +} + +/** + * task2() + * + */ +void task2(void) +{ + 104664: 55 push %ebp + 104665: 89 e5 mov %esp,%ebp + 104667: 83 ec 08 sub $0x8,%esp + 10466a: 89 f6 mov %esi,%esi + //static const unsigned char msg_a[] = "root@hybos $ "; +/**/ + + //write(msg_a, sizeof(msg_a)); + wait(); + 10466c: e8 cf ff ff ff call 104640 + while(1) + { + yield(); + 104671: e8 be ff ff ff call 104634 + wait(); + 104676: eb f4 jmp 10466c + +00104678 : + } +} + +/** + * task3() + * + */ +void task3(void) +{ + 104678: 55 push %ebp + 104679: 89 e5 mov %esp,%ebp + 10467b: 83 ec 08 sub $0x8,%esp + 10467e: 89 f6 mov %esi,%esi + //static const unsigned char msg_a[] = "root@hybos $ "; +/**/ + + //write(msg_a, sizeof(msg_a)); + wait(); + 104680: e8 bb ff ff ff call 104640 + while(1) + { + yield(); + 104685: e8 aa ff ff ff call 104634 + wait(); + 10468a: eb f4 jmp 104680 + +0010468c : + } +} + +/** + * task4() + * + */ +void task4(void) +{ + 10468c: 55 push %ebp + 10468d: 89 e5 mov %esp,%ebp + 10468f: 83 ec 08 sub $0x8,%esp + 104692: 89 f6 mov %esi,%esi + //static const unsigned char msg_a[] = "root@hybos $ "; +/**/ + + //write(msg_a, sizeof(msg_a)); + wait(); + 104694: e8 a7 ff ff ff call 104640 + while(1) + { + yield(); + 104699: e8 96 ff ff ff call 104634 + wait(); + 10469e: eb f4 jmp 104694 + +001046a0 : + * blink() + * + */ +void blink(void) +{ + 1046a0: 55 push %ebp + (*(unsigned char *)_vga_fb_adr)++; + 1046a1: a1 28 3a 18 00 mov 0x183a28,%eax + 1046a6: 89 e5 mov %esp,%ebp + 1046a8: fe 00 incb (%eax) +} + 1046aa: c9 leave + 1046ab: c3 ret + +001046ac : + +/** + * get_current_vc() + * + */ +unsigned get_current_vc() +{ + 1046ac: 55 push %ebp + 1046ad: 89 e5 mov %esp,%ebp + return curr_vtty; + 1046af: a1 c0 a2 19 00 mov 0x19a2c0,%eax +} + 1046b4: c9 leave + 1046b5: c3 ret + 1046b6: 89 f6 mov %esi,%esi + +001046b8 : + +/** + * scroll() + * + */ +static void scroll(console_t *con) +{ + 1046b8: 55 push %ebp + 1046b9: 89 e5 mov %esp,%ebp + 1046bb: 57 push %edi + 1046bc: 56 push %esi + 1046bd: 53 push %ebx + 1046be: 83 ec 0c sub $0xc,%esp + unsigned short *fb_adr; + unsigned blank, temp; + + blank = 0x20 | ((unsigned)con->attrib << 8); + 1046c1: 8b 45 08 mov 0x8(%ebp),%eax + 1046c4: 8b 70 18 mov 0x18(%eax),%esi + 1046c7: c1 e6 08 shl $0x8,%esi + fb_adr = con->fb_adr; + 1046ca: 8b 78 30 mov 0x30(%eax),%edi + + /** + * scroll up + */ + if(con->csr_y >= _vc_height) + 1046cd: 8b 15 34 3a 18 00 mov 0x183a34,%edx + 1046d3: 8b 40 20 mov 0x20(%eax),%eax + 1046d6: 83 ce 20 or $0x20,%esi + 1046d9: 39 d0 cmp %edx,%eax + 1046db: 73 0b jae 1046e8 + { + temp = con->csr_y - _vc_height + 1; + memcpy(fb_adr, fb_adr + temp * _vc_width, + (_vc_height - temp) * _vc_width * 2); + + /** + * blank bottom line of screen + */ + memsetw(fb_adr + (_vc_height - temp) * _vc_width, + blank, _vc_width); + con->csr_y = _vc_height - 1; + } + + //for(i = 0; i < 0x1000000; i++) ; +} + 1046dd: 8d 65 f4 lea 0xfffffff4(%ebp),%esp + 1046e0: 5b pop %ebx + 1046e1: 5e pop %esi + 1046e2: 5f pop %edi + 1046e3: c9 leave + 1046e4: c3 ret + 1046e5: 8d 76 00 lea 0x0(%esi),%esi + 1046e8: 29 d0 sub %edx,%eax + 1046ea: 8d 58 01 lea 0x1(%eax),%ebx + 1046ed: 29 da sub %ebx,%edx + 1046ef: 50 push %eax + 1046f0: a1 30 3a 18 00 mov 0x183a30,%eax + 1046f5: 0f af d0 imul %eax,%edx + 1046f8: d1 e2 shl %edx + 1046fa: 0f af c3 imul %ebx,%eax + 1046fd: 52 push %edx + 1046fe: 8d 04 47 lea (%edi,%eax,2),%eax + 104701: 50 push %eax + 104702: 57 push %edi + 104703: e8 54 09 00 00 call 10505c + 104708: a1 34 3a 18 00 mov 0x183a34,%eax + 10470d: 83 c4 0c add $0xc,%esp + 104710: 29 d8 sub %ebx,%eax + 104712: ff 35 30 3a 18 00 pushl 0x183a30 + 104718: 0f af 05 30 3a 18 00 imul 0x183a30,%eax + 10471f: 56 push %esi + 104720: 8d 04 47 lea (%edi,%eax,2),%eax + 104723: 50 push %eax + 104724: e8 5f 09 00 00 call 105088 + 104729: a1 34 3a 18 00 mov 0x183a34,%eax + 10472e: 48 dec %eax + 10472f: 8b 55 08 mov 0x8(%ebp),%edx + 104732: 89 42 20 mov %eax,0x20(%edx) + 104735: 83 c4 10 add $0x10,%esp + 104738: eb a3 jmp 1046dd + 10473a: 89 f6 mov %esi,%esi + +0010473c : + +/** + * set_attrib() + * + */ +static void set_attrib(console_t *con, unsigned att) +{ + 10473c: 55 push %ebp + 10473d: 89 e5 mov %esp,%ebp + 10473f: 8b 4d 0c mov 0xc(%ebp),%ecx + 104742: 53 push %ebx + static const unsigned ansi_to_vga[] = + { + 0, 4, 2, 6, 1, 5, 3, 7 + }; + + unsigned new_att; + + new_att = con->attrib; + if(att == 0) + 104743: 85 c9 test %ecx,%ecx + 104745: 8b 5d 08 mov 0x8(%ebp),%ebx + 104748: 8b 53 18 mov 0x18(%ebx),%edx + 10474b: 75 0b jne 104758 + new_att &= ~0x08; /* bold off */ + 10474d: 83 e2 f7 and $0xfffffff7,%edx + else if(att == 1) + new_att |= 0x08; /* bold on */ + else if(att >= 30 && att <= 37) + { + att = ansi_to_vga[att - 30]; + new_att = (new_att & ~0x07) | att;/* fg color */ + } + else if(att >= 40 && att <= 47) + { + att = ansi_to_vga[att - 40] << 4; + new_att = (new_att & ~0x70) | att;/* bg color */ + } + con->attrib = new_att; + 104750: 89 53 18 mov %edx,0x18(%ebx) +} + 104753: 8b 1c 24 mov (%esp,1),%ebx + 104756: c9 leave + 104757: c3 ret + 104758: 83 f9 01 cmp $0x1,%ecx + 10475b: 74 33 je 104790 + 10475d: 8d 41 e2 lea 0xffffffe2(%ecx),%eax + 104760: 83 f8 07 cmp $0x7,%eax + 104763: 77 0f ja 104774 + 104765: 83 e2 f8 and $0xfffffff8,%edx + 104768: 0b 14 8d 68 62 10 00 or 0x106268(,%ecx,4),%edx + 10476f: eb df jmp 104750 + 104771: 8d 76 00 lea 0x0(%esi),%esi + 104774: 8d 41 d8 lea 0xffffffd8(%ecx),%eax + 104777: 83 f8 07 cmp $0x7,%eax + 10477a: 77 d4 ja 104750 + 10477c: 8b 04 8d 40 62 10 00 mov 0x106240(,%ecx,4),%eax + 104783: c1 e0 04 shl $0x4,%eax + 104786: 83 e2 8f and $0xffffff8f,%edx + 104789: 09 c2 or %eax,%edx + 10478b: eb c3 jmp 104750 + 10478d: 8d 76 00 lea 0x0(%esi),%esi + 104790: 83 ca 08 or $0x8,%edx + 104793: eb bb jmp 104750 + 104795: 8d 76 00 lea 0x0(%esi),%esi + +00104798 : + +/** + * move_csr() + * + */ +static void move_csr(void) +{ + 104798: 55 push %ebp + 104799: 89 e5 mov %esp,%ebp + 10479b: 53 push %ebx + 10479c: 83 ec 0c sub $0xc,%esp + unsigned temp; + + temp = (_curr_vc->csr_y * _vc_width + _curr_vc->csr_x) + + 10479f: a1 24 3a 18 00 mov 0x183a24,%eax + 1047a4: 8b 1d 30 3a 18 00 mov 0x183a30,%ebx + 1047aa: 0f af 58 20 imul 0x20(%eax),%ebx + 1047ae: 03 58 1c add 0x1c(%eax),%ebx + 1047b1: 8b 40 30 mov 0x30(%eax),%eax + 1047b4: 2b 05 28 3a 18 00 sub 0x183a28,%eax + (_curr_vc->fb_adr - _vga_fb_adr); + outportb(_crtc_io_adr + 0, 14); + 1047ba: 6a 0e push $0xe + 1047bc: d1 f8 sar %eax + 1047be: ff 35 2c 3a 18 00 pushl 0x183a2c + 1047c4: 01 c3 add %eax,%ebx + 1047c6: e8 e9 08 00 00 call 1050b4 + outportb(_crtc_io_adr + 1, temp >> 8); + 1047cb: 59 pop %ecx + 1047cc: 58 pop %eax + 1047cd: 89 d8 mov %ebx,%eax + 1047cf: c1 e8 08 shr $0x8,%eax + 1047d2: 50 push %eax + 1047d3: a1 2c 3a 18 00 mov 0x183a2c,%eax + 1047d8: 40 inc %eax + 1047d9: 50 push %eax + 1047da: e8 d5 08 00 00 call 1050b4 + outportb(_crtc_io_adr + 0, 15); + 1047df: 58 pop %eax + 1047e0: 5a pop %edx + 1047e1: 6a 0f push $0xf + 1047e3: ff 35 2c 3a 18 00 pushl 0x183a2c + 1047e9: e8 c6 08 00 00 call 1050b4 + outportb(_crtc_io_adr + 1, temp); + 1047ee: 5a pop %edx + 1047ef: 59 pop %ecx + 1047f0: a1 2c 3a 18 00 mov 0x183a2c,%eax + 1047f5: 53 push %ebx + 1047f6: 40 inc %eax + 1047f7: 50 push %eax + 1047f8: e8 b7 08 00 00 call 1050b4 +} + 1047fd: 8b 5d fc mov 0xfffffffc(%ebp),%ebx + 104800: c9 leave + 104801: c3 ret + 104802: 89 f6 mov %esi,%esi + +00104804 : + + +/** + * select_vc() + * + */ +void select_vc(unsigned which_vc) +{ + 104804: 55 push %ebp + 104805: 89 e5 mov %esp,%ebp + 104807: 56 push %esi + 104808: 53 push %ebx + 104809: 8b 75 08 mov 0x8(%ebp),%esi + unsigned i; + + if(which_vc >= _num_vcs) + 10480c: 3b 35 20 3a 18 00 cmp 0x183a20,%esi + 104812: 72 08 jb 10481c + return; + _curr_vc = _vc + which_vc; + i = _curr_vc->fb_adr - _vga_fb_adr; + outportb(_crtc_io_adr + 0, 12); + outportb(_crtc_io_adr + 1, i >> 8); + outportb(_crtc_io_adr + 0, 13); + outportb(_crtc_io_adr + 1, i); + + curr_vtty = which_vc; + + move_csr(); +} + 104814: 8d 65 f8 lea 0xfffffff8(%ebp),%esp + 104817: 5b pop %ebx + 104818: 5e pop %esi + 104819: c9 leave + 10481a: c3 ret + 10481b: 90 nop + 10481c: 8d 04 76 lea (%esi,%esi,2),%eax + 10481f: 8d 04 86 lea (%esi,%eax,4),%eax + 104822: 8d 04 85 e0 a2 19 00 lea 0x19a2e0(,%eax,4),%eax + 104829: 8b 58 30 mov 0x30(%eax),%ebx + 10482c: 83 ec 08 sub $0x8,%esp + 10482f: a3 24 3a 18 00 mov %eax,0x183a24 + 104834: 2b 1d 28 3a 18 00 sub 0x183a28,%ebx + 10483a: 6a 0c push $0xc + 10483c: d1 fb sar %ebx + 10483e: ff 35 2c 3a 18 00 pushl 0x183a2c + 104844: e8 6b 08 00 00 call 1050b4 + 104849: 58 pop %eax + 10484a: 89 d8 mov %ebx,%eax + 10484c: 5a pop %edx + 10484d: c1 e8 08 shr $0x8,%eax + 104850: 50 push %eax + 104851: a1 2c 3a 18 00 mov 0x183a2c,%eax + 104856: 40 inc %eax + 104857: 50 push %eax + 104858: e8 57 08 00 00 call 1050b4 + 10485d: 59 pop %ecx + 10485e: 58 pop %eax + 10485f: 6a 0d push $0xd + 104861: ff 35 2c 3a 18 00 pushl 0x183a2c + 104867: e8 48 08 00 00 call 1050b4 + 10486c: 58 pop %eax + 10486d: 5a pop %edx + 10486e: 53 push %ebx + 10486f: a1 2c 3a 18 00 mov 0x183a2c,%eax + 104874: 40 inc %eax + 104875: 50 push %eax + 104876: e8 39 08 00 00 call 1050b4 + 10487b: 89 35 c0 a2 19 00 mov %esi,0x19a2c0 + 104881: 83 c4 10 add $0x10,%esp + 104884: 8d 65 f8 lea 0xfffffff8(%ebp),%esp + 104887: 5b pop %ebx + 104888: 5e pop %esi + 104889: c9 leave + 10488a: e9 09 ff ff ff jmp 104798 + 10488f: 90 nop + +00104890 : + +/** + * putch_help() + * + */ +void putch_help(console_t *con, unsigned c) +{ + 104890: 55 push %ebp + 104891: 89 e5 mov %esp,%ebp + 104893: 57 push %edi + 104894: 56 push %esi + 104895: 53 push %ebx + 104896: 83 ec 0c sub $0xc,%esp + 104899: 8b 5d 08 mov 0x8(%ebp),%ebx + unsigned short *fb_adr; + unsigned att; + + att = (unsigned)con->attrib << 8; + 10489c: 8b 73 18 mov 0x18(%ebx),%esi + fb_adr = con->fb_adr; + + /** + * state machine to handle escape sequences + * + * ESC + */ + if(con->esc == 1) + 10489f: 8b 43 14 mov 0x14(%ebx),%eax + 1048a2: c1 e6 08 shl $0x8,%esi + 1048a5: 83 f8 01 cmp $0x1,%eax + 1048a8: 8b 4d 0c mov 0xc(%ebp),%ecx + 1048ab: 8b 7b 30 mov 0x30(%ebx),%edi + 1048ae: 0f 84 30 02 00 00 je 104ae4 + { + if(c == '[') + { + con->esc++; + con->esc1 = 0; + return; + } + /* else fall-through: zero esc and print c */ + } + + /** + * ESC[ + */ + else if(con->esc == 2) + 1048b4: 83 f8 02 cmp $0x2,%eax + 1048b7: 0f 84 a3 01 00 00 je 104a60 + { + if(isdigit(c)) + { + con->esc1 = con->esc1 * 10 + c - '0'; + return; + } + else if(c == ';') + { + con->esc++; + con->esc2 = 0; + return; + } + + /** + * ESC[2J (clear screen) + */ + else if(c == 'J') + { + if(con->esc1 == 2) + { + memsetw(fb_adr, ' ' | att, + _vc_height * _vc_width); + con->csr_x = con->csr_y = 0; + } + } + + /** + * ESC[num1m (set attribute num1) + */ + else if(c == 'm') + set_attrib(con, con->esc1); + con->esc = 0; /* anything else with one numeric arg */ + return; + } + + /** + * ESC[num1 + */ + else if(con->esc == 3) + 1048bd: 83 f8 03 cmp $0x3,%eax + 1048c0: 0f 84 22 01 00 00 je 1049e8 + { + if(isdigit(c)) + { + con->esc2 = con->esc2 * 10 + c - '0'; + return; + } + else if(c == ';') + { + con->esc++; /* ESC[num1;num2; */ + con->esc3 = 0; + return; + } + + /** + * ESC[num1;num2H (move cursor to num1,num2) + */ + else if(c == 'H') + { + if(con->esc2 < _vc_width) + con->csr_x = con->esc2; + if(con->esc1 < _vc_height) + con->csr_y = con->esc1; + } + + /** + * ESC[num1;num2m (set attributes num1,num2) + */ + else if(c == 'm') + { + set_attrib(con, con->esc1); + set_attrib(con, con->esc2); + } + con->esc = 0; + return; + } + /** + * ESC[num1;num2;num3 + */ + else if(con->esc == 4) + 1048c6: 83 f8 04 cmp $0x4,%eax + 1048c9: 0f 84 c9 00 00 00 je 104998 + { + if(isdigit(c)) + { + con->esc3 = con->esc3 * 10 + c - '0'; + return; + } + /** + * ESC[num1;num2;num3m (set attributes num1,num2,num3) + */ + else if(c == 'm') + { + set_attrib(con, con->esc1); + set_attrib(con, con->esc2); + set_attrib(con, con->esc3); + } + con->esc = 0; + return; + } + con->esc = 0; + + /** + * escape character + */ + if(c == 0x1B) + 1048cf: 83 f9 1b cmp $0x1b,%ecx + 1048d2: c7 43 14 00 00 00 00 movl $0x0,0x14(%ebx) + 1048d9: 0f 84 ad 00 00 00 je 10498c + { + con->esc = 1; + return; + } + /** + * backspace + */ + if(c == 0x08) + 1048df: 83 f9 08 cmp $0x8,%ecx + 1048e2: 0f 84 9a 00 00 00 je 104982 + { + if(con->csr_x != 0) + con->csr_x--; + } + /** + * tab + */ + else if(c == 0x09) + 1048e8: 83 f9 09 cmp $0x9,%ecx + 1048eb: 0f 84 83 00 00 00 je 104974 + con->csr_x = (con->csr_x + 8) & ~(8 - 1); + /** + * carriage return + */ + else if(c == '\r') /* 0x0D */ + 1048f1: 83 f9 0d cmp $0xd,%ecx + 1048f4: 74 75 je 10496b + con->csr_x = 0; + /** + * line feed + */ +/* else if(c == '\n') *//* 0x0A */ +/* con->csr_y++;*/ + /** + * CR/LF + */ + else if(c == '\n') /* ### - 0x0A again */ + 1048f6: 83 f9 0a cmp $0xa,%ecx + 1048f9: 74 62 je 10495d + { + con->csr_x = 0; + con->csr_y++; + } + /** + * printable ASCII + */ + else if(c >= ' ') + 1048fb: 83 f9 1f cmp $0x1f,%ecx + 1048fe: 76 58 jbe 104958 + { + unsigned short *where; + + where = fb_adr + (con->csr_y * _vc_width + con->csr_x); + 104900: a1 30 3a 18 00 mov 0x183a30,%eax + 104905: 8b 53 1c mov 0x1c(%ebx),%edx + 104908: 0f af 43 20 imul 0x20(%ebx),%eax + 10490c: 01 d0 add %edx,%eax + *where = (c | att); + 10490e: 09 f1 or %esi,%ecx + con->csr_x++; + 104910: 42 inc %edx + 104911: 66 89 0c 47 mov %cx,(%edi,%eax,2) + 104915: 89 d0 mov %edx,%eax + 104917: 89 53 1c mov %edx,0x1c(%ebx) + 10491a: 89 f6 mov %esi,%esi + } + if(con->csr_x >= _vc_width) + 10491c: 3b 05 30 3a 18 00 cmp 0x183a30,%eax + 104922: 72 0a jb 10492e + { + con->csr_x = 0; + 104924: c7 43 1c 00 00 00 00 movl $0x0,0x1c(%ebx) + con->csr_y++; + 10492b: ff 43 20 incl 0x20(%ebx) + } + scroll(con); + 10492e: 83 ec 0c sub $0xc,%esp + 104931: 53 push %ebx + 104932: e8 81 fd ff ff call 1046b8 + + /** + * move cursor only if the VC we're writing is the current VC + */ + if(_curr_vc == con) + 104937: 83 c4 10 add $0x10,%esp + 10493a: 39 1d 24 3a 18 00 cmp %ebx,0x183a24 + 104940: 74 0a je 10494c + 104942: 89 f6 mov %esi,%esi + move_csr(); +} + 104944: 8d 65 f4 lea 0xfffffff4(%ebp),%esp + 104947: 5b pop %ebx + 104948: 5e pop %esi + 104949: 5f pop %edi + 10494a: c9 leave + 10494b: c3 ret + 10494c: 8d 65 f4 lea 0xfffffff4(%ebp),%esp + 10494f: 5b pop %ebx + 104950: 5e pop %esi + 104951: 5f pop %edi + 104952: c9 leave + 104953: e9 40 fe ff ff jmp 104798 + 104958: 8b 43 1c mov 0x1c(%ebx),%eax + 10495b: eb bf jmp 10491c + 10495d: c7 43 1c 00 00 00 00 movl $0x0,0x1c(%ebx) + 104964: ff 43 20 incl 0x20(%ebx) + 104967: 31 c0 xor %eax,%eax + 104969: eb b1 jmp 10491c + 10496b: c7 43 1c 00 00 00 00 movl $0x0,0x1c(%ebx) + 104972: eb f3 jmp 104967 + 104974: 8b 43 1c mov 0x1c(%ebx),%eax + 104977: 83 c0 08 add $0x8,%eax + 10497a: 83 e0 f8 and $0xfffffff8,%eax + 10497d: 89 43 1c mov %eax,0x1c(%ebx) + 104980: eb 9a jmp 10491c + 104982: 8b 43 1c mov 0x1c(%ebx),%eax + 104985: 85 c0 test %eax,%eax + 104987: 74 93 je 10491c + 104989: 48 dec %eax + 10498a: eb f1 jmp 10497d + 10498c: c7 43 14 01 00 00 00 movl $0x1,0x14(%ebx) + 104993: eb af jmp 104944 + 104995: 8d 76 00 lea 0x0(%esi),%esi + 104998: f6 81 41 78 10 00 04 testb $0x4,0x107841(%ecx) + 10499f: 74 0f je 1049b0 + 1049a1: 8b 43 2c mov 0x2c(%ebx),%eax + 1049a4: 8d 04 80 lea (%eax,%eax,4),%eax + 1049a7: 8d 44 41 d0 lea 0xffffffd0(%ecx,%eax,2),%eax + 1049ab: 89 43 2c mov %eax,0x2c(%ebx) + 1049ae: eb 94 jmp 104944 + 1049b0: 83 f9 6d cmp $0x6d,%ecx + 1049b3: 74 0c je 1049c1 + 1049b5: 8d 76 00 lea 0x0(%esi),%esi + 1049b8: c7 43 14 00 00 00 00 movl $0x0,0x14(%ebx) + 1049bf: eb 83 jmp 104944 + 1049c1: 83 ec 08 sub $0x8,%esp + 1049c4: ff 73 24 pushl 0x24(%ebx) + 1049c7: 53 push %ebx + 1049c8: e8 6f fd ff ff call 10473c + 1049cd: 5f pop %edi + 1049ce: 58 pop %eax + 1049cf: ff 73 28 pushl 0x28(%ebx) + 1049d2: 53 push %ebx + 1049d3: e8 64 fd ff ff call 10473c + 1049d8: 59 pop %ecx + 1049d9: 5e pop %esi + 1049da: ff 73 2c pushl 0x2c(%ebx) + 1049dd: 53 push %ebx + 1049de: e8 59 fd ff ff call 10473c + 1049e3: 83 c4 10 add $0x10,%esp + 1049e6: eb d0 jmp 1049b8 + 1049e8: f6 81 41 78 10 00 04 testb $0x4,0x107841(%ecx) + 1049ef: 74 12 je 104a03 + 1049f1: 8b 43 28 mov 0x28(%ebx),%eax + 1049f4: 8d 04 80 lea (%eax,%eax,4),%eax + 1049f7: 8d 44 41 d0 lea 0xffffffd0(%ecx,%eax,2),%eax + 1049fb: 89 43 28 mov %eax,0x28(%ebx) + 1049fe: e9 41 ff ff ff jmp 104944 + 104a03: 83 f9 3b cmp $0x3b,%ecx + 104a06: 74 42 je 104a4a + 104a08: 83 f9 48 cmp $0x48,%ecx + 104a0b: 74 18 je 104a25 + 104a0d: 83 f9 6d cmp $0x6d,%ecx + 104a10: 75 a6 jne 1049b8 + 104a12: 83 ec 08 sub $0x8,%esp + 104a15: ff 73 24 pushl 0x24(%ebx) + 104a18: 53 push %ebx + 104a19: e8 1e fd ff ff call 10473c + 104a1e: 58 pop %eax + 104a1f: 5a pop %edx + 104a20: ff 73 28 pushl 0x28(%ebx) + 104a23: eb b8 jmp 1049dd + 104a25: 8b 43 28 mov 0x28(%ebx),%eax + 104a28: 3b 05 30 3a 18 00 cmp 0x183a30,%eax + 104a2e: 73 03 jae 104a33 + 104a30: 89 43 1c mov %eax,0x1c(%ebx) + 104a33: 8b 43 24 mov 0x24(%ebx),%eax + 104a36: 3b 05 34 3a 18 00 cmp 0x183a34,%eax + 104a3c: 0f 83 76 ff ff ff jae 1049b8 + 104a42: 89 43 20 mov %eax,0x20(%ebx) + 104a45: e9 6e ff ff ff jmp 1049b8 + 104a4a: c7 43 14 04 00 00 00 movl $0x4,0x14(%ebx) + 104a51: c7 43 2c 00 00 00 00 movl $0x0,0x2c(%ebx) + 104a58: e9 e7 fe ff ff jmp 104944 + 104a5d: 8d 76 00 lea 0x0(%esi),%esi + 104a60: f6 81 41 78 10 00 04 testb $0x4,0x107841(%ecx) + 104a67: 74 13 je 104a7c + 104a69: 8b 43 24 mov 0x24(%ebx),%eax + 104a6c: 8d 04 80 lea (%eax,%eax,4),%eax + 104a6f: 8d 44 41 d0 lea 0xffffffd0(%ecx,%eax,2),%eax + 104a73: 89 43 24 mov %eax,0x24(%ebx) + 104a76: e9 c9 fe ff ff jmp 104944 + 104a7b: 90 nop + 104a7c: 83 f9 3b cmp $0x3b,%ecx + 104a7f: 74 4e je 104acf + 104a81: 83 f9 4a cmp $0x4a,%ecx + 104a84: 74 14 je 104a9a + 104a86: 83 f9 6d cmp $0x6d,%ecx + 104a89: 0f 85 29 ff ff ff jne 1049b8 + 104a8f: 83 ec 08 sub $0x8,%esp + 104a92: ff 73 24 pushl 0x24(%ebx) + 104a95: e9 43 ff ff ff jmp 1049dd + 104a9a: 83 7b 24 02 cmpl $0x2,0x24(%ebx) + 104a9e: 0f 85 14 ff ff ff jne 1049b8 + 104aa4: 51 push %ecx + 104aa5: a1 30 3a 18 00 mov 0x183a30,%eax + 104aaa: 0f af 05 34 3a 18 00 imul 0x183a34,%eax + 104ab1: 50 push %eax + 104ab2: 83 ce 20 or $0x20,%esi + 104ab5: 56 push %esi + 104ab6: 57 push %edi + 104ab7: e8 cc 05 00 00 call 105088 + 104abc: c7 43 20 00 00 00 00 movl $0x0,0x20(%ebx) + 104ac3: c7 43 1c 00 00 00 00 movl $0x0,0x1c(%ebx) + 104aca: e9 14 ff ff ff jmp 1049e3 + 104acf: c7 43 14 03 00 00 00 movl $0x3,0x14(%ebx) + 104ad6: c7 43 28 00 00 00 00 movl $0x0,0x28(%ebx) + 104add: e9 62 fe ff ff jmp 104944 + 104ae2: 89 f6 mov %esi,%esi + 104ae4: 83 f9 5b cmp $0x5b,%ecx + 104ae7: 0f 85 e2 fd ff ff jne 1048cf + 104aed: c7 43 14 02 00 00 00 movl $0x2,0x14(%ebx) + 104af4: c7 43 24 00 00 00 00 movl $0x0,0x24(%ebx) + 104afb: e9 44 fe ff ff jmp 104944 + +00104b00 : + +/** + * putch() + * + */ +void putch(unsigned c) +{ + 104b00: 55 push %ebp + 104b01: 89 e5 mov %esp,%ebp + 104b03: 83 ec 10 sub $0x10,%esp +/* all kernel messages to VC #0 */ +// putch_help(_vc + 0, c); +/* all kernel messages to current VC */ + putch_help(_curr_vc, c); + 104b06: ff 75 08 pushl 0x8(%ebp) + 104b09: ff 35 24 3a 18 00 pushl 0x183a24 + 104b0f: e8 7c fd ff ff call 104890 +} + 104b14: c9 leave + 104b15: c3 ret + 104b16: 89 f6 mov %esi,%esi + +00104b18 : + +/** + * init_video() + * + */ +void init_video(void) +{ + 104b18: 55 push %ebp + 104b19: 89 e5 mov %esp,%ebp + 104b1b: 56 push %esi + 104b1c: 53 push %ebx + unsigned i; + + /** + * check for monochrome or color VGA emulation + */ + if((inportb(VGA_MISC_READ) & 0x01) != 0) + 104b1d: 83 ec 0c sub $0xc,%esp + 104b20: 68 cc 03 00 00 push $0x3cc + 104b25: e8 ea 04 00 00 call 105014 + 104b2a: 83 c4 10 add $0x10,%esp + 104b2d: a8 01 test $0x1,%al + 104b2f: 0f 84 78 01 00 00 je 104cad + { + _vga_fb_adr = (unsigned short *)0xB8000L; + 104b35: c7 05 28 3a 18 00 00 movl $0xb8000,0x183a28 + 104b3c: 80 0b 00 + _crtc_io_adr = 0x3D4; + 104b3f: c7 05 2c 3a 18 00 d4 movl $0x3d4,0x183a2c + 104b46: 03 00 00 + } + else + { + _vga_fb_adr = (unsigned short *)0xB0000L; + _crtc_io_adr = 0x3B4; + } + + /** + * read current screen size from BIOS data segment (addresses 400-4FF) + */ + _vc_width = *(unsigned short *)0x44A; + _vc_height = *(unsigned char *)0x484 + 1; + 104b49: 0f b6 05 84 04 00 00 movzbl 0x484,%eax + 104b50: 40 inc %eax + 104b51: 0f b7 15 4a 04 00 00 movzwl 0x44a,%edx + 104b58: 89 15 30 3a 18 00 mov %edx,0x183a30 + + /** + * figure out how many VCs we can have with 32K of display memory. + * Use INTEGER division to round down. + */ + _num_vcs = 32768L / (_vc_width * _vc_height * 2); + 104b5e: 0f af d0 imul %eax,%edx + 104b61: d1 e2 shl %edx + 104b63: 89 d1 mov %edx,%ecx + 104b65: a3 34 3a 18 00 mov %eax,0x183a34 + 104b6a: 31 d2 xor %edx,%edx + 104b6c: b8 00 80 00 00 mov $0x8000,%eax + 104b71: f7 f1 div %ecx + if(_num_vcs > MAX_VC) + 104b73: 83 f8 0c cmp $0xc,%eax + 104b76: a3 20 3a 18 00 mov %eax,0x183a20 + 104b7b: 76 0a jbe 104b87 + _num_vcs = MAX_VC; + 104b7d: c7 05 20 3a 18 00 0c movl $0xc,0x183a20 + 104b84: 00 00 00 + + /** + * init VCs, with a different foreground color for each + */ + for(i = 0; i < _num_vcs; i++) + 104b87: 31 f6 xor %esi,%esi + 104b89: 3b 35 20 3a 18 00 cmp 0x183a20,%esi + 104b8f: 73 53 jae 104be4 + 104b91: bb e0 a2 19 00 mov $0x19a2e0,%ebx + 104b96: 89 f6 mov %esi,%esi + { + _curr_vc = _vc + i; + //_curr_vc->attrib = i + 1; + + /* terminal foreground color */ + _curr_vc->attrib = 7; + _curr_vc->fb_adr = _vga_fb_adr + + 104b98: a1 34 3a 18 00 mov 0x183a34,%eax + 104b9d: 0f af 05 30 3a 18 00 imul 0x183a30,%eax + 104ba4: 8b 15 28 3a 18 00 mov 0x183a28,%edx + 104baa: 0f af c6 imul %esi,%eax + _vc_width * _vc_height * i; + + /** + * ESC[2J clears the screen + */ + //kprintf("\x1B[2J this is VC#%u (of 0-%u)\n", + // i, _num_vcs - 1); + printf("\x1B[2J"); + 104bad: 83 ec 0c sub $0xc,%esp + 104bb0: 8d 04 42 lea (%edx,%eax,2),%eax + 104bb3: c7 43 18 07 00 00 00 movl $0x7,0x18(%ebx) + 104bba: 89 43 30 mov %eax,0x30(%ebx) + 104bbd: 68 00 63 10 00 push $0x106300 + 104bc2: 89 1d 24 3a 18 00 mov %ebx,0x183a24 + 104bc8: e8 07 05 00 00 call 1050d4 + + if(i != 0) + 104bcd: 83 c4 10 add $0x10,%esp + 104bd0: 85 f6 test %esi,%esi + 104bd2: 0f 85 c0 00 00 00 jne 104c98 + 104bd8: 46 inc %esi + 104bd9: 83 c3 34 add $0x34,%ebx + 104bdc: 3b 35 20 3a 18 00 cmp 0x183a20,%esi + 104be2: 72 b4 jb 104b98 + printf("$ "); + } + select_vc(0); + 104be4: 83 ec 0c sub $0xc,%esp + 104be7: 6a 00 push $0x0 + 104be9: e8 16 fc ff ff call 104804 + curr_vtty = 0; + + _curr_vc->attrib = 8; + 104bee: a1 24 3a 18 00 mov 0x183a24,%eax + 104bf3: c7 05 c0 a2 19 00 00 movl $0x0,0x19a2c0 + 104bfa: 00 00 00 + 104bfd: c7 40 18 08 00 00 00 movl $0x8,0x18(%eax) + printf("[ "); + 104c04: c7 04 24 b6 51 10 00 movl $0x1051b6,(%esp,1) + 104c0b: e8 c4 04 00 00 call 1050d4 + _curr_vc->attrib = 15; + 104c10: a1 24 3a 18 00 mov 0x183a24,%eax + 104c15: c7 40 18 0f 00 00 00 movl $0xf,0x18(%eax) + printf("init: video %5s emulation, %2ux%2u, framebuffer at 0x%1X ", + 104c1c: 5b pop %ebx + 104c1d: ff 35 28 3a 18 00 pushl 0x183a28 + 104c23: ff 35 34 3a 18 00 pushl 0x183a34 + 104c29: 81 3d 2c 3a 18 00 d4 cmpl $0x3d4,0x183a2c + 104c30: 03 00 00 + 104c33: ff 35 30 3a 18 00 pushl 0x183a30 + 104c39: 74 54 je 104c8f + 104c3b: b8 05 63 10 00 mov $0x106305,%eax + 104c40: 50 push %eax + 104c41: 68 40 63 10 00 push $0x106340 + 104c46: e8 89 04 00 00 call 1050d4 + (_crtc_io_adr == 0x3D4) ? "color" : "mono", + _vc_width, _vc_height, _vga_fb_adr); + _curr_vc->attrib = 8; + printf("]................"); + 104c4b: 83 c4 14 add $0x14,%esp + 104c4e: a1 24 3a 18 00 mov 0x183a24,%eax + 104c53: c7 40 18 08 00 00 00 movl $0x8,0x18(%eax) + 104c5a: 68 0a 63 10 00 push $0x10630a + 104c5f: e8 70 04 00 00 call 1050d4 + _curr_vc->attrib = 2; + 104c64: a1 24 3a 18 00 mov 0x183a24,%eax + 104c69: c7 40 18 02 00 00 00 movl $0x2,0x18(%eax) + printf("Ok"); + 104c70: c7 04 24 d9 54 10 00 movl $0x1054d9,(%esp,1) + 104c77: e8 58 04 00 00 call 1050d4 + _curr_vc->attrib = 7; + 104c7c: a1 24 3a 18 00 mov 0x183a24,%eax + 104c81: c7 40 18 07 00 00 00 movl $0x7,0x18(%eax) +} + 104c88: 8d 65 f8 lea 0xfffffff8(%ebp),%esp + 104c8b: 5b pop %ebx + 104c8c: 5e pop %esi + 104c8d: c9 leave + 104c8e: c3 ret + 104c8f: b8 1c 63 10 00 mov $0x10631c,%eax + 104c94: eb aa jmp 104c40 + 104c96: 89 f6 mov %esi,%esi + 104c98: 83 ec 0c sub $0xc,%esp + 104c9b: 68 d6 54 10 00 push $0x1054d6 + 104ca0: e8 2f 04 00 00 call 1050d4 + 104ca5: 83 c4 10 add $0x10,%esp + 104ca8: e9 2b ff ff ff jmp 104bd8 + 104cad: c7 05 28 3a 18 00 00 movl $0xb0000,0x183a28 + 104cb4: 00 0b 00 + 104cb7: c7 05 2c 3a 18 00 b4 movl $0x3b4,0x183a2c + 104cbe: 03 00 00 + 104cc1: e9 83 fe ff ff jmp 104b49 + ... + +00104cc8 : +/***************************************************************************** +*****************************************************************************/ +unsigned disable(void) +{ + 104cc8: 55 push %ebp + 104cc9: 89 e5 mov %esp,%ebp + unsigned ret_val; + + __asm__ __volatile__("pushfl\n" + 104ccb: 9c pushf + 104ccc: 58 pop %eax + 104ccd: fa cli + "popl %0\n" + "cli" + : "=a"(ret_val) + :); + return ret_val; +} + 104cce: c9 leave + 104ccf: c3 ret + +00104cd0 : +2^32-1 in base 8 has 11 digits (add 5 for trailing NUL and for slop) */ +#define PR_BUFLEN 16 + +int do_printf(const char *fmt, va_list args, fnptr_t fn, void *ptr) +{ + 104cd0: 55 push %ebp + 104cd1: 89 e5 mov %esp,%ebp + 104cd3: 57 push %edi + 104cd4: 56 push %esi + 104cd5: 53 push %ebx + 104cd6: 83 ec 2c sub $0x2c,%esp + 104cd9: 8b 75 08 mov 0x8(%ebp),%esi + unsigned state, flags, radix, actual_wd, count, given_wd; + unsigned char *where, buf[PR_BUFLEN]; + long num; + + state = flags = count = given_wd = 0; + 104cdc: c7 45 cc 00 00 00 00 movl $0x0,0xffffffcc(%ebp) + 104ce3: c7 45 d0 00 00 00 00 movl $0x0,0xffffffd0(%ebp) + 104cea: c7 45 d4 00 00 00 00 movl $0x0,0xffffffd4(%ebp) +/* begin scanning format specifier list */ + for(; *fmt; fmt++) + 104cf1: 8a 0e mov (%esi),%cl + 104cf3: 31 db xor %ebx,%ebx + 104cf5: 84 c9 test %cl,%cl + 104cf7: 74 38 je 104d31 + 104cf9: 8d 76 00 lea 0x0(%esi),%esi + { + switch(state) + 104cfc: 83 fb 04 cmp $0x4,%ebx + 104cff: 0f 87 d7 01 00 00 ja 104edc + 104d05: ff 24 9d 7c 63 10 00 jmp *0x10637c(,%ebx,4) + { +/* STATE 0: AWAITING % */ + case 0: + if(*fmt != '%') /* not %... */ + 104d0c: 80 f9 25 cmp $0x25,%cl + 104d0f: 74 2b je 104d3c + { + fn(*fmt, &ptr); /* ...just echo it */ + 104d11: 83 ec 08 sub $0x8,%esp + 104d14: 8d 45 14 lea 0x14(%ebp),%eax + 104d17: 50 push %eax + 104d18: 0f be c1 movsbl %cl,%eax + 104d1b: 50 push %eax + 104d1c: ff 55 10 call *0x10(%ebp) + count++; + 104d1f: ff 45 d0 incl 0xffffffd0(%ebp) + break; + } +/* found %, get next char and advance state to check if next char is a flag */ + state++; + fmt++; + /* FALL THROUGH */ +/* STATE 1: AWAITING FLAGS (%-0) */ + case 1: + if(*fmt == '%') /* %% */ + { + fn(*fmt, &ptr); + count++; + state = flags = given_wd = 0; + break; + 104d22: 83 c4 10 add $0x10,%esp + 104d25: 8d 76 00 lea 0x0(%esi),%esi + 104d28: 46 inc %esi + 104d29: 8a 06 mov (%esi),%al + 104d2b: 84 c0 test %al,%al + 104d2d: 88 c1 mov %al,%cl + 104d2f: 75 cb jne 104cfc + } + if(*fmt == '-') + { + if(flags & PR_LJ)/* %-- is illegal */ + state = flags = given_wd = 0; + else + flags |= PR_LJ; + break; + } +/* not a flag char: advance state to check if it's field width */ + state++; +/* check now for '%0...' */ + if(*fmt == '0') + { + flags |= PR_LZ; + fmt++; + } + /* FALL THROUGH */ +/* STATE 2: AWAITING (NUMERIC) FIELD WIDTH */ + case 2: + if(*fmt >= '0' && *fmt <= '9') + { + given_wd = 10 * given_wd + + (*fmt - '0'); + break; + } +/* not field width: advance state to check if it's a modifier */ + state++; + /* FALL THROUGH */ +/* STATE 3: AWAITING MODIFIER CHARS (FNlh) */ + case 3: + if(*fmt == 'F') + { + flags |= PR_FP; + break; + } + if(*fmt == 'N') + break; + if(*fmt == 'l') + { + flags |= PR_32; + break; + } + if(*fmt == 'h') + { + flags |= PR_16; + break; + } +/* not modifier: advance state to check if it's a conversion char */ + state++; + /* FALL THROUGH */ +/* STATE 4: AWAITING CONVERSION CHARS (Xxpndiuocs) */ + case 4: + where = buf + PR_BUFLEN - 1; + *where = '\0'; + switch(*fmt) + { + case 'X': + flags |= PR_CA; + /* FALL THROUGH */ +/* xxx - far pointers (%Fp, %Fn) not yet supported */ + case 'x': + case 'p': + case 'n': + radix = 16; + goto DO_NUM; + case 'd': + case 'i': + flags |= PR_SG; + /* FALL THROUGH */ + case 'u': + radix = 10; + goto DO_NUM; + case 'o': + radix = 8; +/* load the value to be printed. l=long=32 bits: */ +DO_NUM: if(flags & PR_32) + num = va_arg(args, unsigned long); +/* h=short=16 bits (signed or unsigned) */ + else if(flags & PR_16) + { + if(flags & PR_SG) + num = va_arg(args, short); + else + num = va_arg(args, unsigned short); + } +/* no h nor l: sizeof(int) bits (signed or unsigned) */ + else + { + if(flags & PR_SG) + num = va_arg(args, int); + else + num = va_arg(args, unsigned int); + } +/* take care of sign */ + if(flags & PR_SG) + { + if(num < 0) + { + flags |= PR_WS; + num = -num; + } + } +/* convert binary to octal/decimal/hex ASCII +OK, I found my mistake. The math here is _always_ unsigned */ + do + { + unsigned long temp; + + temp = (unsigned long)num % radix; + where--; + if(temp < 10) + *where = temp + '0'; + else if(flags & PR_CA) + *where = temp - 10 + 'A'; + else + *where = temp - 10 + 'a'; + num = (unsigned long)num / radix; + } + while(num != 0); + goto EMIT; + case 'c': +/* disallow pad-left-with-zeroes for %c */ + flags &= ~PR_LZ; + where--; + *where = (unsigned char)va_arg(args, + unsigned char); + actual_wd = 1; + goto EMIT2; + case 's': +/* disallow pad-left-with-zeroes for %s */ + flags &= ~PR_LZ; + where = va_arg(args, unsigned char *); +EMIT: + actual_wd = strlen(where); + if(flags & PR_WS) + actual_wd++; +/* if we pad left with ZEROES, do the sign now */ + if((flags & (PR_WS | PR_LZ)) == + (PR_WS | PR_LZ)) + { + fn('-', &ptr); + count++; + } +/* pad on left with spaces or zeroes (for right justify) */ +EMIT2: if((flags & PR_LJ) == 0) + { + while(given_wd > actual_wd) + { + fn(flags & PR_LZ ? '0' : + ' ', &ptr); + count++; + given_wd--; + } + } +/* if we pad left with SPACES, do the sign now */ + if((flags & (PR_WS | PR_LZ)) == PR_WS) + { + fn('-', &ptr); + count++; + } +/* emit string/char/converted number */ + while(*where != '\0') + { + fn(*where++, &ptr); + count++; + } +/* pad on right with spaces (for left justify) */ + if(given_wd < actual_wd) + given_wd = 0; + else given_wd -= actual_wd; + for(; given_wd; given_wd--) + { + fn(' ', &ptr); + count++; + } + break; + default: + break; + } + default: + state = flags = given_wd = 0; + break; + } + } + return count; +} + 104d31: 8b 45 d0 mov 0xffffffd0(%ebp),%eax + 104d34: 8d 65 f4 lea 0xfffffff4(%ebp),%esp + 104d37: 5b pop %ebx + 104d38: 5e pop %esi + 104d39: 5f pop %edi + 104d3a: c9 leave + 104d3b: c3 ret + 104d3c: 46 inc %esi + 104d3d: 43 inc %ebx + 104d3e: 8a 0e mov (%esi),%cl + 104d40: 80 f9 25 cmp $0x25,%cl + 104d43: 0f 84 9d 02 00 00 je 104fe6 + 104d49: 80 f9 2d cmp $0x2d,%cl + 104d4c: 0f 84 81 02 00 00 je 104fd3 + 104d52: 43 inc %ebx + 104d53: 80 f9 30 cmp $0x30,%cl + 104d56: 0f 84 6b 02 00 00 je 104fc7 + 104d5c: 8d 41 d0 lea 0xffffffd0(%ecx),%eax + 104d5f: 3c 09 cmp $0x9,%al + 104d61: 77 12 ja 104d75 + 104d63: 8b 45 cc mov 0xffffffcc(%ebp),%eax + 104d66: 8d 14 80 lea (%eax,%eax,4),%edx + 104d69: 0f be c1 movsbl %cl,%eax + 104d6c: 8d 54 50 d0 lea 0xffffffd0(%eax,%edx,2),%edx + 104d70: 89 55 cc mov %edx,0xffffffcc(%ebp) + 104d73: eb b3 jmp 104d28 + 104d75: 43 inc %ebx + 104d76: 80 f9 46 cmp $0x46,%cl + 104d79: 0f 84 3c 02 00 00 je 104fbb + 104d7f: 80 f9 4e cmp $0x4e,%cl + 104d82: 74 a4 je 104d28 + 104d84: 80 f9 6c cmp $0x6c,%cl + 104d87: 0f 84 25 02 00 00 je 104fb2 + 104d8d: 80 f9 68 cmp $0x68,%cl + 104d90: 0f 84 13 02 00 00 je 104fa9 + 104d96: 89 f6 mov %esi,%esi + 104d98: 0f be c1 movsbl %cl,%eax + 104d9b: 83 e8 58 sub $0x58,%eax + 104d9e: 83 f8 20 cmp $0x20,%eax + 104da1: 8d 7d e7 lea 0xffffffe7(%ebp),%edi + 104da4: c6 45 e7 00 movb $0x0,0xffffffe7(%ebp) + 104da8: 0f 87 2e 01 00 00 ja 104edc + 104dae: ff 24 85 90 63 10 00 jmp *0x106390(,%eax,4) + 104db5: 83 4d d4 02 orl $0x2,0xffffffd4(%ebp) + 104db9: bb 10 00 00 00 mov $0x10,%ebx + 104dbe: f6 45 d4 08 testb $0x8,0xffffffd4(%ebp) + 104dc2: 0f 85 8c 01 00 00 jne 104f54 + 104dc8: f6 45 d4 10 testb $0x10,0xffffffd4(%ebp) + 104dcc: 0f 84 6d 01 00 00 je 104f3f + 104dd2: f6 45 d4 04 testb $0x4,0xffffffd4(%ebp) + 104dd6: 0f 84 53 01 00 00 je 104f2f + 104ddc: 83 45 0c 04 addl $0x4,0xc(%ebp) + 104de0: 8b 45 0c mov 0xc(%ebp),%eax + 104de3: 0f bf 48 fc movswl 0xfffffffc(%eax),%ecx + 104de7: f6 45 d4 04 testb $0x4,0xffffffd4(%ebp) + 104deb: 74 08 je 104df5 + 104ded: 85 c9 test %ecx,%ecx + 104def: 0f 88 2f 01 00 00 js 104f24 + 104df5: 8b 45 d4 mov 0xffffffd4(%ebp),%eax + 104df8: 83 e0 02 and $0x2,%eax + 104dfb: 89 45 c8 mov %eax,0xffffffc8(%ebp) + 104dfe: 89 f6 mov %esi,%esi + 104e00: 31 d2 xor %edx,%edx + 104e02: 89 c8 mov %ecx,%eax + 104e04: f7 f3 div %ebx + 104e06: 4f dec %edi + 104e07: 83 fa 09 cmp $0x9,%edx + 104e0a: 8d 42 30 lea 0x30(%edx),%eax + 104e0d: 76 11 jbe 104e20 + 104e0f: 8b 45 c8 mov 0xffffffc8(%ebp),%eax + 104e12: 85 c0 test %eax,%eax + 104e14: 0f 84 02 01 00 00 je 104f1c + 104e1a: 8d 42 37 lea 0x37(%edx),%eax + 104e1d: 8d 76 00 lea 0x0(%esi),%esi + 104e20: 31 d2 xor %edx,%edx + 104e22: 88 07 mov %al,(%edi) + 104e24: 89 c8 mov %ecx,%eax + 104e26: f7 f3 div %ebx + 104e28: 85 c0 test %eax,%eax + 104e2a: 89 c1 mov %eax,%ecx + 104e2c: 75 d2 jne 104e00 + 104e2e: 83 ec 0c sub $0xc,%esp + 104e31: 57 push %edi + 104e32: e8 21 03 00 00 call 105158 + 104e37: 83 c4 10 add $0x10,%esp + 104e3a: f6 45 d4 20 testb $0x20,0xffffffd4(%ebp) + 104e3e: 89 c3 mov %eax,%ebx + 104e40: 74 01 je 104e43 + 104e42: 43 inc %ebx + 104e43: 8b 45 d4 mov 0xffffffd4(%ebp),%eax + 104e46: 83 e0 60 and $0x60,%eax + 104e49: 83 f8 60 cmp $0x60,%eax + 104e4c: 0f 84 b3 00 00 00 je 104f05 + 104e52: f6 45 d4 01 testb $0x1,0xffffffd4(%ebp) + 104e56: 75 31 jne 104e89 + 104e58: 39 5d cc cmp %ebx,0xffffffcc(%ebp) + 104e5b: 76 2c jbe 104e89 + 104e5d: 8d 76 00 lea 0x0(%esi),%esi + 104e60: 83 ec 08 sub $0x8,%esp + 104e63: 8d 45 14 lea 0x14(%ebp),%eax + 104e66: f6 45 d4 40 testb $0x40,0xffffffd4(%ebp) + 104e6a: 50 push %eax + 104e6b: b8 30 00 00 00 mov $0x30,%eax + 104e70: 75 05 jne 104e77 + 104e72: b8 20 00 00 00 mov $0x20,%eax + 104e77: 50 push %eax + 104e78: ff 55 10 call *0x10(%ebp) + 104e7b: ff 4d cc decl 0xffffffcc(%ebp) + 104e7e: ff 45 d0 incl 0xffffffd0(%ebp) + 104e81: 83 c4 10 add $0x10,%esp + 104e84: 39 5d cc cmp %ebx,0xffffffcc(%ebp) + 104e87: 77 d7 ja 104e60 + 104e89: 83 65 d4 60 andl $0x60,0xffffffd4(%ebp) + 104e8d: 83 7d d4 20 cmpl $0x20,0xffffffd4(%ebp) + 104e91: 74 5e je 104ef1 + 104e93: 8a 07 mov (%edi),%al + 104e95: 84 c0 test %al,%al + 104e97: 74 1e je 104eb7 + 104e99: 8d 76 00 lea 0x0(%esi),%esi + 104e9c: 83 ec 08 sub $0x8,%esp + 104e9f: 8d 55 14 lea 0x14(%ebp),%edx + 104ea2: 52 push %edx + 104ea3: 0f b6 c0 movzbl %al,%eax + 104ea6: 50 push %eax + 104ea7: ff 55 10 call *0x10(%ebp) + 104eaa: 47 inc %edi + 104eab: ff 45 d0 incl 0xffffffd0(%ebp) + 104eae: 8a 07 mov (%edi),%al + 104eb0: 83 c4 10 add $0x10,%esp + 104eb3: 84 c0 test %al,%al + 104eb5: 75 e5 jne 104e9c + 104eb7: 39 5d cc cmp %ebx,0xffffffcc(%ebp) + 104eba: 72 20 jb 104edc + 104ebc: 29 5d cc sub %ebx,0xffffffcc(%ebp) + 104ebf: 74 1b je 104edc + 104ec1: 8d 76 00 lea 0x0(%esi),%esi + 104ec4: 83 ec 08 sub $0x8,%esp + 104ec7: 8d 45 14 lea 0x14(%ebp),%eax + 104eca: 50 push %eax + 104ecb: 6a 20 push $0x20 + 104ecd: ff 55 10 call *0x10(%ebp) + 104ed0: ff 45 d0 incl 0xffffffd0(%ebp) + 104ed3: 83 c4 10 add $0x10,%esp + 104ed6: ff 4d cc decl 0xffffffcc(%ebp) + 104ed9: 75 e9 jne 104ec4 + 104edb: 90 nop + 104edc: c7 45 cc 00 00 00 00 movl $0x0,0xffffffcc(%ebp) + 104ee3: c7 45 d4 00 00 00 00 movl $0x0,0xffffffd4(%ebp) + 104eea: 31 db xor %ebx,%ebx + 104eec: e9 37 fe ff ff jmp 104d28 + 104ef1: 83 ec 08 sub $0x8,%esp + 104ef4: 8d 55 14 lea 0x14(%ebp),%edx + 104ef7: 52 push %edx + 104ef8: 6a 2d push $0x2d + 104efa: ff 55 10 call *0x10(%ebp) + 104efd: ff 45 d0 incl 0xffffffd0(%ebp) + 104f00: 83 c4 10 add $0x10,%esp + 104f03: eb 8e jmp 104e93 + 104f05: 83 ec 08 sub $0x8,%esp + 104f08: 8d 55 14 lea 0x14(%ebp),%edx + 104f0b: 52 push %edx + 104f0c: 6a 2d push $0x2d + 104f0e: ff 55 10 call *0x10(%ebp) + 104f11: ff 45 d0 incl 0xffffffd0(%ebp) + 104f14: 83 c4 10 add $0x10,%esp + 104f17: e9 36 ff ff ff jmp 104e52 + 104f1c: 8d 42 57 lea 0x57(%edx),%eax + 104f1f: e9 fc fe ff ff jmp 104e20 + 104f24: 83 4d d4 20 orl $0x20,0xffffffd4(%ebp) + 104f28: f7 d9 neg %ecx + 104f2a: e9 c6 fe ff ff jmp 104df5 + 104f2f: 83 45 0c 04 addl $0x4,0xc(%ebp) + 104f33: 8b 55 0c mov 0xc(%ebp),%edx + 104f36: 0f b7 4a fc movzwl 0xfffffffc(%edx),%ecx + 104f3a: e9 a8 fe ff ff jmp 104de7 + 104f3f: f6 45 d4 04 testb $0x4,0xffffffd4(%ebp) + 104f43: 74 0f je 104f54 + 104f45: 83 45 0c 04 addl $0x4,0xc(%ebp) + 104f49: 8b 45 0c mov 0xc(%ebp),%eax + 104f4c: 8b 48 fc mov 0xfffffffc(%eax),%ecx + 104f4f: e9 93 fe ff ff jmp 104de7 + 104f54: 83 45 0c 04 addl $0x4,0xc(%ebp) + 104f58: 8b 55 0c mov 0xc(%ebp),%edx + 104f5b: 8b 4a fc mov 0xfffffffc(%edx),%ecx + 104f5e: e9 84 fe ff ff jmp 104de7 + 104f63: 83 45 0c 04 addl $0x4,0xc(%ebp) + 104f67: 83 65 d4 bf andl $0xffffffbf,0xffffffd4(%ebp) + 104f6b: 8b 55 0c mov 0xc(%ebp),%edx + 104f6e: 4f dec %edi + 104f6f: 8a 42 fc mov 0xfffffffc(%edx),%al + 104f72: bb 01 00 00 00 mov $0x1,%ebx + 104f77: 88 07 mov %al,(%edi) + 104f79: e9 d4 fe ff ff jmp 104e52 + 104f7e: 83 4d d4 04 orl $0x4,0xffffffd4(%ebp) + 104f82: bb 0a 00 00 00 mov $0xa,%ebx + 104f87: e9 32 fe ff ff jmp 104dbe + 104f8c: bb 08 00 00 00 mov $0x8,%ebx + 104f91: e9 28 fe ff ff jmp 104dbe + 104f96: 83 45 0c 04 addl $0x4,0xc(%ebp) + 104f9a: 8b 45 0c mov 0xc(%ebp),%eax + 104f9d: 83 65 d4 bf andl $0xffffffbf,0xffffffd4(%ebp) + 104fa1: 8b 78 fc mov 0xfffffffc(%eax),%edi + 104fa4: e9 85 fe ff ff jmp 104e2e + 104fa9: 83 4d d4 10 orl $0x10,0xffffffd4(%ebp) + 104fad: e9 76 fd ff ff jmp 104d28 + 104fb2: 83 4d d4 08 orl $0x8,0xffffffd4(%ebp) + 104fb6: e9 6d fd ff ff jmp 104d28 + 104fbb: 81 4d d4 80 00 00 00 orl $0x80,0xffffffd4(%ebp) + 104fc2: e9 61 fd ff ff jmp 104d28 + 104fc7: 83 4d d4 40 orl $0x40,0xffffffd4(%ebp) + 104fcb: 46 inc %esi + 104fcc: 8a 0e mov (%esi),%cl + 104fce: e9 89 fd ff ff jmp 104d5c + 104fd3: f6 45 d4 01 testb $0x1,0xffffffd4(%ebp) + 104fd7: 0f 85 ff fe ff ff jne 104edc + 104fdd: 83 4d d4 01 orl $0x1,0xffffffd4(%ebp) + 104fe1: e9 42 fd ff ff jmp 104d28 + 104fe6: 83 ec 08 sub $0x8,%esp + 104fe9: 8d 55 14 lea 0x14(%ebp),%edx + 104fec: 52 push %edx + 104fed: 6a 25 push $0x25 + 104fef: ff 55 10 call *0x10(%ebp) + 104ff2: 31 db xor %ebx,%ebx + 104ff4: ff 45 d0 incl 0xffffffd0(%ebp) + 104ff7: c7 45 cc 00 00 00 00 movl $0x0,0xffffffcc(%ebp) + 104ffe: c7 45 d4 00 00 00 00 movl $0x0,0xffffffd4(%ebp) + 105005: e9 18 fd ff ff jmp 104d22 + ... + +0010500c : +/***************************************************************************** +*****************************************************************************/ +void enable(void) +{ + 10500c: 55 push %ebp + 10500d: 89 e5 mov %esp,%ebp + __asm__ __volatile__("sti" + 10500f: fb sti + : + : + ); +} + 105010: c9 leave + 105011: c3 ret + ... + +00105014 : +/***************************************************************************** +*****************************************************************************/ +unsigned inportb(unsigned short port) +{ + 105014: 55 push %ebp + 105015: 89 e5 mov %esp,%ebp + 105017: 8b 55 08 mov 0x8(%ebp),%edx + unsigned char ret_val; + + __asm__ __volatile__("inb %1,%0" + 10501a: ec in (%dx),%al + : "=a"(ret_val) + : "d"(port)); + return ret_val; + 10501b: 0f b6 c0 movzbl %al,%eax +} + 10501e: c9 leave + 10501f: c3 ret + +00105020 : +4. Save/restore the floating-point state when entering/leaving + the kernel (protected OS only) +*****************************************************************************/ +void longjmp(jmp_buf buf, int ret_val) +{ + 105020: 55 push %ebp + 105021: 89 e5 mov %esp,%ebp + 105023: 8b 45 0c mov 0xc(%ebp),%eax + unsigned *esp; + +/* make sure return value is not 0 */ + if(ret_val == 0) + 105026: 85 c0 test %eax,%eax + 105028: 75 05 jne 10502f + ret_val++; + 10502a: b8 01 00 00 00 mov $0x1,%eax +/* EAX is used for return values, so store it in jmp_buf.EAX */ + buf->eax = ret_val; + 10502f: 8b 4d 08 mov 0x8(%ebp),%ecx + 105032: 89 41 1c mov %eax,0x1c(%ecx) +/* get ESP for new stack */ + esp = (unsigned *)buf->esp; +/* push EFLAGS on the new stack */ + esp--; + 105035: 8b 41 0c mov 0xc(%ecx),%eax + 105038: 83 e8 04 sub $0x4,%eax + *esp = buf->eflags; + 10503b: 8b 51 24 mov 0x24(%ecx),%edx + 10503e: 89 10 mov %edx,(%eax) +/* push current CS on the new stack */ + esp--; + 105040: 83 e8 04 sub $0x4,%eax + __asm__ __volatile__( + 105043: 8c 08 movl %cs,(%eax) + "mov %%cs,%0\n" + : "=m"(*esp)); +/* push EIP on the new stack */ + esp--; + 105045: 83 e8 04 sub $0x4,%eax + *esp = buf->eip; + 105048: 8b 51 20 mov 0x20(%ecx),%edx + 10504b: 89 10 mov %edx,(%eax) +/* new ESP is 12 bytes lower; update jmp_buf.ESP */ + buf->esp = (unsigned)esp; + 10504d: 89 41 0c mov %eax,0xc(%ecx) +/* now, briefly, make the jmp_buf struct our stack */ + __asm__ __volatile__( + 105050: 8b 65 08 mov 0x8(%ebp),%esp + 105053: 61 popa + 105054: 8b 64 24 ec mov 0xffffffec(%esp,1),%esp + 105058: cf iret + "movl %0,%%esp\n" +/* ESP now points to 8 general-purpose registers stored in jmp_buf +Pop them */ + "popa\n" +/* load new stack pointer from jmp_buf */ + "movl -20(%%esp),%%esp\n" +/* ESP now points to new stack, with the IRET frame (EIP, CS, EFLAGS) +we created just above. Pop these registers: */ + "iret\n" + : + : "m"(buf)); +} + 105059: c9 leave + 10505a: c3 ret + ... + +0010505c : +void *memcpy(void *s, const void *t, unsigned n) +{ + 10505c: 55 push %ebp + 10505d: 89 e5 mov %esp,%ebp + void *ret = s; + + while(n--) + 10505f: 8b 55 10 mov 0x10(%ebp),%edx + 105062: 56 push %esi + 105063: 4a dec %edx + 105064: 53 push %ebx + 105065: 83 fa ff cmp $0xffffffff,%edx + 105068: 8b 5d 08 mov 0x8(%ebp),%ebx + 10506b: 8b 4d 0c mov 0xc(%ebp),%ecx + 10506e: 89 de mov %ebx,%esi + 105070: 74 0e je 105080 + 105072: 89 f6 mov %esi,%esi + { + *(char *)s = *(char *)t; + 105074: 8a 01 mov (%ecx),%al + s = (char *)s + 1; + t = (char *)t + 1; + 105076: 4a dec %edx + 105077: 88 03 mov %al,(%ebx) + 105079: 41 inc %ecx + 10507a: 43 inc %ebx + 10507b: 83 fa ff cmp $0xffffffff,%edx + 10507e: 75 f4 jne 105074 + } + + return ret; +} + 105080: 5b pop %ebx + 105081: 89 f0 mov %esi,%eax + 105083: 5e pop %esi + 105084: c9 leave + 105085: c3 ret + ... + +00105088 : + +void *memsetw(void *s, short i, unsigned n) +{ + 105088: 55 push %ebp + 105089: 89 e5 mov %esp,%ebp + void *start = s; + + while(n--) + 10508b: 8b 55 10 mov 0x10(%ebp),%edx + 10508e: 4a dec %edx + 10508f: 8b 4d 08 mov 0x8(%ebp),%ecx + 105092: 83 fa ff cmp $0xffffffff,%edx + 105095: 53 push %ebx + 105096: 8b 45 0c mov 0xc(%ebp),%eax + 105099: 89 cb mov %ecx,%ebx + 10509b: 74 0f je 1050ac + 10509d: 8d 76 00 lea 0x0(%esi),%esi + { + *(short *)s = (short)i; + s = (short *)s + 1; + 1050a0: 4a dec %edx + 1050a1: 66 89 01 mov %ax,(%ecx) + 1050a4: 83 c1 02 add $0x2,%ecx + 1050a7: 83 fa ff cmp $0xffffffff,%edx + 1050aa: 75 f4 jne 1050a0 + } + + return(start); +} + 1050ac: 89 d8 mov %ebx,%eax + 1050ae: 5b pop %ebx + 1050af: c9 leave + 1050b0: c3 ret + 1050b1: 00 00 add %al,(%eax) + ... + +001050b4 : +/***************************************************************************** +*****************************************************************************/ +void outportb(unsigned port, unsigned val) +{ + 1050b4: 55 push %ebp + 1050b5: 89 e5 mov %esp,%ebp + 1050b7: 8b 55 08 mov 0x8(%ebp),%edx + 1050ba: 8b 45 0c mov 0xc(%ebp),%eax + __asm__ __volatile__("outb %b0,%w1" + 1050bd: ee out %al,(%dx) + : + : "a"(val), "d"(port)); +} + 1050be: c9 leave + 1050bf: c3 ret + +001050c0 : +int do_printf(const char *fmt, va_list args, fnptr_t fn, void *ptr); +void putch(unsigned c); + +int printf_help(unsigned c, void **ptr) +{ + 1050c0: 55 push %ebp + 1050c1: 89 e5 mov %esp,%ebp + 1050c3: 83 ec 14 sub $0x14,%esp + /** + * Leave this for now + */ + ptr = ptr; + + putch(c); + 1050c6: ff 75 08 pushl 0x8(%ebp) + 1050c9: e8 32 fa ff ff call 104b00 + return 0; +} + 1050ce: 31 c0 xor %eax,%eax + 1050d0: c9 leave + 1050d1: c3 ret + 1050d2: 89 f6 mov %esi,%esi + +001050d4 : + +void printf(const char *fmt, ...) +{ + 1050d4: 55 push %ebp + 1050d5: 89 e5 mov %esp,%ebp + 1050d7: 83 ec 08 sub $0x8,%esp + va_list args; + + va_start(args, fmt); + (void)do_printf(fmt, args, printf_help, NULL); + 1050da: 6a 00 push $0x0 + 1050dc: 68 c0 50 10 00 push $0x1050c0 + 1050e1: 8d 45 0c lea 0xc(%ebp),%eax + 1050e4: 50 push %eax + 1050e5: ff 75 08 pushl 0x8(%ebp) + 1050e8: e8 e3 fb ff ff call 104cd0 + va_end(args); +} + 1050ed: c9 leave + 1050ee: c3 ret + ... + +001050f0 : +int strcmp(const char * src, const char * dst) +{ + 1050f0: 55 push %ebp + 1050f1: 89 e5 mov %esp,%ebp + 1050f3: 56 push %esi + 1050f4: 53 push %ebx + 1050f5: 8b 5d 0c mov 0xc(%ebp),%ebx + 1050f8: 8b 75 08 mov 0x8(%ebp),%esi + int ret = 0 ; + + while(!(ret = *(unsigned char *)src - *(unsigned char *)dst) && *dst) + 1050fb: 8a 0b mov (%ebx),%cl + 1050fd: 0f b6 c1 movzbl %cl,%eax + 105100: 0f b6 16 movzbl (%esi),%edx + 105103: 29 c2 sub %eax,%edx + 105105: 89 d0 mov %edx,%eax + 105107: 75 1b jne 105124 + 105109: 84 c9 test %cl,%cl + 10510b: 74 17 je 105124 + 10510d: 8d 76 00 lea 0x0(%esi),%esi + ++src, ++dst; + 105110: 43 inc %ebx + 105111: 46 inc %esi + 105112: 8a 0b mov (%ebx),%cl + 105114: 0f b6 c1 movzbl %cl,%eax + 105117: 0f b6 16 movzbl (%esi),%edx + 10511a: 29 c2 sub %eax,%edx + 10511c: 89 d0 mov %edx,%eax + 10511e: 75 04 jne 105124 + 105120: 84 c9 test %cl,%cl + 105122: 75 ec jne 105110 + + if(ret < 0) + 105124: 85 c0 test %eax,%eax + 105126: 78 0d js 105135 + ret = -1 ; + else if(ret > 0) + 105128: 85 c0 test %eax,%eax + 10512a: 7e 05 jle 105131 + ret = 1 ; + 10512c: b8 01 00 00 00 mov $0x1,%eax + + return(ret); +} + 105131: 5b pop %ebx + 105132: 5e pop %esi + 105133: c9 leave + 105134: c3 ret + 105135: b8 ff ff ff ff mov $0xffffffff,%eax + 10513a: eb f5 jmp 105131 + +0010513c : + +char *strcpy(char *s, const char *t) +{ + 10513c: 55 push %ebp + 10513d: 89 e5 mov %esp,%ebp + 10513f: 8b 4d 08 mov 0x8(%ebp),%ecx + 105142: 8b 55 0c mov 0xc(%ebp),%edx + 105145: 8d 76 00 lea 0x0(%esi),%esi + while((*(s++) = *(t++))); + 105148: 8a 02 mov (%edx),%al + 10514a: 88 01 mov %al,(%ecx) + 10514c: 42 inc %edx + 10514d: 41 inc %ecx + 10514e: 84 c0 test %al,%al + 105150: 75 f6 jne 105148 + + return s; +} + 105152: 89 c8 mov %ecx,%eax + 105154: c9 leave + 105155: c3 ret + ... + +00105158 : +#include /* size_t */ +/***************************************************************************** +*****************************************************************************/ +size_t strlen(const char *str) +{ + 105158: 55 push %ebp + 105159: 89 e5 mov %esp,%ebp + 10515b: 8b 55 08 mov 0x8(%ebp),%edx + size_t ret_val; + + for(ret_val = 0; *str != '\0'; str++) + 10515e: 31 c0 xor %eax,%eax + 105160: 80 3a 00 cmpb $0x0,(%edx) + 105163: 74 0a je 10516f + 105165: 8d 76 00 lea 0x0(%esi),%esi + 105168: 42 inc %edx + ret_val++; + 105169: 40 inc %eax + 10516a: 80 3a 00 cmpb $0x0,(%edx) + 10516d: 75 f9 jne 105168 + return ret_val; +} + 10516f: c9 leave + 105170: c3 ret + 105171: 00 00 add %al,(%eax) + ... + +00105174 : +#include /* size_t */ + +char *strncpy(char * dest, const char * source, size_t count) +{ + 105174: 55 push %ebp + 105175: 89 e5 mov %esp,%ebp + 105177: 8b 55 10 mov 0x10(%ebp),%edx + 10517a: 56 push %esi + char *start = dest; + + while(count && (*dest++ = *source++)) /* copy string */ + 10517b: 85 d2 test %edx,%edx + 10517d: 53 push %ebx + 10517e: 8b 75 08 mov 0x8(%ebp),%esi + 105181: 8b 5d 0c mov 0xc(%ebp),%ebx + 105184: 74 2a je 1051b0 + 105186: 8a 03 mov (%ebx),%al + 105188: 43 inc %ebx + 105189: 84 c0 test %al,%al + 10518b: 88 06 mov %al,(%esi) + 10518d: 8d 4e 01 lea 0x1(%esi),%ecx + 105190: 74 0f je 1051a1 + 105192: 89 f6 mov %esi,%esi + count--; + 105194: 4a dec %edx + 105195: 74 19 je 1051b0 + 105197: 8a 03 mov (%ebx),%al + 105199: 88 01 mov %al,(%ecx) + 10519b: 43 inc %ebx + 10519c: 41 inc %ecx + 10519d: 84 c0 test %al,%al + 10519f: 75 f3 jne 105194 + + if(count) /* pad out with zeroes */ + 1051a1: 85 d2 test %edx,%edx + 1051a3: 74 0b je 1051b0 + while(--count) + 1051a5: 4a dec %edx + 1051a6: 74 08 je 1051b0 + *dest++ = '\0'; + 1051a8: c6 01 00 movb $0x0,(%ecx) + 1051ab: 41 inc %ecx + 1051ac: 4a dec %edx + 1051ad: 75 f9 jne 1051a8 + 1051af: 90 nop + + return(start); +} + 1051b0: 5b pop %ebx + 1051b1: 89 f0 mov %esi,%eax + 1051b3: 5e pop %esi + 1051b4: c9 leave + 1051b5: c3 ret + 1051b6: 5b pop %ebx + 1051b7: 20 00 and %al,(%eax) + 1051b9: 25 73 3a 20 25 and $0x25203a73,%eax + 1051be: 73 00 jae 1051c0 + 1051c0: 20 5d 00 and %bl,0x0(%ebp) + 1051c3: 57 push %edi + 1051c4: 61 popa + 1051c5: 69 74 00 08 08 08 08 imul $0x46080808,0x8(%eax,%eax,1),%esi + 1051cc: 46 + 1051cd: 61 popa + 1051ce: 69 6c 0a 00 08 08 08 imul $0x8080808,0x0(%edx,%ecx,1),%ebp + 1051d5: 08 + 1051d6: 2e 2e 00 4f 6b add %cl,%cs:0x6b(%edi) + 1051db: 0a 00 or (%eax),%al + 1051dd: 25 30 32 58 20 and $0x20583230,%eax + 1051e2: 00 09 add %cl,(%ecx) + 1051e4: 00 25 63 00 75 53 add %ah,0x53750063 + 1051ea: 50 push %eax + 1051eb: 3d 25 30 38 58 cmp $0x58383025,%eax + 1051f0: 20 75 53 and %dh,0x53(%ebp) + 1051f3: 53 push %ebx + 1051f4: 3d 25 30 38 58 cmp $0x58383025,%eax + 1051f9: 0a 00 or (%eax),%al + 1051fb: 00 00 add %al,(%eax) + 1051fd: 00 00 add %al,(%eax) + 1051ff: 00 45 44 add %al,0x44(%ebp) + 105202: 49 dec %ecx + 105203: 3d 25 30 38 58 cmp $0x58383025,%eax + 105208: 20 45 53 and %al,0x53(%ebp) + 10520b: 49 dec %ecx + 10520c: 3d 25 30 38 58 cmp $0x58383025,%eax + 105211: 20 45 42 and %al,0x42(%ebp) + 105214: 50 push %eax + 105215: 3d 25 30 38 58 cmp $0x58383025,%eax + 10521a: 20 45 53 and %al,0x53(%ebp) + 10521d: 50 push %eax + 10521e: 3d 25 30 38 58 cmp $0x58383025,%eax + 105223: 0a 00 or (%eax),%al + ... + 10523d: 00 00 add %al,(%eax) + 10523f: 00 45 42 add %al,0x42(%ebp) + 105242: 58 pop %eax + 105243: 3d 25 30 38 58 cmp $0x58383025,%eax + 105248: 20 45 44 and %al,0x44(%ebp) + 10524b: 58 pop %eax + 10524c: 3d 25 30 38 58 cmp $0x58383025,%eax + 105251: 20 45 43 and %al,0x43(%ebp) + 105254: 58 pop %eax + 105255: 3d 25 30 38 58 cmp $0x58383025,%eax + 10525a: 20 45 41 and %al,0x41(%ebp) + 10525d: 58 pop %eax + 10525e: 3d 25 30 38 58 cmp $0x58383025,%eax + 105263: 0a 00 or (%eax),%al + ... + 10527d: 00 00 add %al,(%eax) + 10527f: 00 20 add %ah,(%eax) + 105281: 44 inc %esp + 105282: 53 push %ebx + 105283: 3d 25 30 38 58 cmp $0x58383025,%eax + 105288: 20 20 and %ah,(%eax) + 10528a: 45 inc %ebp + 10528b: 53 push %ebx + 10528c: 3d 25 30 38 58 cmp $0x58383025,%eax + 105291: 20 20 and %ah,(%eax) + 105293: 46 inc %esi + 105294: 53 push %ebx + 105295: 3d 25 30 38 58 cmp $0x58383025,%eax + 10529a: 20 20 and %ah,(%eax) + 10529c: 47 inc %edi + 10529d: 53 push %ebx + 10529e: 3d 25 30 38 58 cmp $0x58383025,%eax + 1052a3: 0a 00 or (%eax),%al + ... + 1052bd: 00 00 add %al,(%eax) + 1052bf: 00 69 6e add %ch,0x6e(%ecx) + 1052c2: 74 3d je 105301 + 1052c4: 25 30 38 58 20 and $0x20583830,%eax + 1052c9: 65 gs + 1052ca: 72 72 jb 10533e + 1052cc: 3d 25 30 38 58 cmp $0x58383025,%eax + 1052d1: 20 45 49 and %al,0x49(%ebp) + 1052d4: 50 push %eax + 1052d5: 3d 25 30 38 58 cmp $0x58383025,%eax + 1052da: 20 20 and %ah,(%eax) + 1052dc: 43 inc %ebx + 1052dd: 53 push %ebx + 1052de: 3d 25 30 38 58 cmp $0x58383025,%eax + 1052e3: 0a 00 or (%eax),%al + ... + 1052fd: 00 00 add %al,(%eax) + 1052ff: 00 64 75 6d add %ah,0x6d(%ebp,%esi,2) + 105303: 70 68 jo 10536d + 105305: 65 gs + 105306: 61 popa + 105307: 70 00 jo 105309 + 105309: 00 2d 68 00 00 00 add %ch,0x68 + ... + 10531f: 00 50 72 add %dl,0x72(%eax) + 105322: 69 6e 74 20 6c 69 73 imul $0x73696c20,0x74(%esi),%ebp + 105329: 74 69 je 105394 + 10532b: 6e outsb %ds:(%esi),(%dx) + 10532c: 67 20 6f 66 addr16 and %ch,102(%bx) + 105330: 20 68 65 and %ch,0x65(%eax) + 105333: 61 popa + 105334: 70 20 jo 105356 + 105336: 75 73 jne 1053ab + 105338: 61 popa + 105339: 67 65 20 61 6e addr16 and %ah,%gs:110(%bx,%di) + 10533e: 64 20 73 74 and %dh,%fs:0x74(%ebx) + 105342: 61 popa + 105343: 74 75 je 1053ba + 105345: 73 2e jae 105375 + 105347: 00 00 add %al,(%eax) + 105349: 65 63 68 6f arpl %bp,%gs:0x6f(%eax) + ... + 10535d: 00 00 add %al,(%eax) + 10535f: 00 45 63 add %al,0x63(%ebp) + 105362: 68 6f 20 61 20 push $0x2061206f + 105367: 6c insb (%dx),%es:(%edi) + 105368: 69 6e 65 20 6f 66 20 imul $0x20666f20,0x65(%esi),%ebp + 10536f: 74 65 je 1053d6 + 105371: 78 74 js 1053e7 + 105373: 20 74 6f 20 and %dh,0x20(%edi,%ebp,2) + 105377: 74 68 je 1053e1 + 105379: 65 20 74 65 72 and %dh,%gs:0x72(%ebp,2) + 10537e: 6d insl (%dx),%es:(%edi) + 10537f: 69 6e 61 6c 2e 00 00 imul $0x2e6c,0x61(%esi),%ebp + 105386: 68 65 6c 70 00 push $0x706c65 + ... + 10539f: 00 44 69 73 add %al,0x73(%ecx,%ebp,2) + 1053a3: 70 6c jo 105411 + 1053a5: 61 popa + 1053a6: 79 73 jns 10541b + 1053a8: 20 67 65 and %ah,0x65(%edi) + 1053ab: 6e outsb %ds:(%esi),(%dx) + 1053ac: 65 gs + 1053ad: 72 61 jb 105410 + 1053af: 6c insb (%dx),%es:(%edi) + 1053b0: 20 68 65 and %ch,0x65(%eax) + 1053b3: 6c insb (%dx),%es:(%edi) + 1053b4: 70 20 jo 1053d6 + 1053b6: 6d insl (%dx),%es:(%edi) + 1053b7: 65 6e outsb %gs:(%esi),(%dx) + 1053b9: 75 20 jne 1053db + 1053bb: 6f outsl %ds:(%esi),(%dx) + 1053bc: 72 20 jb 1053de + 1053be: 68 65 6c 70 20 push $0x20706c65 + 1053c3: 6f outsl %ds:(%esi),(%dx) + 1053c4: 6e outsb %ds:(%esi),(%dx) + 1053c5: 20 73 70 and %dh,0x70(%ebx) + 1053c8: 65 63 69 66 arpl %bp,%gs:0x66(%ecx) + 1053cc: 69 63 20 63 6f 6d 6d imul $0x6d6d6f63,0x20(%ebx),%esp + 1053d3: 61 popa + 1053d4: 6e outsb %ds:(%esi),(%dx) + 1053d5: 64 2e 00 00 add %al,%cs:%fs:(%eax) + 1053d9: 73 68 jae 105443 + 1053db: 75 74 jne 105451 + 1053dd: 64 6f outsl %fs:(%esi),(%dx) + 1053df: 77 6e ja 10544f + 1053e1: 00 00 add %al,(%eax) + 1053e3: 2d 72 00 00 4e sub $0x4e000072,%eax + 1053e8: 4f dec %edi + 1053e9: 57 push %edi + 1053ea: 00 00 add %al,(%eax) + 1053ec: 48 dec %eax + 1053ed: 61 popa + 1053ee: 6c insb (%dx),%es:(%edi) + 1053ef: 74 20 je 105411 + 1053f1: 6f outsl %ds:(%esi),(%dx) + 1053f2: 72 20 jb 105414 + 1053f4: 72 65 jb 10545b + 1053f6: 73 74 jae 10546c + 1053f8: 61 popa + 1053f9: 72 74 jb 10546f + 1053fb: 20 74 68 65 and %dh,0x65(%eax,%ebp,2) + 1053ff: 20 73 79 and %dh,0x79(%ebx) + 105402: 73 74 jae 105478 + 105404: 65 gs + 105405: 6d insl (%dx),%es:(%edi) + 105406: 2e 00 00 add %al,%cs:(%eax) + 105409: 63 6c 73 00 arpl %bp,0x0(%ebx,%esi,2) + ... + 10541d: 00 00 add %al,(%eax) + 10541f: 00 43 6c add %al,0x6c(%ebx) + 105422: 65 gs + 105423: 61 popa + 105424: 72 73 jb 105499 + 105426: 20 74 68 65 and %dh,0x65(%eax,%ebp,2) + 10542a: 20 74 65 72 and %dh,0x72(%ebp,2) + 10542e: 6d insl (%dx),%es:(%edi) + 10542f: 69 6e 61 6c 20 6f 66 imul $0x666f206c,0x61(%esi),%ebp + 105436: 20 61 6c and %ah,0x6c(%ecx) + 105439: 6c insb (%dx),%es:(%edi) + 10543a: 20 6f 75 and %ch,0x75(%edi) + 10543d: 74 70 je 1054af + 10543f: 75 74 jne 1054b5 + 105441: 2e 00 00 add %al,%cs:(%eax) + 105444: 70 77 jo 1054bd + 105446: 64 00 00 add %al,%fs:(%eax) + ... + 10545d: 00 00 add %al,(%eax) + 10545f: 00 50 72 add %dl,0x72(%eax) + 105462: 69 6e 74 73 20 74 68 imul $0x68742073,0x74(%esi),%ebp + 105469: 65 20 63 75 and %ah,%gs:0x75(%ebx) + 10546d: 72 72 jb 1054e1 + 10546f: 65 6e outsb %gs:(%esi),(%dx) + 105471: 74 20 je 105493 + 105473: 77 6f ja 1054e4 + 105475: 72 6b jb 1054e2 + 105477: 69 6e 67 20 64 69 72 imul $0x72696420,0x67(%esi),%ebp + 10547e: 65 63 74 6f 72 arpl %si,%gs:0x72(%edi,%ebp,2) + 105483: 79 2e jns 1054b3 + 105485: 00 00 add %al,(%eax) + 105487: 68 65 6c 70 00 push $0x706c65 + 10548c: 65 gs + 10548d: 73 68 jae 1054f7 + 10548f: 3a 20 cmp (%eax),%ah + 105491: 27 daa + 105492: 25 73 27 20 6e and $0x6e202773,%eax + 105497: 6f outsl %ds:(%esi),(%dx) + 105498: 74 20 je 1054ba + 10549a: 66 6f outsw %ds:(%esi),(%dx) + 10549c: 75 6e jne 10550c + 10549e: 64 2e 0a 00 or %cs:%fs:(%eax),%al + 1054a2: 55 push %ebp + 1054a3: 73 61 jae 105506 + 1054a5: 67 65 3a 20 addr16 cmp %gs:(%bx,%si),%ah + 1054a9: 25 73 20 25 73 and $0x73252073,%eax + 1054ae: 0a 00 or (%eax),%al + 1054b0: 48 dec %eax + 1054b1: 79 62 jns 105515 + 1054b3: 4f dec %edi + 1054b4: 53 push %ebx + 1054b5: 20 45 53 and %al,0x53(%ebp) + 1054b8: 68 65 6c 6c 20 push $0x206c6c65 + 1054bd: 43 inc %ebx + 1054be: 6f outsl %ds:(%esi),(%dx) + 1054bf: 6d insl (%dx),%es:(%edi) + 1054c0: 6d insl (%dx),%es:(%edi) + 1054c1: 61 popa + 1054c2: 6e outsb %ds:(%esi),(%dx) + 1054c3: 64 fs + 1054c4: 73 3a jae 105500 + 1054c6: 0a 00 or (%eax),%al + 1054c8: 25 31 30 73 20 and $0x20733031,%eax + 1054cd: 25 2d 73 0a 00 and $0xa732d,%eax + 1054d2: 08 20 or %ah,(%eax) + 1054d4: 08 00 or %al,(%eax) + 1054d6: 24 20 and $0x20,%al + 1054d8: 00 4f 6b add %cl,0x6b(%edi) + 1054db: 00 64 12 10 add %ah,0x10(%edx,%edx,1) + 1054df: 00 64 12 10 add %ah,0x10(%edx,%edx,1) + 1054e3: 00 94 09 10 00 c2 09 add %dl,0x9c20010(%ecx,%ecx,1) + 1054ea: 10 00 adc %al,(%eax) + 1054ec: e3 09 jecxz 1054f7 + 1054ee: 10 00 adc %al,(%eax) + 1054f0: 03 0a add (%edx),%ecx + 1054f2: 10 00 adc %al,(%eax) + 1054f4: 24 0a and $0xa,%al + 1054f6: 10 00 adc %al,(%eax) + 1054f8: 4a dec %edx + 1054f9: 0a 10 or (%eax),%dl + 1054fb: 00 71 0a add %dh,0xa(%ecx) + 1054fe: 10 00 adc %al,(%eax) + 105500: 97 xchg %eax,%edi + 105501: 0a 10 or (%eax),%dl + 105503: 00 be 0a 10 00 e4 add %bh,0xe400100a(%esi) + 105509: 0a 10 or (%eax),%dl + 10550b: 00 0b add %cl,(%ebx) + 10550d: 0b 10 or (%eax),%edx + 10550f: 00 31 add %dh,(%ecx) + 105511: 0b 10 or (%eax),%edx + 105513: 00 57 0b add %dl,0xb(%edi) + 105516: 10 00 adc %al,(%eax) + 105518: 64 12 10 adc %fs:(%eax),%dl + 10551b: 00 61 0b add %ah,0xb(%ecx) + 10551e: 10 00 adc %al,(%eax) + 105520: 88 0b mov %cl,(%ebx) + 105522: 10 00 adc %al,(%eax) + 105524: ae scas %es:(%edi),%al + 105525: 0b 10 or (%eax),%edx + 105527: 00 d4 add %dl,%ah + 105529: 0b 10 or (%eax),%edx + 10552b: 00 fb add %bh,%bl + 10552d: 0b 10 or (%eax),%edx + 10552f: 00 22 add %ah,(%edx) + 105531: 0c 10 or $0x10,%al + 105533: 00 48 0c add %cl,0xc(%eax) + 105536: 10 00 adc %al,(%eax) + 105538: 6e outsb %ds:(%esi),(%dx) + 105539: 0c 10 or $0x10,%al + 10553b: 00 95 0c 10 00 bc add %dl,0xbc00100c(%ebp) + 105541: 0c 10 or $0x10,%al + 105543: 00 e2 add %ah,%dl + 105545: 0c 10 or $0x10,%al + 105547: 00 08 add %cl,(%eax) + 105549: 0d 10 00 2f 0d or $0xd2f0010,%eax + 10554e: 10 00 adc %al,(%eax) + 105550: 64 12 10 adc %fs:(%eax),%dl + 105553: 00 39 add %bh,(%ecx) + 105555: 0d 10 00 60 0d or $0xd600010,%eax + 10555a: 10 00 adc %al,(%eax) + 10555c: 86 0d 10 00 ac 0d xchg %cl,0xdac0010 + 105562: 10 00 adc %al,(%eax) + 105564: d3 0d 10 00 fa 0d rorl %cl,0xdfa0010 + 10556a: 10 00 adc %al,(%eax) + 10556c: 20 0e and %cl,(%esi) + 10556e: 10 00 adc %al,(%eax) + 105570: 46 inc %esi + 105571: 0e push %cs + 105572: 10 00 adc %al,(%eax) + 105574: 6d insl (%dx),%es:(%edi) + 105575: 0e push %cs + 105576: 10 00 adc %al,(%eax) + 105578: 94 xchg %eax,%esp + 105579: 0e push %cs + 10557a: 10 00 adc %al,(%eax) + 10557c: ba 0e 10 00 e0 mov $0xe000100e,%edx + 105581: 0e push %cs + 105582: 10 00 adc %al,(%eax) + 105584: 64 12 10 adc %fs:(%eax),%dl + 105587: 00 ea add %ch,%dl + 105589: 0e push %cs + 10558a: 10 00 adc %al,(%eax) + 10558c: 11 0f adc %ecx,(%edi) + 10558e: 10 00 adc %al,(%eax) + 105590: 38 0f cmp %cl,(%edi) + 105592: 10 00 adc %al,(%eax) + 105594: 5f pop %edi + 105595: 0f 10 00 movups (%eax),%xmm0 + 105598: 85 0f test %ecx,(%edi) + 10559a: 10 00 adc %al,(%eax) + 10559c: ab stos %eax,%es:(%edi) + 10559d: 0f 10 00 movups (%eax),%xmm0 + 1055a0: d2 0f rorb %cl,(%edi) + 1055a2: 10 00 adc %al,(%eax) + 1055a4: f9 stc + 1055a5: 0f 10 00 movups (%eax),%xmm0 + 1055a8: 1f pop %ds + 1055a9: 10 10 adc %dl,(%eax) + 1055ab: 00 45 10 add %al,0x10(%ebp) + 1055ae: 10 00 adc %al,(%eax) + 1055b0: 6c insb (%dx),%es:(%edi) + 1055b1: 10 10 adc %dl,(%eax) + 1055b3: 00 64 12 10 add %ah,0x10(%edx,%edx,1) + 1055b7: 00 92 10 10 00 64 add %dl,0x64001010(%edx) + 1055bd: 12 10 adc (%eax),%dl + 1055bf: 00 9c 10 10 00 64 12 add %bl,0x12640010(%eax,%edx,1) + 1055c6: 10 00 adc %al,(%eax) + 1055c8: 64 12 10 adc %fs:(%eax),%dl + 1055cb: 00 64 12 10 add %ah,0x10(%edx,%edx,1) + 1055cf: 00 64 12 10 add %ah,0x10(%edx,%edx,1) + 1055d3: 00 64 12 10 add %ah,0x10(%edx,%edx,1) + 1055d7: 00 64 12 10 add %ah,0x10(%edx,%edx,1) + 1055db: 00 64 12 10 add %ah,0x10(%edx,%edx,1) + 1055df: 00 64 12 10 add %ah,0x10(%edx,%edx,1) + 1055e3: 00 64 12 10 add %ah,0x10(%edx,%edx,1) + 1055e7: 00 64 12 10 add %ah,0x10(%edx,%edx,1) + 1055eb: 00 64 12 10 add %ah,0x10(%edx,%edx,1) + 1055ef: 00 64 12 10 add %ah,0x10(%edx,%edx,1) + 1055f3: 00 64 12 10 add %ah,0x10(%edx,%edx,1) + 1055f7: 00 a6 10 10 00 cc add %ah,0xcc001010(%esi) + 1055fd: 10 10 adc %dl,(%eax) + 1055ff: 00 f3 add %dh,%bl + 105601: 10 10 adc %dl,(%eax) + 105603: 00 19 add %bl,(%ecx) + 105605: 11 10 adc %edx,(%eax) + 105607: 00 23 add %ah,(%ebx) + 105609: 11 10 adc %edx,(%eax) + 10560b: 00 4a 11 add %cl,0x11(%edx) + 10560e: 10 00 adc %al,(%eax) + 105610: 70 11 jo 105623 + 105612: 10 00 adc %al,(%eax) + 105614: 97 xchg %eax,%edi + 105615: 11 10 adc %edx,(%eax) + 105617: 00 a1 11 10 00 c7 add %ah,0xc7001011(%ecx) + 10561d: 11 10 adc %edx,(%eax) + 10561f: 00 ee add %ch,%dh + 105621: 11 10 adc %edx,(%eax) + 105623: 00 14 12 add %dl,(%edx,%edx,1) + 105626: 10 00 adc %al,(%eax) + 105628: 3b 12 cmp (%edx),%edx + 10562a: 10 00 adc %al,(%eax) + 10562c: 64 12 10 adc %fs:(%eax),%dl + 10562f: 00 64 12 10 add %ah,0x10(%edx,%edx,1) + 105633: 00 64 12 10 add %ah,0x10(%edx,%edx,1) + 105637: 00 64 12 10 add %ah,0x10(%edx,%edx,1) + 10563b: 00 64 12 10 add %ah,0x10(%edx,%edx,1) + 10563f: 00 64 12 10 add %ah,0x10(%edx,%edx,1) + 105643: 00 64 12 10 add %ah,0x10(%edx,%edx,1) + 105647: 00 64 12 10 add %ah,0x10(%edx,%edx,1) + 10564b: 00 64 12 10 add %ah,0x10(%edx,%edx,1) + 10564f: 00 64 12 10 add %ah,0x10(%edx,%edx,1) + 105653: 00 64 12 10 add %ah,0x10(%edx,%edx,1) + 105657: 00 64 12 10 add %ah,0x10(%edx,%edx,1) + 10565b: 00 64 12 10 add %ah,0x10(%edx,%edx,1) + 10565f: 00 64 12 10 add %ah,0x10(%edx,%edx,1) + 105663: 00 64 12 10 add %ah,0x10(%edx,%edx,1) + 105667: 00 64 12 10 add %ah,0x10(%edx,%edx,1) + 10566b: 00 64 12 10 add %ah,0x10(%edx,%edx,1) + 10566f: 00 64 12 10 add %ah,0x10(%edx,%edx,1) + 105673: 00 64 12 10 add %ah,0x10(%edx,%edx,1) + 105677: 00 64 12 10 add %ah,0x10(%edx,%edx,1) + 10567b: 00 64 12 10 add %ah,0x10(%edx,%edx,1) + 10567f: 00 64 12 10 add %ah,0x10(%edx,%edx,1) + 105683: 00 64 12 10 add %ah,0x10(%edx,%edx,1) + 105687: 00 64 12 10 add %ah,0x10(%edx,%edx,1) + 10568b: 00 64 12 10 add %ah,0x10(%edx,%edx,1) + 10568f: 00 64 12 10 add %ah,0x10(%edx,%edx,1) + 105693: 00 64 12 10 add %ah,0x10(%edx,%edx,1) + 105697: 00 64 12 10 add %ah,0x10(%edx,%edx,1) + 10569b: 00 64 12 10 add %ah,0x10(%edx,%edx,1) + 10569f: 00 64 12 10 add %ah,0x10(%edx,%edx,1) + 1056a3: 00 64 12 10 add %ah,0x10(%edx,%edx,1) + 1056a7: 00 64 12 10 add %ah,0x10(%edx,%edx,1) + 1056ab: 00 64 12 10 add %ah,0x10(%edx,%edx,1) + 1056af: 00 64 12 10 add %ah,0x10(%edx,%edx,1) + 1056b3: 00 64 12 10 add %ah,0x10(%edx,%edx,1) + 1056b7: 00 64 12 10 add %ah,0x10(%edx,%edx,1) + 1056bb: 00 64 12 10 add %ah,0x10(%edx,%edx,1) + 1056bf: 00 64 12 10 add %ah,0x10(%edx,%edx,1) + 1056c3: 00 64 12 10 add %ah,0x10(%edx,%edx,1) + 1056c7: 00 64 12 10 add %ah,0x10(%edx,%edx,1) + 1056cb: 00 64 12 10 add %ah,0x10(%edx,%edx,1) + 1056cf: 00 64 12 10 add %ah,0x10(%edx,%edx,1) + 1056d3: 00 64 12 10 add %ah,0x10(%edx,%edx,1) + 1056d7: 00 64 12 10 add %ah,0x10(%edx,%edx,1) + 1056db: 00 64 12 10 add %ah,0x10(%edx,%edx,1) + 1056df: 00 64 12 10 add %ah,0x10(%edx,%edx,1) + 1056e3: 00 64 12 10 add %ah,0x10(%edx,%edx,1) + 1056e7: 00 64 12 10 add %ah,0x10(%edx,%edx,1) + 1056eb: 00 64 12 10 add %ah,0x10(%edx,%edx,1) + 1056ef: 00 64 12 10 add %ah,0x10(%edx,%edx,1) + 1056f3: 00 64 12 10 add %ah,0x10(%edx,%edx,1) + 1056f7: 00 64 12 10 add %ah,0x10(%edx,%edx,1) + 1056fb: 00 64 12 10 add %ah,0x10(%edx,%edx,1) + 1056ff: 00 64 12 10 add %ah,0x10(%edx,%edx,1) + 105703: 00 64 12 10 add %ah,0x10(%edx,%edx,1) + 105707: 00 64 12 10 add %ah,0x10(%edx,%edx,1) + 10570b: 00 64 12 10 add %ah,0x10(%edx,%edx,1) + 10570f: 00 64 12 10 add %ah,0x10(%edx,%edx,1) + 105713: 00 64 12 10 add %ah,0x10(%edx,%edx,1) + 105717: 00 64 12 10 add %ah,0x10(%edx,%edx,1) + 10571b: 00 64 12 10 add %ah,0x10(%edx,%edx,1) + 10571f: 00 64 12 10 add %ah,0x10(%edx,%edx,1) + 105723: 00 64 12 10 add %ah,0x10(%edx,%edx,1) + 105727: 00 64 12 10 add %ah,0x10(%edx,%edx,1) + 10572b: 00 64 12 10 add %ah,0x10(%edx,%edx,1) + 10572f: 00 64 12 10 add %ah,0x10(%edx,%edx,1) + 105733: 00 64 12 10 add %ah,0x10(%edx,%edx,1) + 105737: 00 64 12 10 add %ah,0x10(%edx,%edx,1) + 10573b: 00 64 12 10 add %ah,0x10(%edx,%edx,1) + 10573f: 00 64 12 10 add %ah,0x10(%edx,%edx,1) + 105743: 00 64 12 10 add %ah,0x10(%edx,%edx,1) + 105747: 00 64 12 10 add %ah,0x10(%edx,%edx,1) + 10574b: 00 64 12 10 add %ah,0x10(%edx,%edx,1) + 10574f: 00 64 12 10 add %ah,0x10(%edx,%edx,1) + 105753: 00 64 12 10 add %ah,0x10(%edx,%edx,1) + 105757: 00 64 12 10 add %ah,0x10(%edx,%edx,1) + 10575b: 00 64 12 10 add %ah,0x10(%edx,%edx,1) + 10575f: 00 64 12 10 add %ah,0x10(%edx,%edx,1) + 105763: 00 64 12 10 add %ah,0x10(%edx,%edx,1) + 105767: 00 64 12 10 add %ah,0x10(%edx,%edx,1) + 10576b: 00 64 12 10 add %ah,0x10(%edx,%edx,1) + 10576f: 00 64 12 10 add %ah,0x10(%edx,%edx,1) + 105773: 00 64 12 10 add %ah,0x10(%edx,%edx,1) + 105777: 00 64 12 10 add %ah,0x10(%edx,%edx,1) + 10577b: 00 64 12 10 add %ah,0x10(%edx,%edx,1) + 10577f: 00 64 12 10 add %ah,0x10(%edx,%edx,1) + 105783: 00 64 12 10 add %ah,0x10(%edx,%edx,1) + 105787: 00 64 12 10 add %ah,0x10(%edx,%edx,1) + 10578b: 00 64 12 10 add %ah,0x10(%edx,%edx,1) + 10578f: 00 64 12 10 add %ah,0x10(%edx,%edx,1) + 105793: 00 64 12 10 add %ah,0x10(%edx,%edx,1) + 105797: 00 64 12 10 add %ah,0x10(%edx,%edx,1) + 10579b: 00 64 12 10 add %ah,0x10(%edx,%edx,1) + 10579f: 00 64 12 10 add %ah,0x10(%edx,%edx,1) + 1057a3: 00 64 12 10 add %ah,0x10(%edx,%edx,1) + 1057a7: 00 64 12 10 add %ah,0x10(%edx,%edx,1) + 1057ab: 00 64 12 10 add %ah,0x10(%edx,%edx,1) + 1057af: 00 64 12 10 add %ah,0x10(%edx,%edx,1) + 1057b3: 00 64 12 10 add %ah,0x10(%edx,%edx,1) + 1057b7: 00 64 12 10 add %ah,0x10(%edx,%edx,1) + 1057bb: 00 64 12 10 add %ah,0x10(%edx,%edx,1) + 1057bf: 00 64 12 10 add %ah,0x10(%edx,%edx,1) + 1057c3: 00 64 12 10 add %ah,0x10(%edx,%edx,1) + 1057c7: 00 64 12 10 add %ah,0x10(%edx,%edx,1) + 1057cb: 00 64 12 10 add %ah,0x10(%edx,%edx,1) + 1057cf: 00 64 12 10 add %ah,0x10(%edx,%edx,1) + 1057d3: 00 64 12 10 add %ah,0x10(%edx,%edx,1) + 1057d7: 00 64 12 10 add %ah,0x10(%edx,%edx,1) + 1057db: 00 64 12 10 add %ah,0x10(%edx,%edx,1) + 1057df: 00 64 12 10 add %ah,0x10(%edx,%edx,1) + 1057e3: 00 64 12 10 add %ah,0x10(%edx,%edx,1) + 1057e7: 00 64 12 10 add %ah,0x10(%edx,%edx,1) + 1057eb: 00 64 12 10 add %ah,0x10(%edx,%edx,1) + 1057ef: 00 64 12 10 add %ah,0x10(%edx,%edx,1) + 1057f3: 00 64 12 10 add %ah,0x10(%edx,%edx,1) + 1057f7: 00 64 12 10 add %ah,0x10(%edx,%edx,1) + 1057fb: 00 64 12 10 add %ah,0x10(%edx,%edx,1) + 1057ff: 00 64 12 10 add %ah,0x10(%edx,%edx,1) + 105803: 00 64 12 10 add %ah,0x10(%edx,%edx,1) + 105807: 00 64 12 10 add %ah,0x10(%edx,%edx,1) + 10580b: 00 64 12 10 add %ah,0x10(%edx,%edx,1) + 10580f: 00 64 12 10 add %ah,0x10(%edx,%edx,1) + 105813: 00 64 12 10 add %ah,0x10(%edx,%edx,1) + 105817: 00 64 12 10 add %ah,0x10(%edx,%edx,1) + 10581b: 00 64 12 10 add %ah,0x10(%edx,%edx,1) + 10581f: 00 64 12 10 add %ah,0x10(%edx,%edx,1) + 105823: 00 64 12 10 add %ah,0x10(%edx,%edx,1) + 105827: 00 64 12 10 add %ah,0x10(%edx,%edx,1) + 10582b: 00 64 12 10 add %ah,0x10(%edx,%edx,1) + 10582f: 00 64 12 10 add %ah,0x10(%edx,%edx,1) + 105833: 00 64 12 10 add %ah,0x10(%edx,%edx,1) + 105837: 00 64 12 10 add %ah,0x10(%edx,%edx,1) + 10583b: 00 64 12 10 add %ah,0x10(%edx,%edx,1) + 10583f: 00 64 12 10 add %ah,0x10(%edx,%edx,1) + 105843: 00 64 12 10 add %ah,0x10(%edx,%edx,1) + 105847: 00 64 12 10 add %ah,0x10(%edx,%edx,1) + 10584b: 00 64 12 10 add %ah,0x10(%edx,%edx,1) + 10584f: 00 64 12 10 add %ah,0x10(%edx,%edx,1) + 105853: 00 64 12 10 add %ah,0x10(%edx,%edx,1) + 105857: 00 64 12 10 add %ah,0x10(%edx,%edx,1) + 10585b: 00 98 08 10 00 69 add %bl,0x69001008(%eax) + 105861: 6e outsb %ds:(%esi),(%dx) + 105862: 69 74 3a 20 6b 65 79 imul $0x6279656b,0x20(%edx,%edi,1),%esi + 105869: 62 + 10586a: 6f outsl %ds:(%esi),(%dx) + 10586b: 61 popa + 10586c: 72 64 jb 1058d2 + 10586e: 20 25 32 75 20 62 and %ah,0x62207532 + 105874: 75 66 jne 1058dc + 105876: 2c 20 sub $0x20,%al + 105878: 25 32 75 62 20 and $0x20627532,%eax + 10587d: 65 gs + 10587e: 61 popa + 10587f: 63 68 20 arpl %bp,0x20(%eax) + ... + 10589e: 00 00 add %al,(%eax) + 1058a0: 5d pop %ebp + 1058a1: 2e cs + 1058a2: 2e cs + 1058a3: 2e cs + 1058a4: 2e cs + 1058a5: 2e cs + 1058a6: 2e cs + 1058a7: 2e cs + 1058a8: 2e cs + 1058a9: 2e cs + 1058aa: 2e cs + 1058ab: 2e cs + 1058ac: 2e cs + 1058ad: 2e cs + 1058ae: 2e cs + 1058af: 2e cs + 1058b0: 2e cs + 1058b1: 2e cs + 1058b2: 2e cs + 1058b3: 2e cs + 1058b4: 2e cs + 1058b5: 2e cs + 1058b6: 2e cs + 1058b7: 2e cs + 1058b8: 2e 2e 2e 2e 2e 2e 2e add %dl,%cs:(%edx) + 1058bf: 2e 2e 2e 2e 2e 2e 2e + 1058c6: 2e 2e 2e 2e 2e 2e 00 + 1058cd: 0a + 1058ce: 0a 70 61 or 0x61(%eax),%dh + 1058d1: 6e outsb %ds:(%esi),(%dx) + 1058d2: 69 63 3a 20 00 0a 0a imul $0xa0a0020,0x3a(%ebx),%esp + 1058d9: 53 push %ebx + 1058da: 79 73 jns 10594f + 1058dc: 74 65 je 105943 + 1058de: 6d insl (%dx),%es:(%edi) + 1058df: 20 68 61 and %ch,0x61(%eax) + 1058e2: 6c insb (%dx),%es:(%edi) + 1058e3: 74 65 je 10594a + 1058e5: 64 2e 00 44 69 76 add %al,%cs:%fs:0x76(%ecx,%ebp,2) + 1058eb: 69 64 65 20 65 72 72 imul $0x6f727265,0x20(%ebp,2),%esp + 1058f2: 6f + 1058f3: 72 00 jb 1058f5 + 1058f5: 44 inc %esp + 1058f6: 65 62 75 67 bound %esi,%gs:0x67(%ebp) + 1058fa: 20 65 78 and %ah,0x78(%ebp) + 1058fd: 63 65 70 arpl %sp,0x70(%ebp) + 105900: 74 69 je 10596b + 105902: 6f outsl %ds:(%esi),(%dx) + 105903: 6e outsb %ds:(%esi),(%dx) + 105904: 00 4e 6f add %cl,0x6f(%esi) + 105907: 6e outsb %ds:(%esi),(%dx) + 105908: 6d insl (%dx),%es:(%edi) + 105909: 61 popa + 10590a: 73 6b jae 105977 + 10590c: 61 popa + 10590d: 62 6c 65 20 bound %ebp,0x20(%ebp,2) + 105911: 69 6e 74 65 72 72 75 imul $0x75727265,0x74(%esi),%ebp + 105918: 70 74 jo 10598e + 10591a: 20 28 and %ch,(%eax) + 10591c: 4e dec %esi + 10591d: 4d dec %ebp + 10591e: 49 dec %ecx + 10591f: 29 00 sub %eax,(%eax) + 105921: 42 inc %edx + 105922: 72 65 jb 105989 + 105924: 61 popa + 105925: 6b 70 6f 69 imul $0x69,0x6f(%eax),%esi + 105929: 6e outsb %ds:(%esi),(%dx) + 10592a: 74 20 je 10594c + 10592c: 28 49 4e sub %cl,0x4e(%ecx) + 10592f: 54 push %esp + 105930: 33 29 xor (%ecx),%ebp + 105932: 00 4f 76 add %cl,0x76(%edi) + 105935: 65 gs + 105936: 72 66 jb 10599e + 105938: 6c insb (%dx),%es:(%edi) + 105939: 6f outsl %ds:(%esi),(%dx) + 10593a: 77 20 ja 10595c + 10593c: 28 49 4e sub %cl,0x4e(%ecx) + 10593f: 54 push %esp + 105940: 4f dec %edi + 105941: 29 00 sub %eax,(%eax) + 105943: 42 inc %edx + 105944: 6f outsl %ds:(%esi),(%dx) + 105945: 75 6e jne 1059b5 + 105947: 64 fs + 105948: 73 20 jae 10596a + 10594a: 63 68 65 arpl %bp,0x65(%eax) + 10594d: 63 6b 00 arpl %bp,0x0(%ebx) + 105950: 49 dec %ecx + 105951: 6e outsb %ds:(%esi),(%dx) + 105952: 76 61 jbe 1059b5 + 105954: 6c insb (%dx),%es:(%edi) + 105955: 69 64 20 6f 70 63 6f imul $0x646f6370,0x6f(%eax,1),%esp + 10595c: 64 + 10595d: 65 00 43 6f add %al,%gs:0x6f(%ebx) + 105961: 70 72 jo 1059d5 + 105963: 6f outsl %ds:(%esi),(%dx) + 105964: 63 65 73 arpl %sp,0x73(%ebp) + 105967: 73 6f jae 1059d8 + 105969: 72 20 jb 10598b + 10596b: 6e outsb %ds:(%esi),(%dx) + 10596c: 6f outsl %ds:(%esi),(%dx) + 10596d: 74 20 je 10598f + 10596f: 61 popa + 105970: 76 61 jbe 1059d3 + 105972: 69 6c 61 62 6c 65 00 imul $0x4400656c,0x62(%ecx,2),%ebp + 105979: 44 + 10597a: 6f outsl %ds:(%esi),(%dx) + 10597b: 75 62 jne 1059df + 10597d: 6c insb (%dx),%es:(%edi) + 10597e: 65 20 66 61 and %ah,%gs:0x61(%esi) + 105982: 75 6c jne 1059f0 + 105984: 74 00 je 105986 + 105986: 43 inc %ebx + 105987: 6f outsl %ds:(%esi),(%dx) + 105988: 70 72 jo 1059fc + 10598a: 6f outsl %ds:(%esi),(%dx) + 10598b: 63 65 73 arpl %sp,0x73(%ebp) + 10598e: 73 6f jae 1059ff + 105990: 72 20 jb 1059b2 + 105992: 73 65 jae 1059f9 + 105994: 67 6d addr16 insl (%dx),%es:(%di) + 105996: 65 6e outsb %gs:(%esi),(%dx) + 105998: 74 20 je 1059ba + 10599a: 6f outsl %ds:(%esi),(%dx) + 10599b: 76 65 jbe 105a02 + 10599d: 72 72 jb 105a11 + 10599f: 75 6e jne 105a0f + 1059a1: 00 49 6e add %cl,0x6e(%ecx) + 1059a4: 76 61 jbe 105a07 + 1059a6: 6c insb (%dx),%es:(%edi) + 1059a7: 69 64 20 54 53 53 00 imul $0x53005353,0x54(%eax,1),%esp + 1059ae: 53 + 1059af: 65 gs + 1059b0: 67 6d addr16 insl (%dx),%es:(%di) + 1059b2: 65 6e outsb %gs:(%esi),(%dx) + 1059b4: 74 20 je 1059d6 + 1059b6: 6e outsb %ds:(%esi),(%dx) + 1059b7: 6f outsl %ds:(%esi),(%dx) + 1059b8: 74 20 je 1059da + 1059ba: 70 72 jo 105a2e + 1059bc: 65 gs + 1059bd: 73 65 jae 105a24 + 1059bf: 6e outsb %ds:(%esi),(%dx) + 1059c0: 74 00 je 1059c2 + 1059c2: 53 push %ebx + 1059c3: 74 61 je 105a26 + 1059c5: 63 6b 20 arpl %bp,0x20(%ebx) + 1059c8: 65 gs + 1059c9: 78 63 js 105a2e + 1059cb: 65 gs + 1059cc: 70 74 jo 105a42 + 1059ce: 69 6f 6e 00 47 65 6e imul $0x6e654700,0x6e(%edi),%ebp + 1059d5: 65 gs + 1059d6: 72 61 jb 105a39 + 1059d8: 6c insb (%dx),%es:(%edi) + 1059d9: 20 50 72 and %dl,0x72(%eax) + 1059dc: 6f outsl %ds:(%esi),(%dx) + 1059dd: 74 65 je 105a44 + 1059df: 63 74 69 6f arpl %si,0x6f(%ecx,%ebp,2) + 1059e3: 6e outsb %ds:(%esi),(%dx) + 1059e4: 20 46 61 and %al,0x61(%esi) + 1059e7: 75 6c jne 105a55 + 1059e9: 74 00 je 1059eb + 1059eb: 50 push %eax + 1059ec: 61 popa + 1059ed: 67 65 20 66 61 addr16 and %ah,%gs:97(%bp) + 1059f2: 75 6c jne 105a60 + 1059f4: 74 00 je 1059f6 + 1059f6: 43 inc %ebx + 1059f7: 6f outsl %ds:(%esi),(%dx) + 1059f8: 70 72 jo 105a6c + 1059fa: 6f outsl %ds:(%esi),(%dx) + 1059fb: 63 65 73 arpl %sp,0x73(%ebp) + 1059fe: 73 6f jae 105a6f + 105a00: 72 20 jb 105a22 + 105a02: 65 gs + 105a03: 72 72 jb 105a77 + 105a05: 6f outsl %ds:(%esi),(%dx) + 105a06: 72 00 jb 105a08 + 105a08: 41 inc %ecx + 105a09: 6c insb (%dx),%es:(%edi) + 105a0a: 69 67 6e 6d 65 6e 74 imul $0x746e656d,0x6e(%edi),%esp + 105a11: 20 63 68 and %ah,0x68(%ebx) + 105a14: 65 63 6b 00 arpl %bp,%gs:0x0(%ebx) + 105a18: 3f aas + 105a19: 3f aas + 105a1a: 00 49 52 add %cl,0x52(%ecx) + 105a1d: 51 push %ecx + 105a1e: 30 00 xor %al,(%eax) + 105a20: 49 dec %ecx + 105a21: 52 push %edx + 105a22: 51 push %ecx + 105a23: 31 00 xor %eax,(%eax) + 105a25: 49 dec %ecx + 105a26: 52 push %edx + 105a27: 51 push %ecx + 105a28: 32 00 xor (%eax),%al + 105a2a: 49 dec %ecx + 105a2b: 52 push %edx + 105a2c: 51 push %ecx + 105a2d: 33 00 xor (%eax),%eax + 105a2f: 49 dec %ecx + 105a30: 52 push %edx + 105a31: 51 push %ecx + 105a32: 34 00 xor $0x0,%al + 105a34: 49 dec %ecx + 105a35: 52 push %edx + 105a36: 51 push %ecx + 105a37: 35 00 49 52 51 xor $0x51524900,%eax + 105a3c: 36 00 49 52 add %cl,%ss:0x52(%ecx) + 105a40: 51 push %ecx + 105a41: 37 aaa + 105a42: 00 49 52 add %cl,0x52(%ecx) + 105a45: 51 push %ecx + 105a46: 38 00 cmp %al,(%eax) + 105a48: 49 dec %ecx + 105a49: 52 push %edx + 105a4a: 51 push %ecx + 105a4b: 39 00 cmp %eax,(%eax) + 105a4d: 49 dec %ecx + 105a4e: 52 push %edx + 105a4f: 51 push %ecx + 105a50: 31 30 xor %esi,(%eax) + 105a52: 00 49 52 add %cl,0x52(%ecx) + 105a55: 51 push %ecx + 105a56: 31 31 xor %esi,(%ecx) + 105a58: 00 49 52 add %cl,0x52(%ecx) + 105a5b: 51 push %ecx + 105a5c: 31 32 xor %esi,(%edx) + 105a5e: 00 49 52 add %cl,0x52(%ecx) + 105a61: 51 push %ecx + 105a62: 31 33 xor %esi,(%ebx) + 105a64: 00 49 52 add %cl,0x52(%ecx) + 105a67: 51 push %ecx + 105a68: 31 34 00 xor %esi,(%eax,%eax,1) + 105a6b: 49 dec %ecx + 105a6c: 52 push %edx + 105a6d: 51 push %ecx + 105a6e: 31 35 00 73 79 73 xor %esi,0x73797300 + 105a74: 63 61 6c arpl %sp,0x6c(%ecx) + 105a77: 6c insb (%dx),%es:(%edi) + 105a78: 00 0a add %cl,(%edx) + 105a7a: 0a 70 61 or 0x61(%eax),%dh + 105a7d: 6e outsb %ds:(%esi),(%dx) + 105a7e: 69 63 3a 20 45 78 63 imul $0x63784520,0x3a(%ebx),%esp + 105a85: 65 gs + 105a86: 70 74 jo 105afc + 105a88: 69 6f 6e 20 30 78 25 imul $0x25783020,0x6e(%edi),%ebp + 105a8f: 30 38 xor %bh,(%eax) + 105a91: 58 pop %eax + 105a92: 00 20 add %ah,(%eax) + 105a94: 28 25 73 29 00 75 sub %ah,0x75002973 + 105a9a: 73 65 jae 105b01 + 105a9c: 64 00 62 6c add %ah,%fs:0x6c(%edx) + 105aa0: 6f outsl %ds:(%esi),(%dx) + 105aa1: 63 6b 20 arpl %bp,0x20(%ebx) + 105aa4: 25 35 70 3a 20 and $0x203a7035,%eax + 105aa9: 25 36 75 20 62 and $0x62207536,%eax + 105aae: 79 74 jns 105b24 + 105ab0: 65 gs + 105ab1: 73 20 jae 105ad3 + 105ab3: 25 73 0a 00 66 and $0x66000a73,%eax + 105ab8: 72 65 jb 105b1f + 105aba: 65 00 69 6e add %ch,%gs:0x6e(%ecx) + 105abe: 69 74 00 45 6e 61 62 imul $0x6c62616e,0x45(%eax,%eax,1),%esi + 105ac5: 6c + 105ac6: 69 6e 67 20 68 61 72 imul $0x72616820,0x67(%esi),%ebp + 105acd: 64 fs + 105ace: 77 61 ja 105b31 + 105ad0: 72 65 jb 105b37 + 105ad2: 20 69 6e and %ch,0x6e(%ecx) + 105ad5: 74 65 je 105b3c + 105ad7: 72 72 jb 105b4b + 105ad9: 75 70 jne 105b4b + 105adb: 74 73 je 105b50 + 105add: 00 4d 6f add %cl,0x6f(%ebp) + 105ae0: 72 65 jb 105b47 + 105ae2: 20 77 6f and %dh,0x6f(%edi) + 105ae5: 72 6b jb 105b52 + 105ae7: 20 6e 65 and %ch,0x65(%esi) + 105aea: 65 gs + 105aeb: 64 fs + 105aec: 73 20 jae 105b0e + 105aee: 74 6f je 105b5f + 105af0: 20 62 65 and %ah,0x65(%edx) + 105af3: 20 64 6f 6e and %ah,0x6e(%edi,%ebp,2) + 105af7: 65 0a 00 or %gs:(%eax),%al + 105afa: 00 00 add %al,(%eax) + 105afc: 00 00 add %al,(%eax) + ... + +00105b00 : + 105b00: e8 58 10 00 08 00 00 00 56 00 00 00 f5 58 10 00 .X......V....X.. + 105b10: 05 00 00 00 56 00 00 00 05 59 10 00 07 00 00 00 ....V....Y...... + 105b20: 56 00 00 00 21 59 10 00 07 00 00 00 56 00 00 00 V...!Y......V... + 105b30: 33 59 10 00 08 00 00 00 ba 00 00 00 43 59 10 00 3Y..........CY.. + 105b40: 08 00 00 00 ba 00 00 00 50 59 10 00 04 00 00 00 ........PY...... + 105b50: ba 00 00 00 5f 59 10 00 08 00 00 00 ba 00 00 00 ...._Y.......... + 105b60: 79 59 10 00 07 00 00 00 1e 01 00 00 86 59 10 00 yY...........Y.. + 105b70: 0b 00 00 00 1e 01 00 00 a2 59 10 00 0b 00 00 00 .........Y...... + 105b80: 1e 01 00 00 ae 59 10 00 0b 00 00 00 1e 01 00 00 .....Y.......... + 105b90: c2 59 10 00 0b 00 00 00 1e 01 00 00 d2 59 10 00 .Y...........Y.. + 105ba0: 0b 00 00 00 1e 01 00 00 eb 59 10 00 0b 00 00 00 .........Y...... + 105bb0: 82 01 00 00 00 00 00 00 04 00 00 00 00 00 00 00 ................ + 105bc0: f6 59 10 00 08 00 00 00 82 01 00 00 08 5a 10 00 .Y...........Z.. + ... + 105bd8: 18 5a 10 00 00 00 00 00 00 00 00 00 18 5a 10 00 .Z...........Z.. + ... + 105bf0: 18 5a 10 00 00 00 00 00 00 00 00 00 18 5a 10 00 .Z...........Z.. + ... + 105c08: 18 5a 10 00 00 00 00 00 00 00 00 00 18 5a 10 00 .Z...........Z.. + ... + 105c20: 18 5a 10 00 00 00 00 00 00 00 00 00 18 5a 10 00 .Z...........Z.. + ... + 105c38: 18 5a 10 00 00 00 00 00 00 00 00 00 18 5a 10 00 .Z...........Z.. + ... + 105c50: 18 5a 10 00 00 00 00 00 00 00 00 00 18 5a 10 00 .Z...........Z.. + ... + 105c68: 18 5a 10 00 00 00 00 00 00 00 00 00 18 5a 10 00 .Z...........Z.. + ... + 105c80: 1b 5a 10 00 00 00 00 00 00 00 00 00 20 5a 10 00 .Z.......... Z.. + ... + 105c98: 25 5a 10 00 00 00 00 00 00 00 00 00 2a 5a 10 00 %Z..........*Z.. + ... + 105cb0: 2f 5a 10 00 00 00 00 00 00 00 00 00 34 5a 10 00 /Z..........4Z.. + ... + 105cc8: 39 5a 10 00 00 00 00 00 00 00 00 00 3e 5a 10 00 9Z..........>Z.. + ... + 105ce0: 43 5a 10 00 00 00 00 00 00 00 00 00 48 5a 10 00 CZ..........HZ.. + ... + 105cf8: 4d 5a 10 00 00 00 00 00 00 00 00 00 53 5a 10 00 MZ..........SZ.. + ... + 105d10: 59 5a 10 00 00 00 00 00 00 00 00 00 5f 5a 10 00 YZ.........._Z.. + ... + 105d28: 65 5a 10 00 00 00 00 00 00 00 00 00 6b 5a 10 00 eZ..........kZ.. + ... + 105d40: 71 5a 10 00 00 00 00 00 00 00 00 00 qZ.......... + +00105d4c : + 105d4c: 20 00 00 00 ... + +00105d50 : + 105d50: 28 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 (............... + 105d60: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d ================ + 105d70: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d ================ + 105d80: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 0a ===============. + ... + 105da0: 62 6c 6f 63 6b 73 3a 20 25 36 75 20 75 73 65 64 blocks: %6u used + 105db0: 2c 20 25 36 75 20 66 72 65 65 2c 20 25 36 75 20 , %6u free, %6u + 105dc0: 74 6f 74 61 6c 0a 00 00 00 00 00 00 00 00 00 00 total........... + ... + 105de0: 20 62 79 74 65 73 3a 20 25 36 75 20 75 73 65 64 bytes: %6u used + 105df0: 2c 20 25 36 75 20 66 72 65 65 2c 20 25 36 75 20 , %6u free, %6u + 105e00: 74 6f 74 61 6c 0a 00 00 00 00 00 00 00 00 00 00 total........... + ... + 105e20: 67 5f 68 65 61 70 5f 62 6f 74 3d 30 78 25 70 2c g_heap_bot=0x%p, + 105e30: 20 67 5f 6b 62 72 6b 3d 30 78 25 70 2c 20 67 5f g_kbrk=0x%p, g_ + 105e40: 68 65 61 70 5f 74 6f 70 3d 30 78 25 70 0a 00 00 heap_top=0x%p... + ... + 105e60: 2a 2a 2a 20 73 6f 6d 65 20 68 65 61 70 20 6d 65 *** some heap me + 105e70: 6d 6f 72 79 20 69 73 20 6e 6f 74 20 61 63 63 6f mory is not acco + 105e80: 75 6e 74 65 64 20 66 6f 72 0a 00 00 00 00 00 00 unted for....... + ... + 105ea0: 6b 65 72 6e 65 6c 20 68 65 61 70 20 69 73 20 63 kernel heap is c + 105eb0: 6f 72 72 75 70 74 20 69 6e 20 6d 61 6c 6c 6f 63 orrupt in malloc + 105ec0: 28 29 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ().............. + ... + 105ee0: 61 74 74 65 6d 70 74 20 74 6f 20 66 72 65 65 28 attempt to free( + 105ef0: 29 20 62 6c 6f 63 6b 20 61 74 20 30 78 25 70 20 ) block at 0x%p + 105f00: 77 69 74 68 20 62 61 64 20 6d 61 67 69 63 20 76 with bad magic v + 105f10: 61 6c 75 65 00 00 00 00 00 00 00 00 00 00 00 00 alue............ + 105f20: 6b 65 72 6e 65 6c 20 68 65 61 70 20 69 73 20 63 kernel heap is c + 105f30: 6f 72 72 75 70 74 20 69 6e 20 66 72 65 65 28 29 orrupt in free() + ... + 105f60: 61 74 74 65 6d 70 74 20 74 6f 20 66 72 65 65 28 attempt to free( + 105f70: 29 20 62 6c 6f 63 6b 20 61 74 20 30 78 25 70 20 ) block at 0x%p + 105f80: 74 68 61 74 20 69 73 20 6e 6f 74 20 69 6e 20 74 that is not in t + 105f90: 68 65 20 68 65 61 70 00 00 00 00 00 00 00 00 00 he heap......... + 105fa0: 55 6e 61 62 6c 65 20 74 6f 20 72 75 6e 20 74 65 Unable to run te + 105fb0: 73 74 68 65 61 70 20 2d 2d 20 6b 6d 61 6c 6c 6f stheap -- kmallo + 105fc0: 63 28 29 20 69 73 20 62 72 6f 6b 65 6e 2e 0a 00 c() is broken... + ... + 105fe0: 61 74 74 65 6d 70 74 20 74 6f 20 72 65 61 6c 6c attempt to reall + 105ff0: 6f 63 28 29 20 62 6c 6f 63 6b 20 61 74 20 30 78 oc() block at 0x + 106000: 25 70 20 77 69 74 68 20 62 61 64 20 6d 61 67 69 %p with bad magi + 106010: 63 20 76 61 6c 75 65 00 00 00 00 00 00 00 00 00 c value......... + 106020: 49 6e 73 74 61 6c 6c 69 6e 67 20 6b 65 79 62 6f Installing keybo + 106030: 61 72 64 20 69 6e 74 65 72 72 75 70 74 20 68 61 ard interrupt ha + 106040: 6e 64 6c 65 72 00 00 00 00 00 00 00 00 00 00 00 ndler........... + ... + 106060: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 + 106070: 20 20 20 20 20 20 20 20 20 5f 20 20 20 5f 20 20 _ _ + 106080: 5f 20 20 5f 20 20 5f 5f 5f 5f 20 20 5f 5f 5f 5f _ _ ____ ____ + 106090: 5f 20 20 5f 5f 5f 20 20 20 20 20 20 20 20 20 20 _ ___ + 1060a0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 + ... + 1060c0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 + 1060d0: 20 20 20 20 20 20 20 20 28 20 29 5f 28 20 29 28 ( )_( )( + 1060e0: 20 5c 2f 20 29 28 20 20 5f 20 5c 28 20 20 5f 20 \/ )( _ \( _ + 1060f0: 20 29 2f 20 5f 5f 29 20 20 20 20 20 20 20 20 20 )/ __) + 106100: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 + ... + 106120: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 + 106130: 20 20 20 20 20 20 20 20 20 29 20 5f 20 28 20 20 ) _ ( + 106140: 5c 20 20 2f 20 20 29 20 5f 20 3c 20 29 28 5f 29 \ / ) _ < )(_) + 106150: 28 20 5c 5f 5f 20 5c 20 20 20 20 20 20 20 20 20 ( \__ \ + 106160: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 + ... + 106180: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 + 106190: 20 20 20 20 20 20 20 20 28 5f 29 20 28 5f 29 20 (_) (_) + 1061a0: 28 5f 5f 29 20 28 5f 5f 5f 5f 2f 28 5f 5f 5f 5f (__) (____/(____ + 1061b0: 5f 29 28 5f 5f 5f 2f 20 20 20 20 20 20 20 20 20 _)(___/ + 1061c0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 + 1061d0: 0a 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 1061e0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 + 1061f0: 20 20 20 20 20 20 20 20 48 79 62 72 69 64 20 4f Hybrid O + 106200: 70 65 72 61 74 69 6e 67 20 53 79 73 74 65 6d 20 perating System + 106210: 28 48 79 62 4f 53 29 20 20 20 20 20 20 20 20 20 (HybOS) + 106220: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 + 106230: 0a 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 106240: 41 4c 54 20 2b 20 46 31 20 2d 20 46 38 20 66 6f ALT + F1 - F8 fo + 106250: 72 20 76 69 72 74 75 61 6c 20 74 65 72 6d 69 6e r virtual termin + 106260: 61 6c 73 0a 00 00 00 00 00 00 00 00 00 00 00 00 als............. + ... + 106280: 54 68 72 65 65 20 66 69 6e 67 65 72 20 73 61 6c Three finger sal + 106290: 75 74 65 20 74 6f 20 72 65 73 74 61 72 74 0a 00 ute to restart.. + 1062a0: 49 6e 69 74 69 61 6c 69 7a 69 6e 67 20 6d 65 6d Initializing mem + 1062b0: 6f 72 79 20 6d 61 6e 61 67 65 6d 65 6e 74 00 00 ory management.. + 1062c0: 00 00 00 00 74 61 73 6b 20 68 61 6e 64 6c 65 72 ....task handler + ... + +001062e0 : + 1062e0: 00 00 00 00 04 00 00 00 02 00 00 00 06 00 00 00 ................ + 1062f0: 01 00 00 00 05 00 00 00 03 00 00 00 07 00 00 00 ................ + 106300: 1b 5b 32 4a 00 6d 6f 6e 6f 00 5d 2e 2e 2e 2e 2e .[2J.mono.]..... + 106310: 2e 2e 2e 2e 2e 2e 2e 2e 2e 2e 2e 00 63 6f 6c 6f ............colo + 106320: 72 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 r............... + ... + 106340: 69 6e 69 74 3a 20 76 69 64 65 6f 20 25 35 73 20 init: video %5s + 106350: 65 6d 75 6c 61 74 69 6f 6e 2c 20 25 32 75 78 25 emulation, %2ux% + 106360: 32 75 2c 20 66 72 61 6d 65 62 75 66 66 65 72 20 2u, framebuffer + 106370: 61 74 20 30 78 25 31 58 20 00 00 00 0c 4d 10 00 at 0x%1X ....M.. + 106380: 40 4d 10 00 5c 4d 10 00 76 4d 10 00 98 4d 10 00 @M..\M..vM...M.. + 106390: b5 4d 10 00 dc 4e 10 00 dc 4e 10 00 dc 4e 10 00 .M...N...N...N.. + 1063a0: dc 4e 10 00 dc 4e 10 00 dc 4e 10 00 dc 4e 10 00 .N...N...N...N.. + 1063b0: dc 4e 10 00 dc 4e 10 00 dc 4e 10 00 63 4f 10 00 .N...N...N..cO.. + 1063c0: 7e 4f 10 00 dc 4e 10 00 dc 4e 10 00 dc 4e 10 00 ~O...N...N...N.. + 1063d0: dc 4e 10 00 7e 4f 10 00 dc 4e 10 00 dc 4e 10 00 .N..~O...N...N.. + 1063e0: dc 4e 10 00 dc 4e 10 00 b9 4d 10 00 8c 4f 10 00 .N...N...M...O.. + 1063f0: b9 4d 10 00 dc 4e 10 00 dc 4e 10 00 96 4f 10 00 .M...N...N...O.. + 106400: dc 4e 10 00 82 4f 10 00 dc 4e 10 00 dc 4e 10 00 .N...O...N...N.. + 106410: b9 4d 10 00 00 00 00 00 00 00 00 00 00 00 00 00 .M.............. + ... diff --git a/Dump/hybos/src/objects/kernel.sym b/Dump/hybos/src/objects/kernel.sym new file mode 100644 index 0000000..9626ccf --- /dev/null +++ b/Dump/hybos/src/objects/kernel.sym @@ -0,0 +1,656 @@ +00000001 a MULTIBOOT_PAGE_ALIGN +00000002 a MULTIBOOT_MEMORY_INFO +00000010 a LINEAR_DATA_SEL +00000018 a LINEAR_CODE_SEL +00010000 a MULTIBOOT_AOUT_KLUDGE +00010003 a MULTIBOOT_HEADER_FLAGS +00100000 A LS_Phys +00100000 A LS_Virt +00100000 T LS_Code /usr/home/reddawg/source/hybos/src/kernel/bootlog.c:10 +00100000 T _code /usr/home/reddawg/source/hybos/src/kernel/bootlog.c:10 +00100000 T code /usr/home/reddawg/source/hybos/src/kernel/bootlog.c:10 +00100000 T klog /usr/home/reddawg/source/hybos/src/kernel/bootlog.c:10 +0010011c T dump /usr/home/reddawg/source/hybos/src/kernel/debug.c:17 +001001cc T dump_regs /usr/home/reddawg/source/hybos/src/kernel/debug.c:44 +00100250 T keyDown /usr/home/reddawg/source/hybos/src/esh/esh.c:44 +00100258 T keyUp /usr/home/reddawg/source/hybos/src/esh/esh.c:58 +00100260 T initCommands /usr/home/reddawg/source/hybos/src/esh/esh.c:63 +00100434 T mapCommand /usr/home/reddawg/source/hybos/src/esh/esh.c:118 +001004b4 T isParam /usr/home/reddawg/source/hybos/src/esh/esh.c:162 +00100508 T mapParams /usr/home/reddawg/source/hybos/src/esh/esh.c:185 +0010064c T processCommand /usr/home/reddawg/source/hybos/src/esh/esh.c:264 +001007e4 t reboot /usr/home/reddawg/source/hybos/src/kernel/keyboard.c:58 +0010082c t _write_kb /usr/home/reddawg/source/hybos/src/kernel/keyboard.c:99 +00100874 T _translate_sc /usr/home/reddawg/source/hybos/src/kernel/keyboard.c:149 +00101298 T handle_meta_key /usr/home/reddawg/source/hybos/src/kernel/keyboard.c:364 +0010131c T keyboard_irq /usr/home/reddawg/source/hybos/src/kernel/keyboard.c:414 +0010157c T init_keyboard /usr/home/reddawg/source/hybos/src/kernel/keyboard.c:555 +00101640 T entry +00101657 t ds_ok +00101673 t sbat +00101697 t do_idt +001016c8 t mboot +001016e8 t all_ints +001016f7 T _getvect +001016f7 T getvect +00101731 T _setvect +00101731 T setvect +0010176b t isr0 +00101785 t isr0.1 +00101791 t isr1 +001017ab t isr1.1 +001017b7 t isr2 +001017d1 t isr2.1 +001017dd t isr3 +001017f7 t isr3.1 +00101803 t isr4 +0010181d t isr4.1 +00101829 t isr5 +00101843 t isr5.1 +0010184f t isr6 +00101869 t isr6.1 +00101875 t isr7 +0010188f t isr7.1 +0010189b t isr8 +001018b5 t isr8.1 +001018c1 t isr9 +001018db t isr9.1 +001018e7 t isr0Ah +00101901 t isr0Ah.1 +0010190d t isr0Bh +00101927 t isr0Bh.1 +00101933 t isr0Ch +0010194d t isr0Ch.1 +00101959 t isr0Dh +00101973 t isr0Dh.1 +0010197f t isr0Eh +00101999 t isr0Eh.1 +001019a5 t isr0Fh +001019bf t isr0Fh.1 +001019cb t isr10h +001019e5 t isr10h.1 +001019f1 t isr11h +00101a0b t isr11h.1 +00101a17 t isr12h +00101a31 t isr12h.1 +00101a3d t isr13h +00101a57 t isr13h.1 +00101a63 t isr14h +00101a7d t isr14h.1 +00101a89 t isr15h +00101aa3 t isr15h.1 +00101aaf t isr16h +00101ac9 t isr16h.1 +00101ad5 t isr17h +00101aef t isr17h.1 +00101afb t isr18h +00101b15 t isr18h.1 +00101b21 t isr19h +00101b3b t isr19h.1 +00101b47 t isr1Ah +00101b61 t isr1Ah.1 +00101b6d t isr1Bh +00101b87 t isr1Bh.1 +00101b93 t isr1Ch +00101bad t isr1Ch.1 +00101bb9 t isr1Dh +00101bd3 t isr1Dh.1 +00101bdf t isr1Eh +00101bf9 t isr1Eh.1 +00101c05 t isr1Fh +00101c1f t isr1Fh.1 +00101c2b t isr20h +00101c45 t isr20h.1 +00101c51 t isr21h +00101c6b t isr21h.1 +00101c77 t isr22h +00101c91 t isr22h.1 +00101c9d t isr23h +00101cb7 t isr23h.1 +00101cc3 t isr24h +00101cdd t isr24h.1 +00101ce9 t isr25h +00101d03 t isr25h.1 +00101d0f t isr26h +00101d29 t isr26h.1 +00101d35 t isr27h +00101d4f t isr27h.1 +00101d5b t isr28h +00101d75 t isr28h.1 +00101d81 t isr29h +00101d9b t isr29h.1 +00101da7 t isr2Ah +00101dc1 t isr2Ah.1 +00101dcd t isr2Bh +00101de7 t isr2Bh.1 +00101df3 t isr2Ch +00101e0d t isr2Ch.1 +00101e19 t isr2Dh +00101e33 t isr2Dh.1 +00101e3f t isr2Eh +00101e59 t isr2Eh.1 +00101e65 t isr2Fh +00101e7f t isr2Fh.1 +00101e8b t isr30h +00101ea5 t isr30h.1 +00101eb1 t isr49 +00101ecb t isr49.1 +00101ed7 t isr50 +00101ef1 t isr50.1 +00101efd t isr51 +00101f17 t isr51.1 +00101f23 t isr52 +00101f3d t isr52.1 +00101f49 t isr53 +00101f63 t isr53.1 +00101f6f t isr54 +00101f89 t isr54.1 +00101f95 t isr55 +00101faf t isr55.1 +00101fbb t isr56 +00101fd5 t isr56.1 +00101fe1 t isr57 +00101ffb t isr57.1 +00102007 t isr58 +00102021 t isr58.1 +0010202d t isr59 +00102047 t isr59.1 +00102053 t isr60 +0010206d t isr60.1 +00102079 t isr61 +00102093 t isr61.1 +0010209f t isr62 +001020b9 t isr62.1 +001020c5 t isr63 +001020df t isr63.1 +001020eb t isr64 +00102105 t isr64.1 +00102111 t isr65 +0010212b t isr65.1 +00102137 t isr66 +00102151 t isr66.1 +0010215d t isr67 +00102177 t isr67.1 +00102183 t isr68 +0010219d t isr68.1 +001021a9 t isr69 +001021c3 t isr69.1 +001021cf t isr70 +001021e9 t isr70.1 +001021f5 t isr71 +0010220f t isr71.1 +0010221b t isr72 +00102235 t isr72.1 +00102241 t isr73 +0010225b t isr73.1 +00102267 t isr74 +00102281 t isr74.1 +0010228d t isr75 +001022a7 t isr75.1 +001022b3 t isr76 +001022cd t isr76.1 +001022d9 t isr77 +001022f3 t isr77.1 +001022ff t isr78 +00102319 t isr78.1 +00102325 t isr79 +0010233f t isr79.1 +0010234b t isr80 +00102365 t isr80.1 +00102371 t isr81 +0010238b t isr81.1 +00102397 t isr82 +001023b1 t isr82.1 +001023bd t isr83 +001023d7 t isr83.1 +001023e3 t isr84 +001023fd t isr84.1 +00102409 t isr85 +00102423 t isr85.1 +0010242f t isr86 +00102449 t isr86.1 +00102455 t isr87 +0010246f t isr87.1 +0010247b t isr88 +00102495 t isr88.1 +001024a1 t isr89 +001024bb t isr89.1 +001024c7 t isr90 +001024e1 t isr90.1 +001024ed t isr91 +00102507 t isr91.1 +00102513 t isr92 +0010252d t isr92.1 +00102539 t isr93 +00102553 t isr93.1 +0010255f t isr94 +00102579 t isr94.1 +00102585 t isr95 +0010259f t isr95.1 +001025ab t isr96 +001025c5 t isr96.1 +001025d1 t isr97 +001025eb t isr97.1 +001025f7 t isr98 +00102611 t isr98.1 +0010261d t isr99 +00102637 t isr99.1 +00102643 t isr100 +0010265d t isr100.1 +00102669 t isr101 +00102683 t isr101.1 +0010268f t isr102 +001026a9 t isr102.1 +001026b5 t isr103 +001026cf t isr103.1 +001026db t isr104 +001026f5 t isr104.1 +00102701 t isr105 +0010271b t isr105.1 +00102727 t isr106 +00102741 t isr106.1 +0010274d t isr107 +00102767 t isr107.1 +00102773 t isr108 +0010278d t isr108.1 +00102799 t isr109 +001027b3 t isr109.1 +001027bf t isr110 +001027d9 t isr110.1 +001027e5 t isr111 +001027ff t isr111.1 +0010280b t isr112 +00102825 t isr112.1 +00102831 t isr113 +0010284b t isr113.1 +00102857 t isr114 +00102871 t isr114.1 +0010287d t isr115 +00102897 t isr115.1 +001028a3 t isr116 +001028bd t isr116.1 +001028c9 t isr117 +001028e3 t isr117.1 +001028ef t isr118 +00102909 t isr118.1 +00102915 t isr119 +0010292f t isr119.1 +0010293b t isr120 +00102955 t isr120.1 +00102961 t isr121 +0010297b t isr121.1 +00102987 t isr122 +001029a1 t isr122.1 +001029ad t isr123 +001029c7 t isr123.1 +001029d3 t isr124 +001029ed t isr124.1 +001029f9 t isr125 +00102a13 t isr125.1 +00102a1f t isr126 +00102a39 t isr126.1 +00102a45 t isr127 +00102a5f t isr127.1 +00102a6b t isr128 +00102a85 t isr128.1 +00102a91 t isr129 +00102aab t isr129.1 +00102ab7 t isr130 +00102ad1 t isr130.1 +00102add t isr131 +00102af7 t isr131.1 +00102b03 t isr132 +00102b1d t isr132.1 +00102b29 t isr133 +00102b43 t isr133.1 +00102b4f t isr134 +00102b69 t isr134.1 +00102b75 t isr135 +00102b8f t isr135.1 +00102b9b t isr136 +00102bb5 t isr136.1 +00102bc1 t isr137 +00102bdb t isr137.1 +00102be7 t isr138 +00102c01 t isr138.1 +00102c0d t isr139 +00102c27 t isr139.1 +00102c33 t isr140 +00102c4d t isr140.1 +00102c59 t isr141 +00102c73 t isr141.1 +00102c7f t isr142 +00102c99 t isr142.1 +00102ca5 t isr143 +00102cbf t isr143.1 +00102ccb t isr144 +00102ce5 t isr144.1 +00102cf1 t isr145 +00102d0b t isr145.1 +00102d17 t isr146 +00102d31 t isr146.1 +00102d3d t isr147 +00102d57 t isr147.1 +00102d63 t isr148 +00102d7d t isr148.1 +00102d89 t isr149 +00102da3 t isr149.1 +00102daf t isr150 +00102dc9 t isr150.1 +00102dd5 t isr151 +00102def t isr151.1 +00102dfb t isr152 +00102e15 t isr152.1 +00102e21 t isr153 +00102e3b t isr153.1 +00102e47 t isr154 +00102e61 t isr154.1 +00102e6d t isr155 +00102e87 t isr155.1 +00102e93 t isr156 +00102ead t isr156.1 +00102eb9 t isr157 +00102ed3 t isr157.1 +00102edf t isr158 +00102ef9 t isr158.1 +00102f05 t isr159 +00102f1f t isr159.1 +00102f2b t isr160 +00102f45 t isr160.1 +00102f51 t isr161 +00102f6b t isr161.1 +00102f77 t isr162 +00102f91 t isr162.1 +00102f9d t isr163 +00102fb7 t isr163.1 +00102fc3 t isr164 +00102fdd t isr164.1 +00102fe9 t isr165 +00103003 t isr165.1 +0010300f t isr166 +00103029 t isr166.1 +00103035 t isr167 +0010304f t isr167.1 +0010305b t isr168 +00103075 t isr168.1 +00103081 t isr169 +0010309b t isr169.1 +001030a7 t isr170 +001030c1 t isr170.1 +001030cd t isr171 +001030e7 t isr171.1 +001030f3 t isr172 +0010310d t isr172.1 +00103119 t isr173 +00103133 t isr173.1 +0010313f t isr174 +00103159 t isr174.1 +00103165 t isr175 +0010317f t isr175.1 +0010318b t isr176 +001031a5 t isr176.1 +001031b1 t isr177 +001031cb t isr177.1 +001031d7 t isr178 +001031f1 t isr178.1 +001031fd t isr179 +00103217 t isr179.1 +00103223 t isr180 +0010323d t isr180.1 +00103249 t isr181 +00103263 t isr181.1 +0010326f t isr182 +00103289 t isr182.1 +00103295 t isr183 +001032af t isr183.1 +001032bb t isr184 +001032d5 t isr184.1 +001032e1 t isr185 +001032fb t isr185.1 +00103307 t isr186 +00103321 t isr186.1 +0010332d t isr187 +00103347 t isr187.1 +00103353 t isr188 +0010336d t isr188.1 +00103379 t isr189 +00103393 t isr189.1 +0010339f t isr190 +001033b9 t isr190.1 +001033c5 t isr191 +001033df t isr191.1 +001033eb t isr192 +00103405 t isr192.1 +00103411 t isr193 +0010342b t isr193.1 +00103437 t isr194 +00103451 t isr194.1 +0010345d t isr195 +00103477 t isr195.1 +00103483 t isr196 +0010349d t isr196.1 +001034a9 t isr197 +001034c3 t isr197.1 +001034cf t isr198 +001034e9 t isr198.1 +001034f5 t isr199 +0010350f t isr199.1 +0010351b t isr200 +00103535 t isr200.1 +00103541 t isr201 +0010355b t isr201.1 +00103567 t isr202 +00103581 t isr202.1 +0010358d t isr203 +001035a7 t isr203.1 +001035b3 t isr204 +001035cd t isr204.1 +001035d9 t isr205 +001035f3 t isr205.1 +001035ff t isr206 +00103619 t isr206.1 +00103625 t isr207 +0010363f t isr207.1 +0010364b t isr208 +00103665 t isr208.1 +00103671 t isr209 +0010368b t isr209.1 +00103697 t isr210 +001036b1 t isr210.1 +001036bd t isr211 +001036d7 t isr211.1 +001036e3 t isr212 +001036fd t isr212.1 +00103709 t isr213 +00103723 t isr213.1 +0010372f t isr214 +00103749 t isr214.1 +00103755 t isr215 +0010376f t isr215.1 +0010377b t isr216 +00103795 t isr216.1 +001037a1 t isr217 +001037bb t isr217.1 +001037c7 t isr218 +001037e1 t isr218.1 +001037ed t isr219 +00103807 t isr219.1 +00103813 t isr220 +0010382d t isr220.1 +00103839 t isr221 +00103853 t isr221.1 +0010385f t isr222 +00103879 t isr222.1 +00103885 t isr223 +0010389f t isr223.1 +001038ab t isr224 +001038c5 t isr224.1 +001038d1 t isr225 +001038eb t isr225.1 +001038f7 t isr226 +00103911 t isr226.1 +0010391d t isr227 +00103937 t isr227.1 +00103943 t isr228 +0010395d t isr228.1 +00103969 t isr229 +00103983 t isr229.1 +0010398f t isr230 +001039a9 t isr230.1 +001039b5 t isr231 +001039cf t isr231.1 +001039db t isr232 +001039f5 t isr232.1 +00103a01 t isr233 +00103a1b t isr233.1 +00103a27 t isr234 +00103a41 t isr234.1 +00103a4d t isr235 +00103a67 t isr235.1 +00103a73 t isr236 +00103a8d t isr236.1 +00103a99 t isr237 +00103ab3 t isr237.1 +00103abf t isr238 +00103ad9 t isr238.1 +00103ae5 t isr239 +00103aff t isr239.1 +00103b0b t isr240 +00103b25 t isr240.1 +00103b31 t isr241 +00103b4b t isr241.1 +00103b57 t isr242 +00103b71 t isr242.1 +00103b7d t isr243 +00103b97 t isr243.1 +00103ba3 t isr244 +00103bbd t isr244.1 +00103bc9 t isr245 +00103be3 t isr245.1 +00103bef t isr246 +00103c09 t isr246.1 +00103c15 t isr247 +00103c2f t isr247.1 +00103c3b t isr248 +00103c55 t isr248.1 +00103c61 t isr249 +00103c7b t isr249.1 +00103c87 t isr250 +00103ca1 t isr250.1 +00103cad t isr251 +00103cc7 t isr251.1 +00103cd3 t isr252 +00103ced t isr252.1 +00103cf9 t isr253 +00103d13 t isr253.1 +00103d1f t isr254 +00103d39 t isr254.1 +00103d45 t isr255 +00103d5f t isr255.1 +00103d6c t kprintf_help /usr/home/reddawg/source/hybos/src/kernel/main.c:80 +00103d80 T kprintf /usr/home/reddawg/source/hybos/src/kernel/main.c:104 +00103d9c T printk /usr/home/reddawg/source/hybos/src/kernel/main.c:117 +00103db8 T panic /usr/home/reddawg/source/hybos/src/kernel/main.c:134 +00103e04 T fault /usr/home/reddawg/source/hybos/src/kernel/main.c:156 +00103e90 t init_8259s /usr/home/reddawg/source/hybos/src/kernel/main.c:248 +00103f14 t dump_heap /usr/home/reddawg/source/hybos/src/kernel/main.c:303 +0010401c T dumpheapk /usr/home/reddawg/source/hybos/src/kernel/main.c:339 +00104028 t kbrk /usr/home/reddawg/source/hybos/src/kernel/main.c:373 +00104080 T kmalloc /usr/home/reddawg/source/hybos/src/kernel/main.c:410 +001041b0 T kfree /usr/home/reddawg/source/hybos/src/kernel/main.c:518 +00104288 T testheap /usr/home/reddawg/source/hybos/src/kernel/main.c:585 +0010429c T krealloc /usr/home/reddawg/source/hybos/src/kernel/main.c:603 +00104324 T main /usr/home/reddawg/source/hybos/src/kernel/main.c:655 +00104424 T _mm_init /usr/home/reddawg/source/hybos/src/mm/memory.c:23 +0010445c T _mm_physical_init /usr/home/reddawg/source/hybos/src/mm/memory.c:31 +001044a4 T _mm_physical_alloc /usr/home/reddawg/source/hybos/src/mm/memory.c:50 +001044f4 T _mm_physical_free /usr/home/reddawg/source/hybos/src/mm/memory.c:75 +00104518 T _mm_virtual_init /usr/home/reddawg/source/hybos/src/mm/memory.c:80 +00104520 T _mm_page_copy_byte /usr/home/reddawg/source/hybos/src/mm/memory.c:84 +00104538 T _mm_page_copy_word /usr/home/reddawg/source/hybos/src/mm/memory.c:96 +00104550 T _mm_page_copy_dword /usr/home/reddawg/source/hybos/src/mm/memory.c:108 +00104568 T schedule /usr/home/reddawg/source/hybos/src/kernel/sched.c:91 +001045ac T init_tasks /usr/home/reddawg/source/hybos/src/kernel/sched.c:128 +001045f4 t write /usr/home/reddawg/source/hybos/src/kernel/tasks.c:31 +00104634 t yield /usr/home/reddawg/source/hybos/src/kernel/tasks.c:47 +00104640 t wait /usr/home/reddawg/source/hybos/src/kernel/tasks.c:57 +00104650 T task1 /usr/home/reddawg/source/hybos/src/kernel/tasks.c:69 +00104664 T task2 /usr/home/reddawg/source/hybos/src/kernel/tasks.c:88 +00104678 T task3 /usr/home/reddawg/source/hybos/src/kernel/tasks.c:106 +0010468c T task4 /usr/home/reddawg/source/hybos/src/kernel/tasks.c:124 +001046a0 T blink /usr/home/reddawg/source/hybos/src/kernel/video.c:51 +001046ac T get_current_vc /usr/home/reddawg/source/hybos/src/kernel/video.c:60 +001046b8 t scroll /usr/home/reddawg/source/hybos/src/kernel/video.c:69 +0010473c t set_attrib /usr/home/reddawg/source/hybos/src/kernel/video.c:101 +00104798 t move_csr /usr/home/reddawg/source/hybos/src/kernel/video.c:132 +00104804 T select_vc /usr/home/reddawg/source/hybos/src/kernel/video.c:149 +00104890 T putch_help /usr/home/reddawg/source/hybos/src/kernel/video.c:171 +00104b00 T putch /usr/home/reddawg/source/hybos/src/kernel/video.c:365 +00104b18 T init_video /usr/home/reddawg/source/hybos/src/kernel/video.c:377 +00104cc8 T disable /usr/home/reddawg/source/hybos/lib/x86/disable.c:4 +00104cd0 T do_printf /usr/home/reddawg/source/hybos/lib/stdio/doprintf.c:62 +0010500c T enable /usr/home/reddawg/source/hybos/lib/x86/enable.c:4 +00105014 T inportb /usr/home/reddawg/source/hybos/lib/x86/inportb.c:4 +00105020 T longjmp /usr/home/reddawg/source/hybos/lib/setjmp/longjmp.c:42 +0010505c T memcpy /usr/home/reddawg/source/hybos/lib/mem/memcpy.c:2 +00105088 T memsetw /usr/home/reddawg/source/hybos/lib/mem/memsetw.c:3 +001050b4 T outportb /usr/home/reddawg/source/hybos/lib/x86/outportb.c:4 +001050c0 T printf_help /usr/home/reddawg/source/hybos/lib/stdio/printf.c:14 +001050d4 T printf /usr/home/reddawg/source/hybos/lib/stdio/printf.c:25 +001050f0 T strcmp /usr/home/reddawg/source/hybos/lib/string/strcmp.c:2 +0010513c T strcpy /usr/home/reddawg/source/hybos/lib/string/strcpy.c:3 +00105158 T strlen /usr/home/reddawg/source/hybos/lib/string/strlen.c:5 +00105174 T strncpy /usr/home/reddawg/source/hybos/lib/string/strncpy.c:4 +00105b00 t ex.0 +00105d4c t irq0_int.1 +00105d50 t irq8_int.2 +001062e0 t ansi_to_vga.0 +00107000 D LS_Data +00107000 D _data +00107000 D data +00107000 d ds_magic +00107004 d gdt +00107024 d gdt_end +00107024 d gdt_ptr +0010702a d idt +0010782a d idt_end +0010782a d idt_ptr +00107840 D _ctype +00108000 B LS_Bss +00108000 B _bss +00108000 B bss +00108000 b altk.0 +00108020 b buffers.1 +00108320 b rawkey +00108340 b keys +00108540 b numkeysbuffer +00108560 b szInBuf +001085a0 b makebreak +001095a4 b stack +001095c0 b heap.3 +001836e0 b g_heap_bot +001836e4 b g_kbrk +001836e8 b g_heap_top +00183700 b current.0 +00183704 b entry.2 +00183704 b stacks.1 +00183720 b _tasks +00183a20 b _num_vcs +00183a24 b _curr_vc +00183a28 b _vga_fb_adr +00183a2c b _crtc_io_adr +00183a30 b _vc_width +00183a34 b _vc_height +00183a40 B eshCommands +00194280 B ts +00197280 B bufferIterator +00197284 B buffer +001972a0 B td +0019a2a0 B _curr_task +0019a2c0 B curr_vtty +0019a2e0 B _vc +0019b000 A _end +0019b000 A end +1badb002 a MULTIBOOT_HEADER_MAGIC +3544da2a a DS_MAGIC +e4514ffb a MULTIBOOT_CHECKSUM diff --git a/Dump/linecount.c b/Dump/linecount.c new file mode 100644 index 0000000..ebb844c --- /dev/null +++ b/Dump/linecount.c @@ -0,0 +1,46 @@ +#include +#include +#include +#include +#include + +int main(int argc, char *argv[]) { + int fd = 0x0; + int curcnt = 0x0; + int maxcnt = 0x0; + char c; + + if (argc < 2) { + printf("Error: No file specified\n"); + exit(0x0); + } + + fd = open(argv[1],O_RDONLY); + + if (fd == 0x0) { + printf("Error: Not a valid file: [%s]\n",argv[1]); + exit(0x0); + } + + curcnt = 0; + maxcnt = 0; + printf("File opened...\n"); + + while (read(fd,&c,1) != 0x0) { + if (c == 0x0C) { + printf("linefeed found!\n\tcurcnt = %i\n\tmaxcnt = %i\n", curcnt, maxcnt); + if (curcnt > maxcnt) + maxcnt = curcnt; + curcnt = 0; + } + else if (c == 0x0D) { + read(fd,&c,1); + if (c = 0x0A) + curcnt++; + printf("DDD"); + } + } + close(fd); + printf("Max line count is: %i\n", maxcnt); + return(0x0); + } diff --git a/Dump/linecount2.c b/Dump/linecount2.c new file mode 100644 index 0000000..8b17e94 --- /dev/null +++ b/Dump/linecount2.c @@ -0,0 +1,39 @@ +#include +#include +#include +#include +#include + +int main(int argc, char *argv[]) { + int fd = 0x0; + int curcnt = 0x1; + int maxcnt = 0x0; + char c; + + if (argc < 2) { + printf("Error: No file specified\n"); + exit(0x0); + } + + fd = open(argv[1],O_RDONLY); + + if (fd == 0x0) { + printf("Error: Not a valid file: [%s]\n",argv[1]); + exit(0x0); + } + + printf("File opened...\n"); + + while (read(fd,&c,1) != 0x0) { + if (c == 0x0C) { + if (curcnt > maxcnt) + maxcnt = curcnt; + curcnt = 1; + } + else if (c == 0x0A) + curcnt++; + } + close(fd); + printf("Max line count is: %i\n", maxcnt); + return(0x0); + } diff --git a/Dump/linecount3.c b/Dump/linecount3.c new file mode 100644 index 0000000..8b17e94 --- /dev/null +++ b/Dump/linecount3.c @@ -0,0 +1,39 @@ +#include +#include +#include +#include +#include + +int main(int argc, char *argv[]) { + int fd = 0x0; + int curcnt = 0x1; + int maxcnt = 0x0; + char c; + + if (argc < 2) { + printf("Error: No file specified\n"); + exit(0x0); + } + + fd = open(argv[1],O_RDONLY); + + if (fd == 0x0) { + printf("Error: Not a valid file: [%s]\n",argv[1]); + exit(0x0); + } + + printf("File opened...\n"); + + while (read(fd,&c,1) != 0x0) { + if (c == 0x0C) { + if (curcnt > maxcnt) + maxcnt = curcnt; + curcnt = 1; + } + else if (c == 0x0A) + curcnt++; + } + close(fd); + printf("Max line count is: %i\n", maxcnt); + return(0x0); + } diff --git a/Dump/ubix.elf b/Dump/ubix.elf new file mode 100644 index 0000000..0570158 --- /dev/null +++ b/Dump/ubix.elf Binary files differ diff --git a/Dump/ubix.flp b/Dump/ubix.flp new file mode 100644 index 0000000..750e409 --- /dev/null +++ b/Dump/ubix.flp Binary files differ diff --git a/Dump/ubix.img b/Dump/ubix.img new file mode 100644 index 0000000..3ca7f58 --- /dev/null +++ b/Dump/ubix.img Binary files differ diff --git a/Dump/ubthread.c b/Dump/ubthread.c new file mode 100644 index 0000000..d0ab762 --- /dev/null +++ b/Dump/ubthread.c @@ -0,0 +1,137 @@ +/***************************************************************************************** + Copyright (c) 2002 The UbixOS Project + All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, are +permitted provided that the following conditions are met: + +Redistributions of source code must retain the above copyright notice, this list of +conditions, the following disclaimer and the list of authors. Redistributions in binary +form must reproduce the above copyright notice, this list of conditions, the following +disclaimer and the list of authors in the documentation and/or other materials provided +with the distribution. Neither the name of the UbixOS Project nor the names of its +contributors may be used to endorse or promote products derived from this software +without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY +EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL +THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT +OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR +TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + $Log: ubthread.c,v $ + Revision 1.7 2004/04/13 16:16:44 reddawg + Changed our copyright, it is all now under a BSD-Style license + + + + $Id: ubthread.c,v 1.7 2004/04/13 16:16:44 reddawg Exp $ + +*****************************************************************************************/ + +#include +#include +#include +#include +#include +#include +#include +#include + +struct ubthread_cond_list *conds = 0x0; +struct ubthread_mutex_list *mutex = 0x0; + +kTask_t *ubthread_self() { + return(_current); + } + +int ubthread_cond_init(ubthread_cond_t *cond,const uInt32 attr) { + ubthread_cond_t ubcond = kmalloc(sizeof(struct ubthread_cond),sysID); + ubcond->id = (int)cond; + ubcond->locked = UNLOCKED; + *cond = ubcond; + return(0x0); + } + +int ubthread_mutex_init(ubthread_mutex_t *mutex,const uInt32 attr) { + ubthread_mutex_t ubmutex = kmalloc(sizeof(struct ubthread_mutex),sysID); + ubmutex->id = (int)mutex; + ubmutex->locked = UNLOCKED; + *mutex = ubmutex; + return(0x0); + } + +int ubthread_cond_destroy(ubthread_cond_t *cond) { + kfree(*cond); + *cond = 0x0; + return(0x0); + } + +int ubthread_mutex_destroy(ubthread_mutex_t *mutex) { + kfree(*mutex); + *mutex = 0x0; + return(0x0); + } + +int ubthread_create(kTask_t **thread,const uInt32 *attr,void *start_routine, void *arg) { + *thread = (void *)execThread((void *)start_routine,(uInt32)(kmalloc(0x4000,sysID)+0x4000),arg,"TCP/IP Thread"); + return(0x0); + } + +int ubthread_mutex_lock(ubthread_mutex_t *mutex) { + ubthread_mutex_t ubmutex = *mutex; + if (ubmutex->locked == LOCKED) { + kprintf("Mutex Already Lock By %x Trying To Be Relocked By %x\n",ubmutex->pid,_current->id); + } + while (ubmutex->locked == LOCKED); + ubmutex->locked = LOCKED; + ubmutex->pid = _current->id; + return(0x0); + } + +int ubthread_mutex_unlock(ubthread_mutex_t *mutex) { + ubthread_mutex_t ubmutex = *mutex; + if (ubmutex->pid == _current->id) { + ubmutex->locked = UNLOCKED; + return(0x0); + } + else { + kprintf("Trying To Unlock Mutex From No Locking Thread\n"); + ubmutex->locked = UNLOCKED; + return(-1); + } + } + +int ubthread_cond_timedwait(ubthread_cond_t *cond, ubthread_mutex_t *mutex, const struct timespec *abstime) { + ubthread_cond_t ubcond = *cond; + ubthread_mutex_t ubmutex = *mutex; + uInt32 enterTime = systemVitals->sysUptime+20; + while (enterTime > systemVitals->sysUptime) { + if (ubcond->locked == UNLOCKED) break; + schedYield(); + } + ubmutex->locked = UNLOCKED; + return(0x0); + } + +int ubthread_cond_wait(ubthread_cond_t *cond, ubthread_mutex_t *mutex) { + ubthread_cond_t ubcond = *cond; + ubthread_mutex_t ubmutex = *mutex; + while (ubcond->locked == 0x0); + ubmutex->locked = UNLOCKED; + return(0x0); + } + +int ubthread_cond_signal(ubthread_cond_t *cond) { + ubthread_cond_t ubcond = *cond; + ubcond->locked = UNLOCKED; + return(0x0); + } + +/*** + END + ***/ diff --git a/bin/sh/mkbuiltins b/bin/sh/mkbuiltins old mode 100755 new mode 100644 diff --git a/bin/sh/tests/functional_test.sh b/bin/sh/tests/functional_test.sh old mode 100755 new mode 100644 diff --git a/contrib/jemalloc/FREEBSD-upgrade b/contrib/jemalloc/FREEBSD-upgrade old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/bin/cat/t_cat.sh b/contrib/netbsd-tests/bin/cat/t_cat.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/bin/cp/t_cp.sh b/contrib/netbsd-tests/bin/cp/t_cp.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/bin/dd/t_dd.sh b/contrib/netbsd-tests/bin/dd/t_dd.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/bin/df/t_df.sh b/contrib/netbsd-tests/bin/df/t_df.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/bin/expr/t_expr.sh b/contrib/netbsd-tests/bin/expr/t_expr.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/bin/pax/t_pax.sh b/contrib/netbsd-tests/bin/pax/t_pax.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/bin/ps/t_ps.sh b/contrib/netbsd-tests/bin/ps/t_ps.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/scoped_command b/contrib/netbsd-tests/bin/sh/dotcmd/scoped_command old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/bin/sh/dotcmd/t_dotcmd.sh b/contrib/netbsd-tests/bin/sh/dotcmd/t_dotcmd.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/bin/sh/t_arith.sh b/contrib/netbsd-tests/bin/sh/t_arith.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/bin/sh/t_cmdsub.sh b/contrib/netbsd-tests/bin/sh/t_cmdsub.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/bin/sh/t_evaltested.sh b/contrib/netbsd-tests/bin/sh/t_evaltested.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/bin/sh/t_exit.sh b/contrib/netbsd-tests/bin/sh/t_exit.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/bin/sh/t_expand.sh b/contrib/netbsd-tests/bin/sh/t_expand.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/bin/sh/t_fsplit.sh b/contrib/netbsd-tests/bin/sh/t_fsplit.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/bin/sh/t_here.sh b/contrib/netbsd-tests/bin/sh/t_here.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/bin/sh/t_option.sh b/contrib/netbsd-tests/bin/sh/t_option.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/bin/sh/t_redir.sh b/contrib/netbsd-tests/bin/sh/t_redir.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/bin/sh/t_redircloexec.sh b/contrib/netbsd-tests/bin/sh/t_redircloexec.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/bin/sh/t_set_e.sh b/contrib/netbsd-tests/bin/sh/t_set_e.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/bin/sh/t_shift.sh b/contrib/netbsd-tests/bin/sh/t_shift.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/bin/sh/t_ulimit.sh b/contrib/netbsd-tests/bin/sh/t_ulimit.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/bin/sh/t_varquote.sh b/contrib/netbsd-tests/bin/sh/t_varquote.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/bin/sh/t_varval.sh b/contrib/netbsd-tests/bin/sh/t_varval.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/bin/sh/t_wait.sh b/contrib/netbsd-tests/bin/sh/t_wait.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/bin/sleep/t_sleep.sh b/contrib/netbsd-tests/bin/sleep/t_sleep.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/bin/tar/t_tar.sh b/contrib/netbsd-tests/bin/tar/t_tar.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/crypto/libcrypto/t_certs.sh b/contrib/netbsd-tests/crypto/libcrypto/t_certs.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/crypto/libcrypto/t_ciphers.sh b/contrib/netbsd-tests/crypto/libcrypto/t_ciphers.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/crypto/libcrypto/t_hashes.sh b/contrib/netbsd-tests/crypto/libcrypto/t_hashes.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/crypto/libcrypto/t_libcrypto.sh b/contrib/netbsd-tests/crypto/libcrypto/t_libcrypto.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/crypto/libcrypto/t_pubkey.sh b/contrib/netbsd-tests/crypto/libcrypto/t_pubkey.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/crypto/opencrypto/t_opencrypto.sh b/contrib/netbsd-tests/crypto/opencrypto/t_opencrypto.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/dev/audio/t_pad.sh b/contrib/netbsd-tests/dev/audio/t_pad.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/dev/cgd/t_cgd.sh b/contrib/netbsd-tests/dev/cgd/t_cgd.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/dev/clock_subr/clock_subr_test_data_gen.sh b/contrib/netbsd-tests/dev/clock_subr/clock_subr_test_data_gen.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/dev/dm/t_dm.sh b/contrib/netbsd-tests/dev/dm/t_dm.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/dev/fss/t_fss.sh b/contrib/netbsd-tests/dev/fss/t_fss.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/dev/md/t_md.sh b/contrib/netbsd-tests/dev/md/t_md.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/dev/raidframe/t_raid.sh b/contrib/netbsd-tests/dev/raidframe/t_raid.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/dev/sysmon/t_swsensor.sh b/contrib/netbsd-tests/dev/sysmon/t_swsensor.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/fs/cd9660/t_high_ino_big_file.sh b/contrib/netbsd-tests/fs/cd9660/t_high_ino_big_file.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/fs/ffs/ffs_common.sh b/contrib/netbsd-tests/fs/ffs/ffs_common.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/fs/ffs/quotas_common.sh b/contrib/netbsd-tests/fs/ffs/quotas_common.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/fs/ffs/t_clearquota.sh b/contrib/netbsd-tests/fs/ffs/t_clearquota.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/fs/ffs/t_getquota.sh b/contrib/netbsd-tests/fs/ffs/t_getquota.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/fs/ffs/t_miscquota.sh b/contrib/netbsd-tests/fs/ffs/t_miscquota.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/fs/ffs/t_quotalimit.sh b/contrib/netbsd-tests/fs/ffs/t_quotalimit.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/fs/ffs/t_setquota.sh b/contrib/netbsd-tests/fs/ffs/t_setquota.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/fs/nfs/t_rquotad.sh b/contrib/netbsd-tests/fs/nfs/t_rquotad.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/fs/psshfs/t_psshfs.sh b/contrib/netbsd-tests/fs/psshfs/t_psshfs.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/fs/tmpfs/t_create.sh b/contrib/netbsd-tests/fs/tmpfs/t_create.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/fs/tmpfs/t_devices.sh b/contrib/netbsd-tests/fs/tmpfs/t_devices.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/fs/tmpfs/t_dots.sh b/contrib/netbsd-tests/fs/tmpfs/t_dots.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/fs/tmpfs/t_exec.sh b/contrib/netbsd-tests/fs/tmpfs/t_exec.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/fs/tmpfs/t_link.sh b/contrib/netbsd-tests/fs/tmpfs/t_link.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/fs/tmpfs/t_mkdir.sh b/contrib/netbsd-tests/fs/tmpfs/t_mkdir.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/fs/tmpfs/t_mknod.sh b/contrib/netbsd-tests/fs/tmpfs/t_mknod.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/fs/tmpfs/t_mount.sh b/contrib/netbsd-tests/fs/tmpfs/t_mount.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/fs/tmpfs/t_pipes.sh b/contrib/netbsd-tests/fs/tmpfs/t_pipes.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/fs/tmpfs/t_read_write.sh b/contrib/netbsd-tests/fs/tmpfs/t_read_write.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/fs/tmpfs/t_readdir.sh b/contrib/netbsd-tests/fs/tmpfs/t_readdir.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/fs/tmpfs/t_remove.sh b/contrib/netbsd-tests/fs/tmpfs/t_remove.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/fs/tmpfs/t_rename.sh b/contrib/netbsd-tests/fs/tmpfs/t_rename.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/fs/tmpfs/t_rmdir.sh b/contrib/netbsd-tests/fs/tmpfs/t_rmdir.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/fs/tmpfs/t_setattr.sh b/contrib/netbsd-tests/fs/tmpfs/t_setattr.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/fs/tmpfs/t_sizes.sh b/contrib/netbsd-tests/fs/tmpfs/t_sizes.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/fs/tmpfs/t_sockets.sh b/contrib/netbsd-tests/fs/tmpfs/t_sockets.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/fs/tmpfs/t_statvfs.sh b/contrib/netbsd-tests/fs/tmpfs/t_statvfs.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/fs/tmpfs/t_symlink.sh b/contrib/netbsd-tests/fs/tmpfs/t_symlink.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/fs/tmpfs/t_times.sh b/contrib/netbsd-tests/fs/tmpfs/t_times.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/fs/tmpfs/t_trail_slash.sh b/contrib/netbsd-tests/fs/tmpfs/t_trail_slash.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/fs/tmpfs/t_truncate.sh b/contrib/netbsd-tests/fs/tmpfs/t_truncate.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/fs/tmpfs/t_vnd.sh b/contrib/netbsd-tests/fs/tmpfs/t_vnd.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/fs/tmpfs/t_vnode_leak.sh b/contrib/netbsd-tests/fs/tmpfs/t_vnode_leak.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/fs/zfs/t_zpool.sh b/contrib/netbsd-tests/fs/zfs/t_zpool.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/games/t_factor.sh b/contrib/netbsd-tests/games/t_factor.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/ipf/h_common.sh b/contrib/netbsd-tests/ipf/h_common.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/ipf/t_bpf.sh b/contrib/netbsd-tests/ipf/t_bpf.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/ipf/t_filter_exec.sh b/contrib/netbsd-tests/ipf/t_filter_exec.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/ipf/t_filter_parse.sh b/contrib/netbsd-tests/ipf/t_filter_parse.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/ipf/t_logging.sh b/contrib/netbsd-tests/ipf/t_logging.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/ipf/t_nat_exec.sh b/contrib/netbsd-tests/ipf/t_nat_exec.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/ipf/t_nat_ipf_exec.sh b/contrib/netbsd-tests/ipf/t_nat_ipf_exec.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/ipf/t_nat_parse.sh b/contrib/netbsd-tests/ipf/t_nat_parse.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/ipf/t_pools.sh b/contrib/netbsd-tests/ipf/t_pools.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/kernel/gen_t_subr_prf b/contrib/netbsd-tests/kernel/gen_t_subr_prf old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/kernel/t_ps_strings.sh b/contrib/netbsd-tests/kernel/t_ps_strings.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/kernel/t_umount.sh b/contrib/netbsd-tests/kernel/t_umount.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/kernel/t_umountstress.sh b/contrib/netbsd-tests/kernel/t_umountstress.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/lib/csu/t_crt0.sh b/contrib/netbsd-tests/lib/csu/t_crt0.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/lib/libc/db/t_db.sh b/contrib/netbsd-tests/lib/libc/db/t_db.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/lib/libc/gen/posix_spawn/h_nonexec.sh b/contrib/netbsd-tests/lib/libc/gen/posix_spawn/h_nonexec.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/lib/libc/hash/t_hash.sh b/contrib/netbsd-tests/lib/libc/hash/t_hash.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/lib/libc/net/gen_ether_subr b/contrib/netbsd-tests/lib/libc/net/gen_ether_subr old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/lib/libc/net/getaddrinfo/t_getaddrinfo.sh b/contrib/netbsd-tests/lib/libc/net/getaddrinfo/t_getaddrinfo.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/lib/libc/net/t_hostent.sh b/contrib/netbsd-tests/lib/libc/net/t_hostent.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/lib/libc/net/t_nsdispatch.sh b/contrib/netbsd-tests/lib/libc/net/t_nsdispatch.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/lib/libc/net/t_protoent.sh b/contrib/netbsd-tests/lib/libc/net/t_protoent.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/lib/libc/net/t_servent.sh b/contrib/netbsd-tests/lib/libc/net/t_servent.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/lib/libc/regex/t_regex.sh b/contrib/netbsd-tests/lib/libc/regex/t_regex.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/lib/libc/ssp/t_ssp.sh b/contrib/netbsd-tests/lib/libc/ssp/t_ssp.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/lib/libc/stdlib/t_atexit.sh b/contrib/netbsd-tests/lib/libc/stdlib/t_atexit.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/lib/libc/stdlib/t_getopt.sh b/contrib/netbsd-tests/lib/libc/stdlib/t_getopt.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/lib/libcurses/t_curses.sh b/contrib/netbsd-tests/lib/libcurses/t_curses.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/lib/libevent/t_event.sh b/contrib/netbsd-tests/lib/libevent/t_event.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/lib/libppath/plist_to_c b/contrib/netbsd-tests/lib/libppath/plist_to_c old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/lib/libpthread/t_atexit.sh b/contrib/netbsd-tests/lib/libpthread/t_atexit.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/lib/libpthread/t_cancel.sh b/contrib/netbsd-tests/lib/libpthread/t_cancel.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/lib/libpthread/t_exit.sh b/contrib/netbsd-tests/lib/libpthread/t_exit.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/lib/libpthread/t_resolv.sh b/contrib/netbsd-tests/lib/libpthread/t_resolv.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/lib/librumpclient/t_exec.sh b/contrib/netbsd-tests/lib/librumpclient/t_exec.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/lib/librumphijack/t_asyncio.sh b/contrib/netbsd-tests/lib/librumphijack/t_asyncio.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/lib/librumphijack/t_config.sh b/contrib/netbsd-tests/lib/librumphijack/t_config.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/lib/librumphijack/t_cwd.sh b/contrib/netbsd-tests/lib/librumphijack/t_cwd.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/lib/librumphijack/t_sh.sh b/contrib/netbsd-tests/lib/librumphijack/t_sh.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/lib/librumphijack/t_tcpip.sh b/contrib/netbsd-tests/lib/librumphijack/t_tcpip.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/lib/librumphijack/t_vfs.sh b/contrib/netbsd-tests/lib/librumphijack/t_vfs.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/lib/libsljit/t_sljit.sh b/contrib/netbsd-tests/lib/libsljit/t_sljit.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/libexec/ld.elf_so/t_df_1_noopen.sh b/contrib/netbsd-tests/libexec/ld.elf_so/t_df_1_noopen.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/libexec/ld.elf_so/t_dl_symver.sh b/contrib/netbsd-tests/libexec/ld.elf_so/t_dl_symver.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/modules/t_abi_uvm.sh b/contrib/netbsd-tests/modules/t_abi_uvm.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/modules/t_modload.sh b/contrib/netbsd-tests/modules/t_modload.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/net/arp/t_arp.sh b/contrib/netbsd-tests/net/arp/t_arp.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/net/arp/t_dad.sh b/contrib/netbsd-tests/net/arp/t_dad.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/net/carp/t_basic.sh b/contrib/netbsd-tests/net/carp/t_basic.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/net/fdpass/t_fdpass.sh b/contrib/netbsd-tests/net/fdpass/t_fdpass.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/net/icmp/t_icmp6_redirect.sh b/contrib/netbsd-tests/net/icmp/t_icmp6_redirect.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/net/icmp/t_icmp_redirect.sh b/contrib/netbsd-tests/net/icmp/t_icmp_redirect.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/net/icmp/t_ping2.sh b/contrib/netbsd-tests/net/icmp/t_ping2.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/net/if/t_ifconf.sh b/contrib/netbsd-tests/net/if/t_ifconf.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/net/if/t_ifconfig.sh b/contrib/netbsd-tests/net/if/t_ifconfig.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/net/if_bridge/t_bridge.sh b/contrib/netbsd-tests/net/if_bridge/t_bridge.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/net/if_gif/t_gif.sh b/contrib/netbsd-tests/net/if_gif/t_gif.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/net/if_pppoe/t_pppoe.sh b/contrib/netbsd-tests/net/if_pppoe/t_pppoe.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/net/if_tap/t_tap.sh b/contrib/netbsd-tests/net/if_tap/t_tap.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/net/if_tun/t_tun.sh b/contrib/netbsd-tests/net/if_tun/t_tun.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/net/if_vlan/t_vlan.sh b/contrib/netbsd-tests/net/if_vlan/t_vlan.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/net/in_cksum/t_in_cksum.sh b/contrib/netbsd-tests/net/in_cksum/t_in_cksum.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/net/mcast/t_mcast.sh b/contrib/netbsd-tests/net/mcast/t_mcast.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/net/mpls/t_ldp_regen.sh b/contrib/netbsd-tests/net/mpls/t_ldp_regen.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/net/mpls/t_mpls_fw.sh b/contrib/netbsd-tests/net/mpls/t_mpls_fw.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/net/mpls/t_mpls_fw6.sh b/contrib/netbsd-tests/net/mpls/t_mpls_fw6.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/net/mpls/t_mpls_fw64.sh b/contrib/netbsd-tests/net/mpls/t_mpls_fw64.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/net/mpls/t_rfc4182.sh b/contrib/netbsd-tests/net/mpls/t_rfc4182.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/net/ndp/t_dad.sh b/contrib/netbsd-tests/net/ndp/t_dad.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/net/ndp/t_ndp.sh b/contrib/netbsd-tests/net/ndp/t_ndp.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/net/ndp/t_ra.sh b/contrib/netbsd-tests/net/ndp/t_ra.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/net/net/t_forwarding.sh b/contrib/netbsd-tests/net/net/t_forwarding.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/net/net/t_ipaddress.sh b/contrib/netbsd-tests/net/net/t_ipaddress.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/net/net/t_ipv6_lifetime.sh b/contrib/netbsd-tests/net/net/t_ipv6_lifetime.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/net/net/t_ipv6address.sh b/contrib/netbsd-tests/net/net/t_ipv6address.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/net/net/t_mtudisc.sh b/contrib/netbsd-tests/net/net/t_mtudisc.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/net/net/t_mtudisc6.sh b/contrib/netbsd-tests/net/net/t_mtudisc6.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/net/net/t_ping6_opts.sh b/contrib/netbsd-tests/net/net/t_ping6_opts.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/net/net_common.sh b/contrib/netbsd-tests/net/net_common.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/net/npf/t_npf.sh b/contrib/netbsd-tests/net/npf/t_npf.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/net/route/t_change.sh b/contrib/netbsd-tests/net/route/t_change.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/net/route/t_flags.sh b/contrib/netbsd-tests/net/route/t_flags.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/net/route/t_flags6.sh b/contrib/netbsd-tests/net/route/t_flags6.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/net/route/t_route.sh b/contrib/netbsd-tests/net/route/t_route.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/rump/rumpkern/t_sp.sh b/contrib/netbsd-tests/rump/rumpkern/t_sp.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/rump/rumpnet/t_shmif.sh b/contrib/netbsd-tests/rump/rumpnet/t_shmif.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/sbin/fsck_ffs/quotas_common.sh b/contrib/netbsd-tests/sbin/fsck_ffs/quotas_common.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/sbin/fsck_ffs/t_check_quotas.sh b/contrib/netbsd-tests/sbin/fsck_ffs/t_check_quotas.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/sbin/fsck_ffs/t_enable_quotas.sh b/contrib/netbsd-tests/sbin/fsck_ffs/t_enable_quotas.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/sbin/gpt/t_gpt.sh b/contrib/netbsd-tests/sbin/gpt/t_gpt.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/sbin/ifconfig/t_nonexistent.sh b/contrib/netbsd-tests/sbin/ifconfig/t_nonexistent.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/sbin/newfs/quotas_common.sh b/contrib/netbsd-tests/sbin/newfs/quotas_common.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/sbin/newfs/t_enable_quotas.sh b/contrib/netbsd-tests/sbin/newfs/t_enable_quotas.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/sbin/newfs_msdos/t_create.sh b/contrib/netbsd-tests/sbin/newfs_msdos/t_create.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/sbin/resize_ffs/common.sh b/contrib/netbsd-tests/sbin/resize_ffs/common.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/sbin/resize_ffs/t_check.sh b/contrib/netbsd-tests/sbin/resize_ffs/t_check.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/sbin/resize_ffs/t_grow.sh b/contrib/netbsd-tests/sbin/resize_ffs/t_grow.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/sbin/resize_ffs/t_grow_swapped.sh b/contrib/netbsd-tests/sbin/resize_ffs/t_grow_swapped.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/sbin/resize_ffs/t_shrink.sh b/contrib/netbsd-tests/sbin/resize_ffs/t_shrink.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/sbin/resize_ffs/t_shrink_swapped.sh b/contrib/netbsd-tests/sbin/resize_ffs/t_shrink_swapped.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/sbin/route/t_missing.sh b/contrib/netbsd-tests/sbin/route/t_missing.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/sbin/sysctl/t_perm.sh b/contrib/netbsd-tests/sbin/sysctl/t_perm.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/sbin/sysctl/t_sysctl.sh b/contrib/netbsd-tests/sbin/sysctl/t_sysctl.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/share/examples/t_asm.sh b/contrib/netbsd-tests/share/examples/t_asm.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/share/mk/t_lib.sh b/contrib/netbsd-tests/share/mk/t_lib.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/share/mk/t_own.sh b/contrib/netbsd-tests/share/mk/t_own.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/share/mk/t_prog.sh b/contrib/netbsd-tests/share/mk/t_prog.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/share/mk/t_test.sh b/contrib/netbsd-tests/share/mk/t_test.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/sys/rc/h_args.sh b/contrib/netbsd-tests/sys/rc/h_args.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/sys/rc/h_simple.sh b/contrib/netbsd-tests/sys/rc/h_simple.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/sys/rc/t_rc_d_cli.sh b/contrib/netbsd-tests/sys/rc/t_rc_d_cli.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/usr.bin/awk/t_awk.sh b/contrib/netbsd-tests/usr.bin/awk/t_awk.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/usr.bin/basename/t_basename.sh b/contrib/netbsd-tests/usr.bin/basename/t_basename.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/usr.bin/bzip2/t_bzip2.sh b/contrib/netbsd-tests/usr.bin/bzip2/t_bzip2.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/usr.bin/cc/t_hello.sh b/contrib/netbsd-tests/usr.bin/cc/t_hello.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/usr.bin/cmp/t_cmp.sh b/contrib/netbsd-tests/usr.bin/cmp/t_cmp.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/usr.bin/config/t_config.sh b/contrib/netbsd-tests/usr.bin/config/t_config.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/usr.bin/cut/t_cut.sh b/contrib/netbsd-tests/usr.bin/cut/t_cut.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/usr.bin/diff/t_diff.sh b/contrib/netbsd-tests/usr.bin/diff/t_diff.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/usr.bin/dirname/t_dirname.sh b/contrib/netbsd-tests/usr.bin/dirname/t_dirname.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/usr.bin/find/t_find.sh b/contrib/netbsd-tests/usr.bin/find/t_find.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/usr.bin/gdb/t_regress.sh b/contrib/netbsd-tests/usr.bin/gdb/t_regress.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/usr.bin/grep/t_grep.sh b/contrib/netbsd-tests/usr.bin/grep/t_grep.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/usr.bin/gzip/t_gzip.sh b/contrib/netbsd-tests/usr.bin/gzip/t_gzip.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/usr.bin/id/t_groups.sh b/contrib/netbsd-tests/usr.bin/id/t_groups.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/usr.bin/id/t_id.sh b/contrib/netbsd-tests/usr.bin/id/t_id.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/usr.bin/id/t_whoami.sh b/contrib/netbsd-tests/usr.bin/id/t_whoami.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/usr.bin/infocmp/t_terminfo.sh b/contrib/netbsd-tests/usr.bin/infocmp/t_terminfo.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/usr.bin/jot/t_jot.sh b/contrib/netbsd-tests/usr.bin/jot/t_jot.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/usr.bin/ld/t_script.sh b/contrib/netbsd-tests/usr.bin/ld/t_script.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/usr.bin/ld/t_section.sh b/contrib/netbsd-tests/usr.bin/ld/t_section.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/usr.bin/m4/t_m4.sh b/contrib/netbsd-tests/usr.bin/m4/t_m4.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/usr.bin/make/t_make.sh b/contrib/netbsd-tests/usr.bin/make/t_make.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/usr.bin/mixerctl/t_mixerctl.sh b/contrib/netbsd-tests/usr.bin/mixerctl/t_mixerctl.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/usr.bin/mkdep/t_mkdep.sh b/contrib/netbsd-tests/usr.bin/mkdep/t_mkdep.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/usr.bin/nbperf/h_nbperf.sh b/contrib/netbsd-tests/usr.bin/nbperf/h_nbperf.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/usr.bin/nbperf/t_nbperf.sh b/contrib/netbsd-tests/usr.bin/nbperf/t_nbperf.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/usr.bin/netpgpverify/t_netpgpverify.sh b/contrib/netbsd-tests/usr.bin/netpgpverify/t_netpgpverify.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/usr.bin/pr/t_basic.sh b/contrib/netbsd-tests/usr.bin/pr/t_basic.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/usr.bin/rump_server/t_disk.sh b/contrib/netbsd-tests/usr.bin/rump_server/t_disk.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/usr.bin/sdiff/t_sdiff.sh b/contrib/netbsd-tests/usr.bin/sdiff/t_sdiff.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/usr.bin/sed/t_sed.sh b/contrib/netbsd-tests/usr.bin/sed/t_sed.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/usr.bin/shmif_dumpbus/t_basic.sh b/contrib/netbsd-tests/usr.bin/shmif_dumpbus/t_basic.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/usr.bin/sort/t_sort.sh b/contrib/netbsd-tests/usr.bin/sort/t_sort.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/usr.bin/tmux/t_tmux.sh b/contrib/netbsd-tests/usr.bin/tmux/t_tmux.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/usr.bin/tr/t_basic.sh b/contrib/netbsd-tests/usr.bin/tr/t_basic.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/usr.bin/unifdef/t_basic.sh b/contrib/netbsd-tests/usr.bin/unifdef/t_basic.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/usr.bin/uniq/t_uniq.sh b/contrib/netbsd-tests/usr.bin/uniq/t_uniq.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/usr.bin/vmstat/t_vmstat.sh b/contrib/netbsd-tests/usr.bin/vmstat/t_vmstat.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/usr.bin/xlint/lint1/t_integration.sh b/contrib/netbsd-tests/usr.bin/xlint/lint1/t_integration.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/usr.sbin/mtree/t_mtree.sh b/contrib/netbsd-tests/usr.sbin/mtree/t_mtree.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/usr.sbin/tcpdump/t_tcpdump.sh b/contrib/netbsd-tests/usr.sbin/tcpdump/t_tcpdump.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/usr.sbin/traceroute/t_traceroute.sh b/contrib/netbsd-tests/usr.sbin/traceroute/t_traceroute.sh old mode 100755 new mode 100644 diff --git a/contrib/netbsd-tests/usr.sbin/useradd/t_useradd.sh b/contrib/netbsd-tests/usr.sbin/useradd/t_useradd.sh old mode 100755 new mode 100644 diff --git a/include/mk-osreldate.sh b/include/mk-osreldate.sh old mode 100755 new mode 100644 diff --git a/lib/libc/regex/grot/mkh b/lib/libc/regex/grot/mkh old mode 100755 new mode 100644 diff --git a/lib/objgfx/objgfx40.so b/lib/objgfx/objgfx40.so old mode 100755 new mode 100644 Binary files differ diff --git a/lib/objgfx40/ROMAN1.DPF b/lib/objgfx40/ROMAN1.DPF old mode 100755 new mode 100644 Binary files differ diff --git a/lib/objgfx40/SCRIPT.DPF b/lib/objgfx40/SCRIPT.DPF old mode 100755 new mode 100644 Binary files differ diff --git a/lib/objgfx40/ogDisplay_UbixOS.cc b/lib/objgfx40/ogDisplay_UbixOS.cc old mode 100755 new mode 100644 diff --git a/sys/fs/ubixfs/thread.c b/sys/fs/ubixfs/thread.c old mode 100755 new mode 100644 diff --git a/sys/include/objgfx/ogDisplay_VESA.h b/sys/include/objgfx/ogDisplay_VESA.h old mode 100755 new mode 100644 diff --git a/sys/include/sde/ogDisplay_UbixOS.h b/sys/include/sde/ogDisplay_UbixOS.h old mode 100755 new mode 100644 diff --git a/sys/net/netif/Makefile b/sys/net/netif/Makefile old mode 100755 new mode 100644 diff --git a/sys/sde/ogDisplay_UbixOS.cc b/sys/sde/ogDisplay_UbixOS.cc old mode 100755 new mode 100644 diff --git a/tools/SCRIPT.DPF b/tools/SCRIPT.DPF old mode 100755 new mode 100644 Binary files differ diff --git a/tools/mbr b/tools/mbr old mode 100755 new mode 100644 Binary files differ diff --git a/tools/stat b/tools/stat old mode 100755 new mode 100644 Binary files differ