diff --git a/bin/Makefile b/bin/Makefile index 44e55cc..4504a22 100644 --- a/bin/Makefile +++ b/bin/Makefile @@ -1,6 +1,6 @@ # System Makefile (C) 2002 The UbixOS Project -all: init-bin login-bin shell-bin clock-bin cp-bin fdisk-bin format-bin disklabel-bin ubistry-bin ttyd-bin stat-bin muffin-bin ls-bin +all: init-bin login-bin shell-bin clock-bin cp-bin fdisk-bin format-bin disklabel-bin ubistry-bin ttyd-bin stat-bin muffin-bin ls-bin port-bin # MrOlsen (2016-01-11) ERROR: weird it didnt like -elf rtld-elf-bin # MrOlsen (2016-01-11) NOTE: edit-bin # test-bin pwd-bin de-bin ls-bin goofball-bin mount-bin @@ -70,6 +70,9 @@ sh-bin: sh (cd sh;make) + +port-bin: port + (cd port;make) clean: (cd cp;make clean) @@ -87,3 +90,4 @@ (cd ttyd;make clean) (cd stat;make clean) (cd mount;make clean) + (cd port;make clean) diff --git a/bin/port/Makefile b/bin/port/Makefile new file mode 100644 index 0000000..750278f --- /dev/null +++ b/bin/port/Makefile @@ -0,0 +1,49 @@ +# $Id: Makefile 115 2016-01-14 02:55:19Z reddawg $ +# Application Makefile (C) 2002-2004 The UbixOS Project + +# Include Global 'Source' Options +include ../../Makefile.incl +include ../Makefile.incl + +#Linker +LD = ld + +#Binary File Name +BINARY = port + +#Delete Program +REMOVE = rm -f + +#Objects +OBJS = main.o + +INCLUDES = -I../../include.new + +LIBRARIES = ../../lib/libc/libc.so + +STARTUP = ../../lib/csu/*.o + +# Link The Binary +$(BINARY) : $(OBJS) + $(CC) $(CFLAGS) -o $(BUILD_DIR)/bin/$@ $(STARTUP) $(LIBRARIES) $(OBJS) + #strip $(BINARY) + +# Compile the source files +.cc.o: + $(CXX) -Wall -O $(CFLAGS) $(INCLUDES) -c -o $@ $< + +.cc.s: + $(CXX) -Wall -O $(CFLAGS) $(INCLUDES) -S -o $@ $< + +.c.o: + $(CC) -Wall -O $(CFLAGS) $(INCLUDES) -c -o $@ $< + +.c.s: + $(CC) -Wall -O $(CFLAGS) $(INCLUDES) -S -o $@ $< + +.S.o: + $(CC) -Wall $(CLFAGS) $(INCLUDES) -c -o $@ $< + +# Clean Up The junk +clean: + $(REMOVE) $(OBJS) $(BUILD_DIR)/bin/$(BINARY) diff --git a/bin/port/main.c b/bin/port/main.c new file mode 100644 index 0000000..fcfade3 --- /dev/null +++ b/bin/port/main.c @@ -0,0 +1,59 @@ +/*- + * Copyright (c) 2002-2018 The UbixOS Project. + * All rights reserved. + * + * This was developed by Christopher W. Olsen for the UbixOS Project. + * + * Redistribution and use in source and binary forms, with or without modification, are permitted + * provided that the following conditions are met: + * + * 1) Redistributions of source code must retain the above copyright notice, this list of + * conditions, the following disclaimer and the list of authors. + * 2) Redistributions in binary form must reproduce the above copyright notice, this list of + * conditions, the following disclaimer and the list of authors in the documentation and/or + * other materials provided with the distribution. + * 3) Neither the name of the UbixOS Project nor the names of its contributors may be used to + * endorse or promote products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, + * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +#include + +int main(int argc, char **argv) { + extern char *environ; + char in[1024]; + FILE *out; + size_t count = 0x0; + printf("UbixOS Text Editor\n"); + printf("V1.0\n"); + printf("ARGC: [%i]\n", argc); + printf("ARGV[0]: [%s]\n", argv[0]); + + out = fopen("/test.txt", "r"); + + while (!feof(out)) { + printf("%c", fgetc(out)); + } + + //printf("[%S]",getenv("TEST")); + printf("\nENV TEST: [0x%X]\n", environ); + setenv("BLAH", "WOOT", 1); + printf("[%s]", getenv("BLAH")); + + return (0); +} + +/*** + END + ***/ + diff --git a/sys/isa/atkbd.c b/sys/isa/atkbd.c index f47b61c..0b369fd 100644 --- a/sys/isa/atkbd.c +++ b/sys/isa/atkbd.c @@ -53,13 +53,13 @@ static struct spinLock atkbdSpinLock = SPIN_LOCK_INITIALIZER; static unsigned int keyboardMap[255][8] = { -/* Ascii, Shift, Ctrl, Alt, Num, Caps, Shift Caps, Shift Num */ -{ 0, 0, 0, 0, 0, 0, 0, 0 }, +/* Ascii, Shift, Ctrl, Alt, Num, Caps, Shift Caps, Shift Num */ +/* */{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, /* ESC */{ 0x1B, 0x1B, 0x1B, 0x1B, 0x1B, 0x1B, 0x1B, 0x1B }, -/* 1,! */{ 0x31, 0x21, 0, 0, 0x31, 0x31, 0x21, 0x21 }, -/* 2,@ */{ 0x32, 0x40, 0, 0, 0x32, 0x32, 0x40, 0x40 }, -/* 3,# */{ 0x33, 0x23, 0, 0, 0x33, 0x33, 0x23, 0x23 }, -/* 4,$ */{ 0x34, 0x24, 0, 0, 0x34, 0x34, 0x24, 0x24 }, +/* 1,! */{ 0x31, 0x21, 0x00, 0x00, 0x31, 0x31, 0x21, 0x21 }, +/* 2,@ */{ 0x32, 0x40, 0x00, 0x00, 0x32, 0x32, 0x40, 0x40 }, +/* 3,# */{ 0x33, 0x23, 0x00, 0x00, 0x33, 0x33, 0x23, 0x23 }, +/* 4,$ */{ 0x34, 0x24, 0x00, 0x00, 0x34, 0x34, 0x24, 0x24 }, /* 5,% */{ 0x35, 0x25, 0, 0, 0x35, 0x35, 0x25, 0x25 }, /* 6,^ */{ 0x36, 0x5E, 0, 0, 0x36, 0x36, 0x5E, 0x5E }, /* 7,& */{ 0x37, 0x26, 0, 0, 0x37, 0x37, 0x26, 0x26 }, @@ -154,23 +154,24 @@ ************************************************************************/ int atkbd_init() { - /* Insert the IDT vector for the keyboard handler */ - setVector(&atkbd_isr, mVec + 0x1, dPresent + dInt + dDpl0); + /* Insert the IDT vector for the keyboard handler */ + setVector(&atkbd_isr, mVec + 0x1, dPresent + dInt + dDpl0); - /* Set the LEDS to their defaults */ - setLED(); + /* Set the LEDS to their defaults */ + setLED(); - /* Clear Keyboard */ - atkbd_scan(); + /* Clear Keyboard */ + atkbd_scan(); - /* Turn on the keyboard vector */ - irqEnable(0x1); + /* Turn on the keyboard vector */ + irqEnable(0x1); - /* Print out information on keyboard */ - kprintf("atkbd0 - Address: [0x%X], Keyboard Buffer: [0x%X], Buffer Size [%i]\n", &atkbd_isr, &stdinBuffer, 512); + /* Print out information on keyboard */ + kprintf("atkbd0 - Address: [0x%X], Keyboard Buffer: [0x%X], Buffer Size [%i]\n", &atkbd_isr, &stdinBuffer, 512); - /* Return so we know everything went well */ - return (0x0); + /* Return so we know everything went well */ + return (0x0); + } /*