diff --git a/lib/libc_old/sys/mpi_creatembox.S b/lib/libc_old/sys/mpi_creatembox.S new file mode 100644 index 0000000..8cf961e --- /dev/null +++ b/lib/libc_old/sys/mpi_creatembox.S @@ -0,0 +1,7 @@ +.text +.globl mpi_createMbox +.type mpi_createMbox,@function +mpi_createMbox: + movl $50,%eax + int $0x81 + ret diff --git a/lib/libc_old/sys/mpi_fetchmessage.S b/lib/libc_old/sys/mpi_fetchmessage.S new file mode 100644 index 0000000..d24d312 --- /dev/null +++ b/lib/libc_old/sys/mpi_fetchmessage.S @@ -0,0 +1,7 @@ +.text +.globl mpi_fetchMessage +.type mpi_fetchMessage,@function +mpi_fetchMessage: + movl $53,%eax + int $0x81 + ret diff --git a/lib/libc_old/sys/mpi_postmessage.S b/lib/libc_old/sys/mpi_postmessage.S new file mode 100644 index 0000000..c6958a0 --- /dev/null +++ b/lib/libc_old/sys/mpi_postmessage.S @@ -0,0 +1,7 @@ +.text +.globl mpi_postMessage +.type mpi_postMessage,@function +mpi_postMessage: + movl $52,%eax + int $0x81 + ret diff --git a/lib/objgfx40/ogFont.cpp b/lib/objgfx40/ogFont.cpp index 4edab4d..aa5af28 100644 --- a/lib/objgfx40/ogFont.cpp +++ b/lib/objgfx40/ogFont.cpp @@ -5,6 +5,7 @@ #ifdef __UBIXOS_KERNEL__ #include #include +#include #else #include #include @@ -118,7 +119,7 @@ bool ogBitFont::Load(const char* fontFile, uint32_t offset = 0) { #ifdef __UBIXOS_KERNEL__ - fileDescriptor * infile; + fileDescriptor_t *infile; #else FILE * infile; #endif @@ -127,7 +128,7 @@ delete[] fontData; - infile = fopen(fontFile, "rb"); + infile = fopen(fontFile, "r"); //fseek(infile, offset, SEEK_SET); @@ -138,6 +139,7 @@ if (numOfChars == 0) numOfChars = 256; + startingChar = header.startingChar; memset(fontDataIdx, 0, sizeof(fontDataIdx)); @@ -151,6 +153,7 @@ charWidthTable[tmp] = width; charHeightTable[tmp] = height; fontDataIdx[tmp] = (size * (tmp - startingChar)); + //kprintf("fontDataIdx[%i]", tmp); } // for tmp fontData = new uint8_t[fontDataSize]; diff --git a/sys/i386/bios16code.S b/sys/i386/bios16code.S new file mode 100644 index 0000000..b86ee01 --- /dev/null +++ b/sys/i386/bios16code.S @@ -0,0 +1,5 @@ +.globl bios16Code +bios16Code: +.code16 +int $0x10 +int $0x69 diff --git a/sys/include/sde/ogDisplay_UbixOS.h b/sys/include/sde/ogDisplay_UbixOS.h index 7d67375..8726d07 100755 --- a/sys/include/sde/ogDisplay_UbixOS.h +++ b/sys/include/sde/ogDisplay_UbixOS.h @@ -29,89 +29,86 @@ #ifndef OGDISPLAY_UBIXOS_H #define OGDISPLAY_UBIXOS_H -extern "C" { #include -} - #include struct ogModeInfo { - uInt16 modeAttributes __attribute__((packed)); - uInt8 windowAFlags __attribute__((packed)); - uInt8 windowBFlags __attribute__((packed)); - uInt16 granularity __attribute__((packed)); - uInt16 windowSize __attribute__((packed)); - uInt16 windowASeg __attribute__((packed)); - uInt16 windowBSeg __attribute__((packed)); + uint16_t modeAttributes __attribute__((packed)); + uint8_t windowAFlags __attribute__((packed)); + uint8_t windowBFlags __attribute__((packed)); + uint16_t granularity __attribute__((packed)); + uint16_t windowSize __attribute__((packed)); + uint16_t windowASeg __attribute__((packed)); + uint16_t windowBSeg __attribute__((packed)); void* bankSwitch __attribute__((packed)); - uInt16 bytesPerLine __attribute__((packed)); - uInt16 xRes __attribute__((packed)); - uInt16 yRes __attribute__((packed)); - uInt8 charWidth __attribute__((packed)); - uInt8 charHeight __attribute__((packed)); - uInt8 numBitPlanes __attribute__((packed)); - uInt8 bitsPerPixel __attribute__((packed)); - uInt8 numberOfBanks __attribute__((packed)); - uInt8 memoryModel __attribute__((packed)); - uInt8 bankSize __attribute__((packed)); - uInt8 numOfImagePages __attribute__((packed)); - uInt8 reserved __attribute__((packed)); + uint16_t bytesPerLine __attribute__((packed)); + uint16_t xRes __attribute__((packed)); + uint16_t yRes __attribute__((packed)); + uint8_t charWidth __attribute__((packed)); + uint8_t charHeight __attribute__((packed)); + uint8_t numBitPlanes __attribute__((packed)); + uint8_t bitsPerPixel __attribute__((packed)); + uint8_t numberOfBanks __attribute__((packed)); + uint8_t memoryModel __attribute__((packed)); + uint8_t bankSize __attribute__((packed)); + uint8_t numOfImagePages __attribute__((packed)); + uint8_t reserved __attribute__((packed)); // Direct colour fields (required for Direct/6 and YUV/7 memory models - uInt8 redMaskSize __attribute__((packed)); - uInt8 redFieldPosition __attribute__((packed)); - uInt8 greenMaskSize __attribute__((packed)); - uInt8 greenFieldPosition __attribute__((packed)); - uInt8 blueMaskSize __attribute__((packed)); - uInt8 blueFieldPosition __attribute__((packed)); - uInt8 alphaMaskSize __attribute__((packed)); - uInt8 alphaFieldPosition __attribute__((packed)); - uInt8 directColourMode __attribute__((packed)); + uint8_t redMaskSize __attribute__((packed)); + uint8_t redFieldPosition __attribute__((packed)); + uint8_t greenMaskSize __attribute__((packed)); + uint8_t greenFieldPosition __attribute__((packed)); + uint8_t blueMaskSize __attribute__((packed)); + uint8_t blueFieldPosition __attribute__((packed)); + uint8_t alphaMaskSize __attribute__((packed)); + uint8_t alphaFieldPosition __attribute__((packed)); + uint8_t directColourMode __attribute__((packed)); // VESA 2.0 specific fields - uInt32 physBasePtr __attribute__((packed)); + uint32_t physBasePtr __attribute__((packed)); void* offScreenMemOffset __attribute__((packed)); - uInt16 offScreenMemSize __attribute__((packed)); - uInt8 paddington[461] __attribute__((packed)); + uint16_t offScreenMemSize __attribute__((packed)); + uint8_t paddington[461] __attribute__((packed)); }; struct ogVESAInfo { char VBESignature[4] __attribute__((packed)); - uInt8 minVersion __attribute__((packed)); - uInt8 majVersion __attribute__((packed)); - uInt32 OEMStringPtr __attribute__((packed)); - uInt32 capabilities __attribute__((packed)); - uInt32 videoModePtr __attribute__((packed)); - uInt16 totalMemory __attribute__((packed)); + uint8_t minVersion __attribute__((packed)); + uint8_t majVersion __attribute__((packed)); + uint32_t OEMStringPtr __attribute__((packed)); + uint32_t capabilities __attribute__((packed)); + uint32_t videoModePtr __attribute__((packed)); + uint16_t totalMemory __attribute__((packed)); // VESA 2.0 specific fields - uInt16 OEMSoftwareRev __attribute__((packed)); - uInt32 OEMVendorNamePtr __attribute__((packed)); - uInt32 OEMProductNamePtr __attribute__((packed)); - uInt32 OEMProductRevPtr __attribute__((packed)); - uInt8 paddington[474] __attribute__((packed)); + uint16_t OEMSoftwareRev __attribute__((packed)); + uint32_t OEMVendorNamePtr __attribute__((packed)); + uint32_t OEMProductNamePtr __attribute__((packed)); + uint32_t OEMProductRevPtr __attribute__((packed)); + uint8_t paddington[474] __attribute__((packed)); }; class ogDisplay_UbixOS: public ogSurface { protected: void * pages[2]; - uInt32 activePage; - uInt32 visualPage; + uint32_t activePage; + uint32_t visualPage; ogVESAInfo * VESAInfo; ogModeInfo * modeInfo; - uInt16 FindMode(uInt32, uInt32, uInt32); - void GetModeInfo(uInt16); + uint16_t FindMode(uint32_t, uint32_t, uint32_t); + void GetModeInfo(uint16_t); void GetVESAInfo(void); - void SetMode(uInt16); + void SetMode(uint16_t); void SetPal(void); public: ogDisplay_UbixOS(void); - virtual bool ogAlias(ogSurface&, uInt32, uInt32, uInt32, uInt32); + virtual bool ogAlias(ogSurface&, uint32_t, uint32_t, uint32_t, uint32_t); virtual bool ogClone(ogSurface&); virtual void ogCopyPalette(ogSurface&); - virtual bool ogCreate(uInt32, uInt32, ogPixelFmt); + virtual bool ogCreate(uint32_t, uint32_t, ogPixelFmt); virtual bool ogLoadPalette(const char *); virtual void ogSetPalette(const ogRGBA8[]); - virtual void ogSetPalette(uInt8, uInt8, uInt8, uInt8); - virtual void ogSetPalette(uInt8, uInt8, uInt8, uInt8, uInt8); + virtual void ogSetPalette(uint8_t, uint8_t, uint8_t, uint8_t); + virtual void ogSetPalette(uint8_t, uint8_t, uint8_t, uint8_t, uint8_t); virtual ~ogDisplay_UbixOS(void); }; // ogDisplay_UbixOS diff --git a/sys/include/sde/sde.h b/sys/include/sde/sde.h index 95d0222..a16a911 100644 --- a/sys/include/sde/sde.h +++ b/sys/include/sde/sde.h @@ -28,12 +28,12 @@ #ifndef _SDE_SDE_H #define _SDE_SDE_H +#include + #ifdef __cplusplus extern "C" { #endif -#include - #define registerWindow 1 #define windowReady 2 #define drawWindow 3 diff --git a/sys/init/start.S b/sys/init/start.S index d835596..830a02f 100644 --- a/sys/init/start.S +++ b/sys/init/start.S @@ -53,7 +53,7 @@ mov %eax,%gs mov %eax,%ss mov $kStack,%eax - addl $0x2000,%eax + addl $0x1000,%eax mov %esp,%edx mov %eax,%esp mov %eax,%ebp @@ -73,4 +73,4 @@ subl $0xE,%esp; call kmain .data -.comm kStack,0x2000 +.comm kStack,0x1000 diff --git a/sys/kernel/vfs_calls.c b/sys/kernel/vfs_calls.c index edebc3a..2bf501d 100644 --- a/sys/kernel/vfs_calls.c +++ b/sys/kernel/vfs_calls.c @@ -102,7 +102,7 @@ if ( c != 0x0 ) { buf[x++] = c; bf[0] = c; - kprint(bf); + kprintf(bf); } if ( c == '\n') { @@ -121,7 +121,7 @@ buf[x++] = '\n'; bf[0] = '\n'; - kprint(bf); + kprintf(bf); //MROlsen 2018 kprintf("READ: %i", x); @@ -137,7 +137,7 @@ buffer = kmalloc(1024); memcpy(buffer, uap->buf, uap->nbyte); printColor += 1; - kprint(buffer); + kprintf(buffer); printColor = defaultColor; kfree(buffer); td->td_retval[0] = uap->nbyte; @@ -145,7 +145,7 @@ else if (uap->fd == 1) { buffer = kmalloc(1024); memcpy(buffer, uap->buf, uap->nbyte); - kprint(buffer); + kprintf(buffer); kfree(buffer); td->td_retval[0] = uap->nbyte; } diff --git a/sys/lib/kprintf.c b/sys/lib/kprintf.c index 4cf64d5..66d096a 100644 --- a/sys/lib/kprintf.c +++ b/sys/lib/kprintf.c @@ -259,7 +259,7 @@ int kprintf(const char *fmt, ...) { va_list ap; int retval; - char buf[1024]; + char buf[512]; va_start(ap, fmt); diff --git a/sys/sde/Makefile b/sys/sde/Makefile index d01a088..b48edbb 100644 --- a/sys/sde/Makefile +++ b/sys/sde/Makefile @@ -12,8 +12,7 @@ REMOVE = rm -fr # Objects -OBJS = objgfx40.o ogFont.o ogPixelFmt.o ogPixCon.o ogDisplay_UbixOS.o sde.o main.o -# colours.o +OBJS = objgfx40.o ogFont.o ogPixelFmt.o ogPixCon.o ogDisplay_UbixOS.o sde.o main.o colours.o CFLAGS += -fno-rtti -nostdinc++ diff --git a/sys/sde/colours.cc b/sys/sde/colours.cc index 49b9695..3a487a7 100644 --- a/sys/sde/colours.cc +++ b/sys/sde/colours.cc @@ -26,7 +26,6 @@ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -extern "C" { #include #include #include @@ -34,7 +33,7 @@ #include #include -#include +#include #include #include #include @@ -115,5 +114,3 @@ } // while } // sdeTestThread - -} diff --git a/sys/sde/main.cc b/sys/sde/main.cc index 442c738..b6c2476 100644 --- a/sys/sde/main.cc +++ b/sys/sde/main.cc @@ -26,14 +26,17 @@ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +//#include +//#include +//#include +//#include + extern "C" { -#include -#include #include #include +#include #include -#include -#include +#include } #include @@ -41,7 +44,11 @@ #include #include -extern "C" void sdeThread() { +void sdeTestThread(); + +extern "C" void sdeThread(); + +void sdeThread() { ogSurface *screen = new ogDisplay_UbixOS(); @@ -66,6 +73,8 @@ screen->ogSetAntiAliasing(false); + execThread(&sdeTestThread, 0x2000, 0x0); + //ogSurface::RawLine(100, 100, 200, 200, 0xDEADBEEF) screen->RawLine(100, 100, 200, 200, 0xDEADBEEF); @@ -112,7 +121,6 @@ } vmm_unmapPages(buf->buffer, buf->bSize, VMM_KEEP); vmm_unmapPages(buf->lineOfs, buf->lSize, VMM_KEEP); - //kfree(tmp->buf); kfree(tmp); tmp = 0x0; break; diff --git a/sys/sde/ogDisplay_UbixOS.cc b/sys/sde/ogDisplay_UbixOS.cc index 5829d55..4c069eb 100755 --- a/sys/sde/ogDisplay_UbixOS.cc +++ b/sys/sde/ogDisplay_UbixOS.cc @@ -29,14 +29,14 @@ #include #include #include -#include + +extern "C" { #include -#include #include -#include -#include -#include +#include #include +#include +} /* *