diff --git a/Dump/hybos/__experimental/dos.c~ b/Dump/hybos/__experimental/dos.c~ deleted file mode 100644 index 0ce7f4a..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/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/esh/esh.h~ b/Dump/hybos/include/esh/esh.h~ deleted file mode 100644 index 06508e7..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/signal.h~ b/Dump/hybos/include/signal.h~ deleted file mode 100644 index d70f0a6..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/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/string/strcat.c~ b/Dump/hybos/lib/string/strcat.c~ deleted file mode 100644 index a05385e..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/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/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