diff --git a/bin/muffin/Makefile b/bin/muffin/Makefile index bbcf2e7..062e4c0 100644 --- a/bin/muffin/Makefile +++ b/bin/muffin/Makefile @@ -3,11 +3,11 @@ # Include Global 'Source' Options #include ../../Makefile.incl -#include ../Makefile.incl +include ../Makefile.incl #Compiler Flags -CFLAGS = -# -DNOBOOL -fno-builtin -fno-exceptions +CFLAGS = -g + # -DNOBOOL -fno-builtin -fno-exceptions #Linker LD = ld @@ -22,24 +22,24 @@ OBJS = main.o #Libraries -LIBRARIES2 = ../../lib/objgfx/*.o -lstdc++ -lm +LIBRARIES2=../../lib/objgfx/*.o -lstdc++ -lm #Include -INCLUDE = -I../../lib/objgfx +INCLUDE2=-I../../lib/objgfx STARTUP= # Link The Binary $(BINARY) : $(OBJS) - $(CC) $(CFLAGS) -o $@ $(STARTUP) $(LIBRARIES) $(LIBRARIES2) $(OBJS) - strip $(BINARY) + $(CC) $(CFLAGS) -o ${BUILD_DIR}/bin/$@ $(STARTUP) $(LIBRARIES) $(LIBRARIES2) $(OBJS) + #strip $(BINARY) # Compile the source files .cc.o: - $(CXX) -Wall -fomit-frame-pointer -O $(CFLAGS) $(INCLUDE) -c -o $@ $< + $(CXX) -Wall -fomit-frame-pointer -O $(CFLAGS) $(INCLUDE2) -c -o $@ $< .cc.s: - $(CXX) -Wall -fomit-frame-pointer -O $(CFLAGS) $(INCLUDE) -S -o $@ $< + $(CXX) -Wall -fomit-frame-pointer -O $(CFLAGS) $(INCLUDE2) -S -o $@ $< .c.o: $(CC) -Wall -O $(CFLAGS) $(INCLUDE) -c -o $@ $< diff --git a/bin/muffin/main.cc b/bin/muffin/main.cc index 8cc6694..9df77eb 100644 --- a/bin/muffin/main.cc +++ b/bin/muffin/main.cc @@ -36,20 +36,24 @@ int main() { vWindow *window = new vWindow(); - uInt16 i = 0x0; - uInt16 ii = 0x0; - uInt16 iii = 0x0; + + uint16_t i = 0x0; + uint16_t ii = 0x0; + uint16_t iii = 0x0; + //if (fork() == 0x0) { window->vCreate(); window->vSDECommand(1); ogImage * image = new ogImage(); ogSurface * bgImage = new ogSurface(); -//image->Load("/ubixos/var/background/ringed800_600.bmp", *bgImage); -image->Load("/ubixos/var/background/sphere800x600.bmp", *bgImage); +image->Load("/var/background/ringed800_600.bmp", *bgImage); +//image->Load("/var/background/sphere800x600.bmp", *bgImage); + + window->ogCopy(*bgImage); - window->vSDECommand(3); -while(1) - asm("nop"); +window->vSDECommand(3); +return(0); + while (1) { for (i=0x2;i<0xFF;i += 16) { for (ii=0x0;ii<0xFF;ii+= 16) { @@ -61,12 +65,16 @@ window->ogFillRect(150, 50, 200, 100, window->ogPack(0, 0, 255)); window->ogFillRect(200, 50, 250, 100, window->ogPack(0, 0, 0)); window->ogFillRect(250, 50, 300, 100, window->ogPack(255, 255, 255)); + printf("ogGetMaxX: %i, ogGetMaxY: %i\n", window->ogGetMaxX(), window->ogGetMaxY()); window->vSDECommand(3); } } } } + window->vSDECommand(4); + //} + return(0); } diff --git a/lib/Makefile b/lib/Makefile index 3a2853e..8127688 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -1,7 +1,7 @@ # $Id: Makefile 121 2016-01-14 03:18:20Z reddawg $ # The System Makefile (C) 2002 The UbixOS Project -all: csu-code ubix_api-code libc_old-code ubix-code libcpp-code objgfx40-code #libc-code# libcpp-code +all: csu-code ubix_api-code libc_old-code ubix-code libcpp-code objgfx-code #libc-code# libcpp-code # bin tools # depend kernel tools @@ -17,8 +17,8 @@ libc-code: libc (cd libc;make) -objgfx40-code: objgfx40 - (cd objgfx40;make) +objgfx-code: objgfx + (cd objgfx;make) views: src (cd src/lib/views/sunlight;make) diff --git a/lib/objgfx/Makefile b/lib/objgfx/Makefile index 6c3f125..fb587c6 100644 --- a/lib/objgfx/Makefile +++ b/lib/objgfx/Makefile @@ -13,7 +13,7 @@ #ogBlit.o #Include -INCLUDE = -I./objgfx +INCLUDE2 = -I./objgfx # -I../../lib/libc/include -I../../lib/libcpp/include #Output @@ -24,7 +24,7 @@ # Compile the source files .cpp.o: - $(CXX) -Wall -g -fno-inline -fno-exceptions -std=c++11 $(INCLUDE) -c -o $@ $< + $(CXX) -Wall -g -fno-inline -fno-exceptions -std=c++11 $(INCLUDE2) -c -o $@ $< .cc.o: $(CXX) -Wall -fomit-frame-pointer -std=c++11 -c -o $@ $< diff --git a/lib/objgfx/objgfx40.so b/lib/objgfx/objgfx40.so index 73d6ecd..6b44178 100755 --- a/lib/objgfx/objgfx40.so +++ b/lib/objgfx/objgfx40.so Binary files differ diff --git a/lib/objgfx/vWindow.cpp b/lib/objgfx/vWindow.cpp index afef9b1..a99ee42 100644 --- a/lib/objgfx/vWindow.cpp +++ b/lib/objgfx/vWindow.cpp @@ -10,20 +10,22 @@ return; } // vWindow::vWindow -bool -vWindow::vCreate(void) { - if (realWindow->ogCreate(800,600,OG_PIXFMT_24BPP) == false) return false; - if (ogAlias(*realWindow, // window - 0, 0, // [x1, y1] - realWindow->ogGetMaxX(), realWindow->ogGetMaxY()) // [x2, y2] - == false) return false; +bool vWindow::vCreate(void) { + if (realWindow->ogCreate(800,600,OG_PIXFMT_24BPP) == false) { + return false; + } + + if (ogAlias(*realWindow, 0, 0, realWindow->ogGetMaxX(), realWindow->ogGetMaxY()) == false) { + return false; + } + return true; } // vWindow::vCreate -//void vWindow::vSDECommand(uint32_t command); - extern "C" { -void vSDECmd(uint32_t command, void *realWindow); + +void vSDECmd(uint32_t command, uint32_t rwAddr); + asm( ".globl vSDECmd\n" "vSDECmd:\n" @@ -31,20 +33,26 @@ "int $0x81\n" "ret\n" ); + } - void vWindow::vSDECommand(uint32_t command) { -printf("REAL WINDOW: 0x%X\n", realWindow); + uint32_t rwAddr = (uint32_t)realWindow; + printf("\nREAL WINDOW: 0x%X:0x%X:0x%X\n", &realWindow, realWindow, rwAddr); + + /* asm( - "pushl %%ebx\n" - "pushl %%ecx\n" - "int %0\n" - "add $0x8, %%esp\n" - : - : "i" (0x81),"a" (40),"b" (command),"c" (realWindow) - ); -//vSDECmd(command, realWindow); + "pushl %%ebx\n" + "pushl %%ecx\n" + "int %0\n" + "add $0x8, %%esp\n" + : + : "i" (0x81),"a" (40),"b" (command),"c" (rwAddr) + ); + */ + + vSDECmd(command, rwAddr); + return; } // vWindow::vSDECommand diff --git a/sys/include/sys/sysproto.h b/sys/include/sys/sysproto.h index 8c77888..678756a 100644 --- a/sys/include/sys/sysproto.h +++ b/sys/include/sys/sysproto.h @@ -81,9 +81,9 @@ char cmd_l_[PADL_(uint32_t)]; uint32_t cmd; char cmd_r_[PADR_(uint32_t)]; - char ptr_l_[PADL_(void *)]; - void *ptr; - char ptr_r_[PADR_(void *)]; + char ptr_l_[PADL_(uint32_t)]; + uint32_t ptr; + char ptr_r_[PADR_(uint32_t)]; }; diff --git a/sys/sde/main.cc b/sys/sde/main.cc index d00dcb4..1eb5937 100644 --- a/sys/sde/main.cc +++ b/sys/sde/main.cc @@ -112,7 +112,7 @@ buf = (ogSurface *) tmp->buf; screen->ogCopyBuf(screen->ogGetMaxX() - buf->ogGetMaxX(), screen->ogGetMaxY() - buf->ogGetMaxY(), *buf, 0, 0, buf->ogGetMaxX(), buf->ogGetMaxY()); tmp->status = windowReady; - //kprintf("Draw Window Routines Here\n"); + kprintf("Draw Window Routines Here: %i-%i\n", buf->ogGetMaxX(), buf->ogGetMaxY()); break; case killWindow: //kprintf("Killed Window\n"); diff --git a/sys/sde/sde.cc b/sys/sde/sde.cc index 157bc80..bbc75dd 100644 --- a/sys/sde/sde.cc +++ b/sys/sde/sde.cc @@ -30,21 +30,28 @@ #include #include #include +#include #include #include #include } #include +#include #include struct sdeWindows *windows = 0x0; -//extern "C" void sysSDE(uInt32 cmd, void *ptr) { extern "C" int sysSDE(struct thread *td, struct sys_sde_args *args) { + ogSurface *newBuf = 0x0; - ogSurface *oldBuf = (ogSurface *) args->ptr; + ogSurface *oldBuf = (ogSurface *)args->ptr; + ogSurface *screen = 0x0; + struct sdeWindows *tmp = 0x0; + + screen = (ogDisplay_UbixOS *) systemVitals->screen; + kprintf("\nCMD: %i:0x%X\n", args->cmd, args->ptr); for (tmp = windows; tmp; tmp = tmp->next) { @@ -57,14 +64,22 @@ asm("hlt"); } else if (tmp == 0x0 && args->cmd != registerWindow) { + if (args->cmd == drawWindow) { + screen->ogCopyBuf(screen->ogGetMaxX() - oldBuf->ogGetMaxX(), screen->ogGetMaxY() - oldBuf->ogGetMaxY(), *oldBuf, 0, 0, oldBuf->ogGetMaxX(), oldBuf->ogGetMaxY()); + kprintf("sX: %i, oX: %i, sY: %i, oY: %i", screen->ogGetMaxX(), oldBuf->ogGetMaxX(), screen->ogGetMaxY(), oldBuf->ogGetMaxY()); + } + kprintf("Invalid Window\n"); td->td_retval[0] = -1; return(-1); } - switch (args->cmd) { case drawWindow: + screen->ogCopyBuf(screen->ogGetMaxX() - oldBuf->ogGetMaxX(), screen->ogGetMaxY() - oldBuf->ogGetMaxY(), *oldBuf, 0, 0, oldBuf->ogGetMaxX(), oldBuf->ogGetMaxY()); + kprintf("Draw Window\n"); + while(1) asm("nop"); + tmp->status = drawWindow; while (tmp->status != windowReady) { asm("nop"); @@ -75,6 +90,7 @@ tmp->status = killWindow; break; case registerWindow: + /* if (oldBuf->buffer != 0x0) { newBuf = new ogSurface(); newBuf->version = oldBuf->version; @@ -120,12 +136,13 @@ else { kprintf("Invalid Window\n"); } + */ break; default: kprintf("Invalid SDE Command [0x%X]\n", args->ptr); break; } - kprintf("Here"); + td->td_retval[0] = 0; return(0); } diff --git a/sys/vmm/paging.c b/sys/vmm/paging.c index 79f328a..40fda37 100644 --- a/sys/vmm/paging.c +++ b/sys/vmm/paging.c @@ -436,7 +436,7 @@ } if ((childPageDir[dI] & PAGE_PRESENT) == PAGE_PRESENT) { - kprintf("dI: 0x%X\n", dI); + //kprintf("dI: 0x%X\n", dI); childPageTable = (uint32_t *) (0x5A01000 + (0x1000 * dI)); if ((childPageTable[tI + c] & PAGE_PRESENT) == PAGE_PRESENT) { @@ -462,7 +462,7 @@ //Map A Physical Page To The Virtual Page childPageTable = (uint32_t *) (0x5A01000 + (0x1000 * dI)); if ((childPageDir[dI] & PAGE_PRESENT) == PAGE_PRESENT) { - kprintf("eDI: 0x%X", dI); + //kprintf("eDI: 0x%X", dI); if ((childPageTable[tI] & PAGE_PRESENT) == PAGE_PRESENT) { if (vmm_remapPage(childPageTable[tI], ((x * (1024 * 4096)) + (y * 4096)), KERNEL_PAGE_DEFAULT, _current->id, 0) == 0x0) K_PANIC("remap Failed");