diff --git a/.cproject b/.cproject
index 0c0add5..edb5d25 100644
--- a/.cproject
+++ b/.cproject
@@ -5,7 +5,6 @@
-
@@ -16,60 +15,59 @@
-
-
-
-
-
-
-
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
+
+
+
+
-
-
+
+
+
+
+
+
+
-
+
-
-
-
-
-
+
+
-
+
@@ -86,9 +84,6 @@
-
-
-
@@ -103,11 +98,8 @@
-
-
-
-
-
-
+
+
+
diff --git a/.project b/.project
index 7bd8870..e87f5c8 100644
--- a/.project
+++ b/.project
@@ -3,6 +3,8 @@
UbixOS
+ UbixOS Kernel
+ UbixOS Libc
diff --git a/DEBUG b/DEBUG
new file mode 100644
index 0000000..a6d239a
--- /dev/null
+++ b/DEBUG
@@ -0,0 +1,3 @@
+#DEBUG_EXEC - Exec Debug
+#DEBUG_VFS - VFS DEBUG
+#DEBUG_SYSCTL - SYSCTL DEBUG
diff --git a/DEBUG_INFO b/DEBUG_INFO
deleted file mode 100644
index a6d239a..0000000
--- a/DEBUG_INFO
+++ /dev/null
@@ -1,3 +0,0 @@
-#DEBUG_EXEC - Exec Debug
-#DEBUG_VFS - VFS DEBUG
-#DEBUG_SYSCTL - SYSCTL DEBUG
diff --git a/Dump/Ubix-CLOUDNINE.flp b/Dump/Ubix-CLOUDNINE.flp
deleted file mode 100644
index d18d75f..0000000
--- a/Dump/Ubix-CLOUDNINE.flp
+++ /dev/null
Binary files differ
diff --git a/Dump/UbixOS-080504.flp b/Dump/UbixOS-080504.flp
deleted file mode 100644
index 2462273..0000000
--- a/Dump/UbixOS-080504.flp
+++ /dev/null
Binary files differ
diff --git a/Dump/hybos/Makefile b/Dump/hybos/Makefile
deleted file mode 100644
index d90ac30..0000000
--- a/Dump/hybos/Makefile
+++ /dev/null
@@ -1,11 +0,0 @@
-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
deleted file mode 100644
index 6f0e2f2..0000000
--- a/Dump/hybos/README.txt
+++ /dev/null
@@ -1,210 +0,0 @@
-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
deleted file mode 100644
index fba9e05..0000000
--- a/Dump/hybos/__experimental/README.txt
+++ /dev/null
@@ -1,87 +0,0 @@
-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
deleted file mode 100644
index 4a20581..0000000
--- a/Dump/hybos/__experimental/demo.c
+++ /dev/null
@@ -1,94 +0,0 @@
-/*****************************************************************************
-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
deleted file mode 100644
index 71ff36c..0000000
--- a/Dump/hybos/__experimental/diskio.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/*****************************************************************************
-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
deleted file mode 100644
index ee35e57..0000000
--- a/Dump/hybos/__experimental/djgpp.c
+++ /dev/null
@@ -1,131 +0,0 @@
-/*****************************************************************************
-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
deleted file mode 100644
index a8e153f..0000000
--- a/Dump/hybos/__experimental/djgpp.mak
+++ /dev/null
@@ -1,28 +0,0 @@
-# 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
deleted file mode 100644
index 71f1446..0000000
--- a/Dump/hybos/__experimental/dos.c
+++ /dev/null
@@ -1,256 +0,0 @@
-/*****************************************************************************
-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~
deleted file mode 100644
index 8b0703a..0000000
--- a/Dump/hybos/__experimental/dos.c~
+++ /dev/null
@@ -1,256 +0,0 @@
-/*****************************************************************************
-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
deleted file mode 100644
index d604379..0000000
--- a/Dump/hybos/__experimental/dos.h
+++ /dev/null
@@ -1,65 +0,0 @@
-/*****************************************************************************
-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
deleted file mode 100644
index d849321..0000000
--- a/Dump/hybos/__experimental/dos16.c
+++ /dev/null
@@ -1,114 +0,0 @@
-/*****************************************************************************
-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
deleted file mode 100644
index 97c6819..0000000
--- a/Dump/hybos/__experimental/makefile
+++ /dev/null
@@ -1,32 +0,0 @@
-# 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
deleted file mode 100644
index 0c61cc3..0000000
--- a/Dump/hybos/__experimental/watcom16.mak
+++ /dev/null
@@ -1,28 +0,0 @@
-# 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
deleted file mode 100644
index 978b34e..0000000
--- a/Dump/hybos/__experimental/watcom32.c
+++ /dev/null
@@ -1,117 +0,0 @@
-/*****************************************************************************
-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
deleted file mode 100644
index f5164c6..0000000
--- a/Dump/hybos/__experimental/watcom32.mak
+++ /dev/null
@@ -1,30 +0,0 @@
-# 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
deleted file mode 100644
index 6d97a0c..0000000
--- a/Dump/hybos/__experimental/win-nt.c
+++ /dev/null
@@ -1,125 +0,0 @@
-/*****************************************************************************
-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
deleted file mode 100644
index c43eb97..0000000
--- a/Dump/hybos/__experimental/win-nt.mak
+++ /dev/null
@@ -1,26 +0,0 @@
-# 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
deleted file mode 100644
index fcb2485..0000000
--- a/Dump/hybos/boot/grub/mbchk.c
+++ /dev/null
@@ -1,166 +0,0 @@
-/*****************************************************************************
-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
deleted file mode 100644
index 3f86aa1..0000000
--- a/Dump/hybos/boot/grub/menu.lst
+++ /dev/null
@@ -1,39 +0,0 @@
-# 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
deleted file mode 100644
index 6c2efdb..0000000
--- a/Dump/hybos/boot/grub/mltiboot.h
+++ /dev/null
@@ -1,115 +0,0 @@
-/* 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
deleted file mode 100644
index 1cd1292..0000000
--- a/Dump/hybos/boot/grub/stage1
+++ /dev/null
Binary files differ
diff --git a/Dump/hybos/boot/grub/stage2 b/Dump/hybos/boot/grub/stage2
deleted file mode 100644
index 25094fe..0000000
--- a/Dump/hybos/boot/grub/stage2
+++ /dev/null
Binary files differ
diff --git a/Dump/hybos/boot/kernel.bin b/Dump/hybos/boot/kernel.bin
deleted file mode 100644
index 3ff90a0..0000000
--- a/Dump/hybos/boot/kernel.bin
+++ /dev/null
Binary files differ
diff --git a/Dump/hybos/include/._malloc.h.swp b/Dump/hybos/include/._malloc.h.swp
deleted file mode 100644
index 3a93866..0000000
--- a/Dump/hybos/include/._malloc.h.swp
+++ /dev/null
Binary files differ
diff --git a/Dump/hybos/include/.ctype.h.swp b/Dump/hybos/include/.ctype.h.swp
deleted file mode 100644
index 3191f8d..0000000
--- a/Dump/hybos/include/.ctype.h.swp
+++ /dev/null
Binary files differ
diff --git a/Dump/hybos/include/.fat.h.swp b/Dump/hybos/include/.fat.h.swp
deleted file mode 100644
index ab6de14..0000000
--- a/Dump/hybos/include/.fat.h.swp
+++ /dev/null
Binary files differ
diff --git a/Dump/hybos/include/.keyboard.h.swp b/Dump/hybos/include/.keyboard.h.swp
deleted file mode 100644
index b1505f1..0000000
--- a/Dump/hybos/include/.keyboard.h.swp
+++ /dev/null
Binary files differ
diff --git a/Dump/hybos/include/.stdarg.h.swp b/Dump/hybos/include/.stdarg.h.swp
deleted file mode 100644
index 3c895d7..0000000
--- a/Dump/hybos/include/.stdarg.h.swp
+++ /dev/null
Binary files differ
diff --git a/Dump/hybos/include/.x86.h.swp b/Dump/hybos/include/.x86.h.swp
deleted file mode 100644
index 4a4a828..0000000
--- a/Dump/hybos/include/.x86.h.swp
+++ /dev/null
Binary files differ
diff --git a/Dump/hybos/include/__nocompile_fcntl.h b/Dump/hybos/include/__nocompile_fcntl.h
deleted file mode 100644
index 48de3c3..0000000
--- a/Dump/hybos/include/__nocompile_fcntl.h
+++ /dev/null
@@ -1,79 +0,0 @@
-/**
- * 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
deleted file mode 100644
index 5aef646..0000000
--- a/Dump/hybos/include/__nocompile_signal.h
+++ /dev/null
@@ -1,83 +0,0 @@
-/**
- * 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
deleted file mode 100644
index b8c68da..0000000
--- a/Dump/hybos/include/_malloc.h
+++ /dev/null
@@ -1,37 +0,0 @@
-#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_
deleted file mode 100644
index 6207940..0000000
--- a/Dump/hybos/include/_null.h_
+++ /dev/null
@@ -1,18 +0,0 @@
-#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
deleted file mode 100644
index c967f10..0000000
--- a/Dump/hybos/include/_printf.h
+++ /dev/null
@@ -1,19 +0,0 @@
-#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
deleted file mode 100644
index bebd416..0000000
--- a/Dump/hybos/include/_size_t.h
+++ /dev/null
@@ -1,18 +0,0 @@
-#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
deleted file mode 100644
index fe5b164..0000000
--- a/Dump/hybos/include/_va_list.h
+++ /dev/null
@@ -1,15 +0,0 @@
-#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
deleted file mode 100644
index 3ba45fc..0000000
--- a/Dump/hybos/include/asm.inc
+++ /dev/null
@@ -1,30 +0,0 @@
-%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
deleted file mode 100644
index 9ae9311..0000000
--- a/Dump/hybos/include/char.h
+++ /dev/null
@@ -1,24 +0,0 @@
-#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
deleted file mode 100644
index abc6575..0000000
--- a/Dump/hybos/include/conio.h
+++ /dev/null
@@ -1,60 +0,0 @@
-#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
deleted file mode 100644
index ac9d411..0000000
--- a/Dump/hybos/include/ctype.h
+++ /dev/null
@@ -1,44 +0,0 @@
-#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
deleted file mode 100644
index edf72f3..0000000
--- a/Dump/hybos/include/e2fs.h
+++ /dev/null
@@ -1,290 +0,0 @@
-/* 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
deleted file mode 100644
index 298da0c..0000000
--- a/Dump/hybos/include/esh/esh.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/**
- * 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~
deleted file mode 100644
index 134afeb..0000000
--- a/Dump/hybos/include/esh/esh.h~
+++ /dev/null
@@ -1,32 +0,0 @@
-/**
- * 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
deleted file mode 100644
index af93578..0000000
--- a/Dump/hybos/include/fat.h
+++ /dev/null
@@ -1,84 +0,0 @@
-#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
deleted file mode 100644
index 403422c..0000000
--- a/Dump/hybos/include/keyboard.h
+++ /dev/null
@@ -1,415 +0,0 @@
-#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
deleted file mode 100644
index ae39ba0..0000000
--- a/Dump/hybos/include/keymap.h
+++ /dev/null
@@ -1,142 +0,0 @@
-/* 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
deleted file mode 100644
index e69de29..0000000
--- a/Dump/hybos/include/mmzone.h
+++ /dev/null
diff --git a/Dump/hybos/include/setjmp.h b/Dump/hybos/include/setjmp.h
deleted file mode 100644
index b9dda41..0000000
--- a/Dump/hybos/include/setjmp.h
+++ /dev/null
@@ -1,24 +0,0 @@
-#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
deleted file mode 100644
index 6344bb5..0000000
--- a/Dump/hybos/include/signal.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/**
- * 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~
deleted file mode 100644
index 56e3ab5..0000000
--- a/Dump/hybos/include/signal.h~
+++ /dev/null
@@ -1,50 +0,0 @@
-/**
- * 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
deleted file mode 100644
index ea527d4..0000000
--- a/Dump/hybos/include/stdarg.h
+++ /dev/null
@@ -1,35 +0,0 @@
-#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
deleted file mode 100644
index e3f2b22..0000000
--- a/Dump/hybos/include/stdbool.h
+++ /dev/null
@@ -1,6 +0,0 @@
-#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
deleted file mode 100644
index f1a5135..0000000
--- a/Dump/hybos/include/stddef.h
+++ /dev/null
@@ -1,11 +0,0 @@
-#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
deleted file mode 100644
index 744183f..0000000
--- a/Dump/hybos/include/stdint.h
+++ /dev/null
@@ -1,166 +0,0 @@
-#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
deleted file mode 100644
index 12bbb89..0000000
--- a/Dump/hybos/include/stdio.h
+++ /dev/null
@@ -1,79 +0,0 @@
-/**
- * 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
deleted file mode 100644
index 477873e..0000000
--- a/Dump/hybos/include/stdlib.h
+++ /dev/null
@@ -1,58 +0,0 @@
-/**
- * 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
deleted file mode 100644
index 8fa2767..0000000
--- a/Dump/hybos/include/string.h
+++ /dev/null
@@ -1,26 +0,0 @@
-#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
deleted file mode 100644
index 114d2bf..0000000
--- a/Dump/hybos/include/sys/dir.h
+++ /dev/null
@@ -1,19 +0,0 @@
-#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
deleted file mode 100644
index 96b5c37..0000000
--- a/Dump/hybos/include/time.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/**
- * 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
deleted file mode 100644
index bb68769..0000000
--- a/Dump/hybos/include/x86.h
+++ /dev/null
@@ -1,26 +0,0 @@
-#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
deleted file mode 100644
index 0b91a38..0000000
--- a/Dump/hybos/lib/Makefile
+++ /dev/null
@@ -1,33 +0,0 @@
-#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
deleted file mode 100644
index 654c46f..0000000
--- a/Dump/hybos/lib/char/Makefile
+++ /dev/null
@@ -1,71 +0,0 @@
-.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
deleted file mode 100644
index 26b2a3a..0000000
--- a/Dump/hybos/lib/char/isalnum.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#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
deleted file mode 100644
index 6392de1..0000000
--- a/Dump/hybos/lib/char/isalpha.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#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
deleted file mode 100644
index 4ddcaee..0000000
--- a/Dump/hybos/lib/char/isascii.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#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
deleted file mode 100644
index 575bb19..0000000
--- a/Dump/hybos/lib/char/iscsym.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#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
deleted file mode 100644
index c735f71..0000000
--- a/Dump/hybos/lib/char/iscsymf.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#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
deleted file mode 100644
index 894df6d..0000000
--- a/Dump/hybos/lib/char/isctrl.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#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
deleted file mode 100644
index 6eebe23..0000000
--- a/Dump/hybos/lib/char/isdigit.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#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
deleted file mode 100644
index f8103ca..0000000
--- a/Dump/hybos/lib/char/isgraph.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#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
deleted file mode 100644
index 5e60bfc..0000000
--- a/Dump/hybos/lib/char/islower.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#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
deleted file mode 100644
index 96f5caf..0000000
--- a/Dump/hybos/lib/char/isprint.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#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
deleted file mode 100644
index 72b4d4d..0000000
--- a/Dump/hybos/lib/char/ispunct.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#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
deleted file mode 100644
index 29c6139..0000000
--- a/Dump/hybos/lib/char/isspace.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#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
deleted file mode 100644
index e54a05c..0000000
--- a/Dump/hybos/lib/char/isupper.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#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
deleted file mode 100644
index b67e005..0000000
--- a/Dump/hybos/lib/char/isxdigit.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#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
deleted file mode 100644
index 2bd4b3d..0000000
--- a/Dump/hybos/lib/config/Makefile
+++ /dev/null
@@ -1,32 +0,0 @@
-.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
deleted file mode 100644
index 3a46d5b..0000000
--- a/Dump/hybos/lib/config/config.c
+++ /dev/null
@@ -1,36 +0,0 @@
-/**
- * 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
deleted file mode 100644
index a2a4409..0000000
--- a/Dump/hybos/lib/convert/Makefile
+++ /dev/null
@@ -1,56 +0,0 @@
-.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
deleted file mode 100644
index 5a0ae8f..0000000
--- a/Dump/hybos/lib/convert/atoi.c
+++ /dev/null
@@ -1,33 +0,0 @@
-#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
deleted file mode 100644
index d3f5a12..0000000
--- a/Dump/hybos/lib/convert/atoi16.c
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/Dump/hybos/lib/convert/atoi32.c b/Dump/hybos/lib/convert/atoi32.c
deleted file mode 100644
index d3f5a12..0000000
--- a/Dump/hybos/lib/convert/atoi32.c
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/Dump/hybos/lib/convert/atoi64.c b/Dump/hybos/lib/convert/atoi64.c
deleted file mode 100644
index d3f5a12..0000000
--- a/Dump/hybos/lib/convert/atoi64.c
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/Dump/hybos/lib/convert/i16toa.c b/Dump/hybos/lib/convert/i16toa.c
deleted file mode 100644
index ed88e45..0000000
--- a/Dump/hybos/lib/convert/i16toa.c
+++ /dev/null
@@ -1,39 +0,0 @@
-#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
deleted file mode 100644
index c8115ea..0000000
--- a/Dump/hybos/lib/convert/i32toa.c
+++ /dev/null
@@ -1,39 +0,0 @@
-#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
deleted file mode 100644
index e75aa87..0000000
--- a/Dump/hybos/lib/convert/i64toa.c
+++ /dev/null
@@ -1,39 +0,0 @@
-#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
deleted file mode 100644
index 3fc6ce7..0000000
--- a/Dump/hybos/lib/convert/itoa.c
+++ /dev/null
@@ -1,104 +0,0 @@
-/***
-*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
deleted file mode 100644
index 4998340..0000000
--- a/Dump/hybos/lib/convert/u16toa.c
+++ /dev/null
@@ -1,29 +0,0 @@
-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
deleted file mode 100644
index 3145cd8..0000000
--- a/Dump/hybos/lib/convert/u32toa.c
+++ /dev/null
@@ -1,29 +0,0 @@
-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
deleted file mode 100644
index 9ec5fa1..0000000
--- a/Dump/hybos/lib/convert/u64toa.c
+++ /dev/null
@@ -1,29 +0,0 @@
-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
deleted file mode 100644
index 5f7fddd..0000000
--- a/Dump/hybos/lib/ctype/Makefile
+++ /dev/null
@@ -1,32 +0,0 @@
-.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
deleted file mode 100644
index acf64e3..0000000
--- a/Dump/hybos/lib/ctype/ctype.c
+++ /dev/null
@@ -1,46 +0,0 @@
-#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
deleted file mode 100644
index 68b8fcb..0000000
--- a/Dump/hybos/lib/libc.a
+++ /dev/null
Binary files differ
diff --git a/Dump/hybos/lib/math/Makefile b/Dump/hybos/lib/math/Makefile
deleted file mode 100644
index 9e7bf8e..0000000
--- a/Dump/hybos/lib/math/Makefile
+++ /dev/null
@@ -1,44 +0,0 @@
-.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
deleted file mode 100644
index adf8157..0000000
--- a/Dump/hybos/lib/math/abs.c
+++ /dev/null
@@ -1,32 +0,0 @@
-/***
-*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
deleted file mode 100644
index 869833a..0000000
--- a/Dump/hybos/lib/math/max.c
+++ /dev/null
@@ -1,4 +0,0 @@
-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
deleted file mode 100644
index 10d4dc5..0000000
--- a/Dump/hybos/lib/math/min.c
+++ /dev/null
@@ -1,4 +0,0 @@
-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
deleted file mode 100644
index 8981329..0000000
--- a/Dump/hybos/lib/math/rotl.c
+++ /dev/null
@@ -1,49 +0,0 @@
-/***
-*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
deleted file mode 100644
index 10247ff..0000000
--- a/Dump/hybos/lib/math/rotr.c
+++ /dev/null
@@ -1,52 +0,0 @@
-/***
-*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
deleted file mode 100644
index 0cdbee4..0000000
--- a/Dump/hybos/lib/mem/Makefile
+++ /dev/null
@@ -1,59 +0,0 @@
-.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
deleted file mode 100644
index 287057b..0000000
--- a/Dump/hybos/lib/mem/memccpy.c
+++ /dev/null
@@ -1,41 +0,0 @@
-/***
-*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
deleted file mode 100644
index ccf6e3b..0000000
--- a/Dump/hybos/lib/mem/memchr.c
+++ /dev/null
@@ -1,43 +0,0 @@
-/***
-*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
deleted file mode 100644
index f4d498d..0000000
--- a/Dump/hybos/lib/mem/memcmp.c
+++ /dev/null
@@ -1,46 +0,0 @@
-/***
-*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
deleted file mode 100644
index bb86792..0000000
--- a/Dump/hybos/lib/mem/memcpy.c
+++ /dev/null
@@ -1,13 +0,0 @@
-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
deleted file mode 100644
index 3db51f3..0000000
--- a/Dump/hybos/lib/mem/memcpybw.c
+++ /dev/null
@@ -1,13 +0,0 @@
-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
deleted file mode 100644
index 74f2888..0000000
--- a/Dump/hybos/lib/mem/memicmp.c
+++ /dev/null
@@ -1,58 +0,0 @@
-/***
-*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
deleted file mode 100644
index 8c0266a..0000000
--- a/Dump/hybos/lib/mem/memmove.c
+++ /dev/null
@@ -1,68 +0,0 @@
-/***
-*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
deleted file mode 100644
index 0dfd884..0000000
--- a/Dump/hybos/lib/mem/memset.c
+++ /dev/null
@@ -1,12 +0,0 @@
-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
deleted file mode 100644
index a81ad7a..0000000
--- a/Dump/hybos/lib/mem/memsetw.c
+++ /dev/null
@@ -1,13 +0,0 @@
-
-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
deleted file mode 100644
index 3220a4a..0000000
--- a/Dump/hybos/lib/mem/swab.c
+++ /dev/null
@@ -1,44 +0,0 @@
-/***
-*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
deleted file mode 100644
index 258ee28..0000000
--- a/Dump/hybos/lib/setjmp/Makefile
+++ /dev/null
@@ -1,35 +0,0 @@
-.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
deleted file mode 100644
index af06310..0000000
--- a/Dump/hybos/lib/setjmp/longjmp.c
+++ /dev/null
@@ -1,78 +0,0 @@
-#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
deleted file mode 100644
index dc0ae60..0000000
--- a/Dump/hybos/lib/setjmp/setjmp.asm
+++ /dev/null
@@ -1,35 +0,0 @@
-%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
deleted file mode 100644
index 7956be6..0000000
--- a/Dump/hybos/lib/stdio/.doprintf.c.swp
+++ /dev/null
Binary files differ
diff --git a/Dump/hybos/lib/stdio/Makefile b/Dump/hybos/lib/stdio/Makefile
deleted file mode 100644
index 4d6994b..0000000
--- a/Dump/hybos/lib/stdio/Makefile
+++ /dev/null
@@ -1,38 +0,0 @@
-.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
deleted file mode 100644
index dc9e8ac..0000000
--- a/Dump/hybos/lib/stdio/doprintf.c
+++ /dev/null
@@ -1,357 +0,0 @@
-#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
deleted file mode 100644
index 39b1647..0000000
--- a/Dump/hybos/lib/stdio/printf.c
+++ /dev/null
@@ -1,32 +0,0 @@
-/**
- * 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
deleted file mode 100644
index 586bb6a..0000000
--- a/Dump/hybos/lib/stdio/sprintf.c
+++ /dev/null
@@ -1,19 +0,0 @@
-/**
- * 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
deleted file mode 100644
index 4fd1d3c..0000000
--- a/Dump/hybos/lib/string/Makefile
+++ /dev/null
@@ -1,92 +0,0 @@
-.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
deleted file mode 100644
index 9b87dc5..0000000
--- a/Dump/hybos/lib/string/strcat.c
+++ /dev/null
@@ -1,90 +0,0 @@
-/***
-*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~
deleted file mode 100644
index c46d321..0000000
--- a/Dump/hybos/lib/string/strcat.c~
+++ /dev/null
@@ -1,90 +0,0 @@
-/***
-*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
deleted file mode 100644
index 9a0ca0b..0000000
--- a/Dump/hybos/lib/string/strchr.c
+++ /dev/null
@@ -1,39 +0,0 @@
-/***
-*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
deleted file mode 100644
index 518bb64..0000000
--- a/Dump/hybos/lib/string/strcmp.c
+++ /dev/null
@@ -1,14 +0,0 @@
-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
deleted file mode 100644
index 8922e3b..0000000
--- a/Dump/hybos/lib/string/strcpy.c
+++ /dev/null
@@ -1,7 +0,0 @@
-
-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
deleted file mode 100644
index 95dd844..0000000
--- a/Dump/hybos/lib/string/strcspn.c
+++ /dev/null
@@ -1,69 +0,0 @@
-/***
-*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
deleted file mode 100644
index 50d64b4..0000000
--- a/Dump/hybos/lib/string/stricmp.c
+++ /dev/null
@@ -1,49 +0,0 @@
-/***
-*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
deleted file mode 100644
index d37eb21..0000000
--- a/Dump/hybos/lib/string/strlen.c
+++ /dev/null
@@ -1,11 +0,0 @@
-#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
deleted file mode 100644
index ab61fd3..0000000
--- a/Dump/hybos/lib/string/strncmp.c
+++ /dev/null
@@ -1,15 +0,0 @@
-#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
deleted file mode 100644
index 1de4174..0000000
--- a/Dump/hybos/lib/string/strncpy.c
+++ /dev/null
@@ -1,15 +0,0 @@
-#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
deleted file mode 100644
index 39204c6..0000000
--- a/Dump/hybos/lib/string/strnicmp.c
+++ /dev/null
@@ -1,56 +0,0 @@
-/***
-*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
deleted file mode 100644
index 6911536..0000000
--- a/Dump/hybos/lib/string/strnpst.c
+++ /dev/null
@@ -1,11 +0,0 @@
-
-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
deleted file mode 100644
index f1edada..0000000
--- a/Dump/hybos/lib/string/strnset.c
+++ /dev/null
@@ -1,11 +0,0 @@
-#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
deleted file mode 100644
index 26071e2..0000000
--- a/Dump/hybos/lib/string/strpbrk.c
+++ /dev/null
@@ -1,70 +0,0 @@
-/***
-*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
deleted file mode 100644
index a571764..0000000
--- a/Dump/hybos/lib/string/strpst.c
+++ /dev/null
@@ -1,10 +0,0 @@
-
-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
deleted file mode 100644
index 0a888d7..0000000
--- a/Dump/hybos/lib/string/strrchr.c
+++ /dev/null
@@ -1,46 +0,0 @@
-/***
-*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
deleted file mode 100644
index 6c564ab..0000000
--- a/Dump/hybos/lib/string/strrev.c
+++ /dev/null
@@ -1,47 +0,0 @@
-/***
-*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
deleted file mode 100644
index 4202021..0000000
--- a/Dump/hybos/lib/string/strset.c
+++ /dev/null
@@ -1,10 +0,0 @@
-
-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
deleted file mode 100644
index 7298b5d..0000000
--- a/Dump/hybos/lib/string/strspn.c
+++ /dev/null
@@ -1,75 +0,0 @@
-/***
-*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
deleted file mode 100644
index bc34107..0000000
--- a/Dump/hybos/lib/string/strstr.c
+++ /dev/null
@@ -1,54 +0,0 @@
-/***
-*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
deleted file mode 100644
index afc2c0e..0000000
--- a/Dump/hybos/lib/string/tolower.c
+++ /dev/null
@@ -1,9 +0,0 @@
-
-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
deleted file mode 100644
index 344820b..0000000
--- a/Dump/hybos/lib/string/toupper.c
+++ /dev/null
@@ -1,10 +0,0 @@
-
-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
deleted file mode 100644
index 483190c..0000000
--- a/Dump/hybos/lib/util/Makefile
+++ /dev/null
@@ -1,32 +0,0 @@
-.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
deleted file mode 100644
index c9188a7..0000000
--- a/Dump/hybos/lib/util/rand.c
+++ /dev/null
@@ -1,56 +0,0 @@
-/***
-*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
deleted file mode 100644
index 6532e11..0000000
--- a/Dump/hybos/lib/x86/.inportb.c.swp
+++ /dev/null
Binary files differ
diff --git a/Dump/hybos/lib/x86/Makefile b/Dump/hybos/lib/x86/Makefile
deleted file mode 100644
index 9039ed2..0000000
--- a/Dump/hybos/lib/x86/Makefile
+++ /dev/null
@@ -1,47 +0,0 @@
-.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
deleted file mode 100644
index b31ef49..0000000
--- a/Dump/hybos/lib/x86/disable.c
+++ /dev/null
@@ -1,13 +0,0 @@
-/*****************************************************************************
-*****************************************************************************/
-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
deleted file mode 100644
index bc98632..0000000
--- a/Dump/hybos/lib/x86/enable.c
+++ /dev/null
@@ -1,9 +0,0 @@
-/*****************************************************************************
-*****************************************************************************/
-void enable(void)
-{
- __asm__ __volatile__("sti"
- :
- :
- );
-}
diff --git a/Dump/hybos/lib/x86/inportb.c b/Dump/hybos/lib/x86/inportb.c
deleted file mode 100644
index f3088fe..0000000
--- a/Dump/hybos/lib/x86/inportb.c
+++ /dev/null
@@ -1,11 +0,0 @@
-/*****************************************************************************
-*****************************************************************************/
-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
deleted file mode 100644
index b541d59..0000000
--- a/Dump/hybos/lib/x86/inportw.c
+++ /dev/null
@@ -1,13 +0,0 @@
-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
deleted file mode 100644
index 8346d67..0000000
--- a/Dump/hybos/lib/x86/outportb.c
+++ /dev/null
@@ -1,8 +0,0 @@
-/*****************************************************************************
-*****************************************************************************/
-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
deleted file mode 100644
index 5985172..0000000
--- a/Dump/hybos/lib/x86/outportw.c
+++ /dev/null
@@ -1,9 +0,0 @@
-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
deleted file mode 100644
index b54106a..0000000
--- a/Dump/hybos/src/._krnl.h.swp
+++ /dev/null
Binary files differ
diff --git a/Dump/hybos/src/.debug.c.swp b/Dump/hybos/src/.debug.c.swp
deleted file mode 100644
index d6738a0..0000000
--- a/Dump/hybos/src/.debug.c.swp
+++ /dev/null
Binary files differ
diff --git a/Dump/hybos/src/.kbd.c.swp b/Dump/hybos/src/.kbd.c.swp
deleted file mode 100644
index 977b87d..0000000
--- a/Dump/hybos/src/.kbd.c.swp
+++ /dev/null
Binary files differ
diff --git a/Dump/hybos/src/.krnl1m.ld.swp b/Dump/hybos/src/.krnl1m.ld.swp
deleted file mode 100644
index f95cad1..0000000
--- a/Dump/hybos/src/.krnl1m.ld.swp
+++ /dev/null
Binary files differ
diff --git a/Dump/hybos/src/.main.c.swp b/Dump/hybos/src/.main.c.swp
deleted file mode 100644
index 1dd3750..0000000
--- a/Dump/hybos/src/.main.c.swp
+++ /dev/null
Binary files differ
diff --git a/Dump/hybos/src/.ming.mak.swp b/Dump/hybos/src/.ming.mak.swp
deleted file mode 100644
index feda0c7..0000000
--- a/Dump/hybos/src/.ming.mak.swp
+++ /dev/null
Binary files differ
diff --git a/Dump/hybos/src/.sched.c.swp b/Dump/hybos/src/.sched.c.swp
deleted file mode 100644
index c75ddf3..0000000
--- a/Dump/hybos/src/.sched.c.swp
+++ /dev/null
Binary files differ
diff --git a/Dump/hybos/src/.tasks.c.swp b/Dump/hybos/src/.tasks.c.swp
deleted file mode 100644
index abe0e47..0000000
--- a/Dump/hybos/src/.tasks.c.swp
+++ /dev/null
Binary files differ
diff --git a/Dump/hybos/src/.video.c.swp b/Dump/hybos/src/.video.c.swp
deleted file mode 100644
index 50cb716..0000000
--- a/Dump/hybos/src/.video.c.swp
+++ /dev/null
Binary files differ
diff --git a/Dump/hybos/src/Makefile b/Dump/hybos/src/Makefile
deleted file mode 100644
index ab24d4d..0000000
--- a/Dump/hybos/src/Makefile
+++ /dev/null
@@ -1,18 +0,0 @@
-#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
deleted file mode 100644
index dfca7af..0000000
--- a/Dump/hybos/src/README
+++ /dev/null
@@ -1,20 +0,0 @@
-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
deleted file mode 100644
index 48f19d4..0000000
--- a/Dump/hybos/src/esh/Makefile
+++ /dev/null
@@ -1,34 +0,0 @@
-.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
deleted file mode 100644
index 5df2ced..0000000
--- a/Dump/hybos/src/esh/esh.c
+++ /dev/null
@@ -1,372 +0,0 @@
-/**
- * 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
deleted file mode 100644
index 5de9431..0000000
--- a/Dump/hybos/src/etc/fstab
+++ /dev/null
@@ -1,4 +0,0 @@
-# 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
deleted file mode 100644
index 4c7996a..0000000
--- a/Dump/hybos/src/etc/group
+++ /dev/null
@@ -1,10 +0,0 @@
-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
deleted file mode 100644
index 1560b30..0000000
--- a/Dump/hybos/src/etc/passwd
+++ /dev/null
@@ -1,8 +0,0 @@
-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
deleted file mode 100644
index 741e407..0000000
--- a/Dump/hybos/src/etc/profile
+++ /dev/null
@@ -1,3 +0,0 @@
-# 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
deleted file mode 100644
index 313d915..0000000
--- a/Dump/hybos/src/etc/protocols
+++ /dev/null
@@ -1,19 +0,0 @@
-#
-# 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
deleted file mode 100644
index d9a3a1d..0000000
--- a/Dump/hybos/src/etc/rc
+++ /dev/null
@@ -1,24 +0,0 @@
-# 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
deleted file mode 100644
index 9bcd523..0000000
--- a/Dump/hybos/src/etc/services
+++ /dev/null
@@ -1,85 +0,0 @@
-#
-# 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
deleted file mode 100644
index 15fa36d..0000000
--- a/Dump/hybos/src/etc/shadow
+++ /dev/null
@@ -1 +0,0 @@
-root::0:0:::
diff --git a/Dump/hybos/src/etc/termcap b/Dump/hybos/src/etc/termcap
deleted file mode 100644
index c5f89b4..0000000
--- a/Dump/hybos/src/etc/termcap
+++ /dev/null
@@ -1,64 +0,0 @@
-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
deleted file mode 100644
index cd566f5..0000000
--- a/Dump/hybos/src/etc/ttytab
+++ /dev/null
@@ -1,13 +0,0 @@
-# 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
deleted file mode 100644
index 0de78da..0000000
--- a/Dump/hybos/src/fs/buf.h
+++ /dev/null
@@ -1,31 +0,0 @@
-#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
deleted file mode 100644
index 5e7a2d1..0000000
--- a/Dump/hybos/src/kernel/Makefile
+++ /dev/null
@@ -1,73 +0,0 @@
-.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
deleted file mode 100644
index 8354cca..0000000
--- a/Dump/hybos/src/kernel/_krnl.h
+++ /dev/null
@@ -1,131 +0,0 @@
-#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
deleted file mode 100644
index c03200a..0000000
--- a/Dump/hybos/src/kernel/bootlog.c
+++ /dev/null
@@ -1,78 +0,0 @@
-#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
deleted file mode 100644
index 83c3b86..0000000
--- a/Dump/hybos/src/kernel/bootlog.h
+++ /dev/null
@@ -1,15 +0,0 @@
-#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
deleted file mode 100644
index 4675fda..0000000
--- a/Dump/hybos/src/kernel/cpu.c
+++ /dev/null
@@ -1,1351 +0,0 @@
-/**
- * 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
deleted file mode 100644
index c253857..0000000
--- a/Dump/hybos/src/kernel/debug.c
+++ /dev/null
@@ -1,54 +0,0 @@
-/*============================================================================
-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
deleted file mode 100644
index 495f98a..0000000
--- a/Dump/hybos/src/kernel/keyboard.c
+++ /dev/null
@@ -1,585 +0,0 @@
-/**
- * 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
deleted file mode 100644
index 371e822..0000000
--- a/Dump/hybos/src/kernel/kstart.asm
+++ /dev/null
@@ -1,391 +0,0 @@
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-; 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
deleted file mode 100644
index 4965644..0000000
--- a/Dump/hybos/src/kernel/main.c
+++ /dev/null
@@ -1,728 +0,0 @@
-/**
- * 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
deleted file mode 100644
index ed1b60f..0000000
--- a/Dump/hybos/src/kernel/sched.c
+++ /dev/null
@@ -1,189 +0,0 @@
-/**
- * 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
deleted file mode 100644
index 12f6ac3..0000000
--- a/Dump/hybos/src/kernel/tasks.c
+++ /dev/null
@@ -1,136 +0,0 @@
-/**
- * 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
deleted file mode 100644
index b192ebc..0000000
--- a/Dump/hybos/src/kernel/video.c
+++ /dev/null
@@ -1,445 +0,0 @@
-/**
- * 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
deleted file mode 100644
index 2ee2ccf..0000000
--- a/Dump/hybos/src/keymaps/us-std.h
+++ /dev/null
@@ -1,136 +0,0 @@
-/* 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
deleted file mode 100644
index 8f957cb..0000000
--- a/Dump/hybos/src/krnl1m.ld
+++ /dev/null
@@ -1,55 +0,0 @@
-/* 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
deleted file mode 100644
index d0329f1..0000000
--- a/Dump/hybos/src/mm/Makefile
+++ /dev/null
@@ -1,34 +0,0 @@
-.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
deleted file mode 100644
index 921531d..0000000
--- a/Dump/hybos/src/mm/memory.c
+++ /dev/null
@@ -1,118 +0,0 @@
-#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
deleted file mode 100644
index 0152ca3..0000000
--- a/Dump/hybos/src/objects/kernel.dis
+++ /dev/null
@@ -1,12860 +0,0 @@
-
-../../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