From: John Hodge Date: Thu, 17 Feb 2011 13:19:33 +0000 (+0800) Subject: Fixed `make install` issues, bugs with VESA X-Git-Tag: rel0.07 X-Git-Url: https://git.ucc.asn.au/?a=commitdiff_plain;h=4b59aea79be4992af2b1c38ea43f6dacf939d782;p=tpg%2Facess2.git Fixed `make install` issues, bugs with VESA --- diff --git a/Kernel/drv/vterm.c b/Kernel/drv/vterm.c index db56f0e7..3e47f939 100644 --- a/Kernel/drv/vterm.c +++ b/Kernel/drv/vterm.c @@ -1328,34 +1328,113 @@ int giVT_CharHeight = FONT_HEIGHT; // === CODE === /** - * \fn void VT_Font_Render(Uint32 Codepoint, void *Buffer, int Pitch, Uint32 BGC, Uint32 FGC) * \brief Render a font character */ -void VT_Font_Render(Uint32 Codepoint, void *Buffer, int Pitch, Uint32 BGC, Uint32 FGC) +void VT_Font_Render(Uint32 Codepoint, void *Buffer, int Depth, int Pitch, Uint32 BGC, Uint32 FGC) { Uint8 *font; - Uint32 *buf = Buffer; int x, y; - font = VT_Font_GetChar(Codepoint); - - for(y = 0; y < FONT_HEIGHT; y ++) + // 8-bpp and below + if( Depth <= 8 ) { - for(x = 0; x < FONT_WIDTH; x ++) + Uint8 *buf = Buffer; + + font = VT_Font_GetChar(Codepoint); + + for(y = 0; y < FONT_HEIGHT; y ++) { - if(*font & (1 << (FONT_WIDTH-x-1))) - buf[x] = FGC; - else - buf[x] = BGC; + for(x = 0; x < FONT_WIDTH; x ++) + { + if(*font & (1 << (FONT_WIDTH-x-1))) + buf[x] = FGC; + else + buf[x] = BGC; + } + buf = (void*)( (tVAddr)buf + Pitch ); + font ++; + } + } + // 16-bpp and below + else if( Depth <= 16 ) + { + Uint16 *buf = Buffer; + + font = VT_Font_GetChar(Codepoint); + + for(y = 0; y < FONT_HEIGHT; y ++) + { + for(x = 0; x < FONT_WIDTH; x ++) + { + if(*font & (1 << (FONT_WIDTH-x-1))) + buf[x] = FGC; + else + buf[x] = BGC; + } + buf = (void*)( (tVAddr)buf + Pitch ); + font ++; + } + } + // 24-bpp colour + // - Special handling to not overwrite the next pixel + //TODO: Endian issues here + else if( Depth == 24 ) + { + Uint8 *buf = Buffer; + Uint8 bg_r = (BGC >> 16) & 0xFF; + Uint8 bg_g = (BGC >> 8) & 0xFF; + Uint8 bg_b = (BGC >> 0) & 0xFF; + Uint8 fg_r = (FGC >> 16) & 0xFF; + Uint8 fg_g = (FGC >> 8) & 0xFF; + Uint8 fg_b = (FGC >> 0) & 0xFF; + + font = VT_Font_GetChar(Codepoint); + + for(y = 0; y < FONT_HEIGHT; y ++) + { + for(x = 0; x < FONT_WIDTH; x ++) + { + Uint8 r, g, b; + + if(*font & (1 << (FONT_WIDTH-x-1))) { + r = fg_r; g = fg_g; b = fg_b; + } + else { + r = bg_r; g = bg_g; b = bg_b; + } + buf[x*3+0] = b; + buf[x*3+1] = g; + buf[x*3+2] = r; + } + buf = (void*)( (tVAddr)buf + Pitch ); + font ++; + } + } + // 32-bpp colour (nice and easy) + else if( Depth == 32 ) + { + Uint32 *buf = Buffer; + + font = VT_Font_GetChar(Codepoint); + + for(y = 0; y < FONT_HEIGHT; y ++) + { + for(x = 0; x < FONT_WIDTH; x ++) + { + if(*font & (1 << (FONT_WIDTH-x-1))) + buf[x] = FGC; + else + buf[x] = BGC; + } + buf = (Uint32*)( (tVAddr)buf + Pitch ); + font ++; } - buf += Pitch; - font ++; } } /** * \fn Uint32 VT_Colour12to24(Uint16 Col12) - * \brief Converts a + * \brief Converts a 12-bit colour into 24 bits */ Uint32 VT_Colour12to24(Uint16 Col12) { @@ -1369,6 +1448,66 @@ Uint32 VT_Colour12to24(Uint16 Col12) ret |= (tmp << 16) | (tmp << 20); return ret; } +/** + * \brief Converts a 12-bit colour into 15 bits + */ +Uint16 VT_Colour12to15(Uint16 Col12) +{ + Uint32 ret; + int tmp; + tmp = Col12 & 0xF; + ret = (tmp << 1) | (tmp & 1); + tmp = (Col12 & 0xF0) >> 4; + ret |= ( (tmp << 1) | (tmp & 1) ) << 5; + tmp = (Col12 & 0xF00) >> 8; + ret |= ( (tmp << 1) | (tmp & 1) ) << 10; + return ret; +} + +/** + * \brief Converts a 12-bit colour into any other depth + * \param Col12 12-bit source colour + * \param Depth Desired bit deptj + * \note Green then blue get the extra avaliable bits (16:5-6-5, 14:4-5-5) + */ +Uint32 VT_Colour12toN(Uint16 Col12, int Depth) +{ + Uint32 ret; + Uint32 r, g, b; + int rSize, gSize, bSize; + + // Fast returns + if( Depth == 24 ) return VT_Colour12to24(Col12); + if( Depth == 15 ) return VT_Colour12to15(Col12); + + // Bounds checks + if( Depth < 8 ) return 0; + if( Depth > 32 ) return 0; + + r = Col12 & 0xF; + g = (Col12 & 0xF0) >> 4; + b = (Col12 & 0xF00) >> 8; + + rSize = gSize = bSize = Depth / 3; + if( rSize + gSize + bSize < Depth ) // Depth % 3 == 1 + gSize ++; + if( rSize + gSize + bSize < Depth ) // Depth % 3 == 2 + bSize ++; + + // Expand + r <<= rSize - 4; g <<= gSize - 4; b <<= bSize - 4; + // Fill with the lowest bit + if( Col12 & 0x001 ) r |= (1 << (rSize - 4)) - 1; + if( Col12 & 0x010 ) r |= (1 << (gSize - 4)) - 1; + if( Col12 & 0x100 ) r |= (1 << (bSize - 4)) - 1; + + // Create output + ret = r; + ret |= g << rSize; + ret |= b << (rSize + gSize); + + return ret; +} /** * \fn Uint8 *VT_Font_GetChar(Uint32 Codepoint) diff --git a/Kernel/include/tpl_drv_video.h b/Kernel/include/tpl_drv_video.h index bf67e598..1be4f2b7 100644 --- a/Kernel/include/tpl_drv_video.h +++ b/Kernel/include/tpl_drv_video.h @@ -244,11 +244,11 @@ extern int giVT_CharWidth; //! \brief Defines the height of a rendered character extern int giVT_CharHeight; /** - * \fn void VT_Font_Render(Uint32 Codepoint, void *Buffer, int Pitch, Uint32 BGC, Uint32 FGC) * \brief Driver helper that renders a character to a buffer * \param Codepoint Unicode character to render - * \param Buffer Buffer to render to (32-bpp) - * \param Pitch Number of DWords per line + * \param Buffer Buffer to render to + * \param Depth Bit depth of the destination buffer + * \param Pitch Number of bytes per line * \param BGC 32-bit Background Colour * \param FGC 32-bit Foreground Colour * @@ -256,14 +256,33 @@ extern int giVT_CharHeight; * text mode by keeping the character rendering abstracted from the driver, * easing the driver development and reducing code duplication. */ -extern void VT_Font_Render(Uint32 Codepoint, void *Buffer, int Pitch, Uint32 BGC, Uint32 FGC); +extern void VT_Font_Render(Uint32 Codepoint, void *Buffer, int Depth, int Pitch, Uint32 BGC, Uint32 FGC); /** * \fn Uint32 VT_Colour12to24(Uint16 Col12) - * \brief Converts a colour from 12bpp to 32bpp + * \brief Converts a colour from 12bpp to 24bpp * \param Col12 12-bpp input colour * \return Expanded 32-bpp (24-bit colour) version of \a Col12 */ extern Uint32 VT_Colour12to24(Uint16 Col12); +/** + * \brief Converts a colour from 12bpp to 14bpp + * \param Col12 12-bpp input colour + * \return 15 bits per pixel value + */ +extern Uint16 VT_Colour12to15(Uint16 Col12); +/** + * \brief Converts a colour from 12bpp to 32bpp + * \param Col12 12-bpp input colour + * \param Depth Desired bit depth + * \return \a Depth bit number, denoting Col12 + * + * Expands the source colour into a \a Depth bits per pixel representation. + * The colours are expanded with preference to Green, Blue and Red in that order + * (so, green gets the first spare pixel, blue gets the next, and red never gets + * the spare). \n + * The final bit of each component is used to fill the lower bits of the output. + */ +extern Uint32 VT_Colour12toN(Uint16 Col12, int Depth); /** * \brief Handlers for eTplVideo_2DCommands diff --git a/Makefile b/Makefile index 2a7f1a95..4cae511b 100644 --- a/Makefile +++ b/Makefile @@ -48,7 +48,7 @@ clean-user: $(CLEAN_USRLIBS) $(CLEAN_USRAPPS) all: $(ALL_DYNMODS) $(ALL_MODULES) all-Kernel $(ALL_USRLIBS) $(ALL_USRAPPS) all-install: $(AI_DYNMODS) $(AI_MODULES) allinstall-Kernel $(AI_USRLIBS) $(AI_USRAPPS) clean: $(CLEAN_DYNMODS) $(CLEAN_MODULES) clean-Kernel $(CLEAN_USRLIBS) $(CLEAN_USRAPPS) -install: $(INSTALL_DYNMODS) $(INSTALL_MODULES) install-Kernel $(INSTALL_USRLIBS) $(INSTALL_USRAPPS) +install: install-Filesystem $(INSTALL_DYNMODS) $(INSTALL_MODULES) install-Kernel $(INSTALL_USRLIBS) $(INSTALL_USRAPPS) # Compile Only $(ALL_DYNMODS): all-%: @@ -91,6 +91,8 @@ $(INSTALL_DYNMODS): install-%: @BUILDTYPE=dynamic $(SUBMAKE) install -C Modules/$* $(INSTALL_MODULES): install-%: @BUILDTYPE=static $(SUBMAKE) install -C Modules/$* +install-Filesystem: + @$(SUBMAKE) install -C Usermode/Filesystem install-Kernel: @$(SUBMAKE) install -C Kernel $(INSTALL_USRLIBS): install-%: diff --git a/Makefile.cfg b/Makefile.cfg index 83088295..0ccb74ad 100644 --- a/Makefile.cfg +++ b/Makefile.cfg @@ -2,8 +2,10 @@ # Acess2 Build Configuration # -# Source and destination configuration +# Install destination configuration DISTROOT := a:/Acess2 +xCP := mcopy -D o +xMKDIR := mmd ACESSDIR := $(dir $(lastword $(MAKEFILE_LIST))) ACESSDIR := $(shell cd $(ACESSDIR) && pwd) @@ -18,8 +20,6 @@ STRIP := strip MKDIR := mkdir -p RMDIR := rm -rf lCP := cp -xCP := mcopy -D o -xMKDIR := mmd # Load Architecture settings ifeq ($(ARCH),) @@ -31,6 +31,10 @@ ifeq ($(ARCHDIR),) endif -include $(ACESSDIR)/Makefile.$(ARCHDIR).cfg +# Makefile.user.cfg is not part of the Acess git repo, +# It is for overriding the options in this file +-include $(ACESSDIR)/Makefile.user.cfg + FILESYSTEMS := DRIVERS := MODULES := Storage/ATA Storage/FDD diff --git a/Makefile.i386.cfg b/Makefile.i386.cfg index beb3cd73..f72f0bbc 100644 --- a/Makefile.i386.cfg +++ b/Makefile.i386.cfg @@ -8,7 +8,6 @@ AS = nasm OBJDUMP = i586-elf-objdump RM = @rm -f STRIP = strip -MKDIR = mkdir ARCHDIR = x86 diff --git a/Modules/Display/VESA/main.c b/Modules/Display/VESA/main.c index 1cd6a91f..9929c351 100644 --- a/Modules/Display/VESA/main.c +++ b/Modules/Display/VESA/main.c @@ -127,7 +127,7 @@ int Vesa_Install(char **Arguments) { gVesa_Modes[i].flags |= FLAG_LFB; gVesa_Modes[i].framebuffer = modeinfo->physbase; - gVesa_Modes[i].fbSize = modeinfo->Xres*modeinfo->Yres*modeinfo->bpp/8; + gVesa_Modes[i].fbSize = modeinfo->Yres*modeinfo->pitch; } else { gVesa_Modes[i].framebuffer = 0; gVesa_Modes[i].fbSize = 0; @@ -233,24 +233,35 @@ Uint64 Vesa_Write(tVFS_Node *Node, Uint64 Offset, Uint64 Length, void *Buffer) case VIDEO_BUFFMT_TEXT: { tVT_Char *chars = Buffer; - int pitch = gVesa_Modes[giVesaCurrentMode].width; + int pitch = gVesa_Modes[giVesaCurrentMode].pitch; + int depth = gVesa_Modes[giVesaCurrentMode].bpp; int widthInChars = gVesa_Modes[giVesaCurrentMode].width/giVT_CharWidth; int heightInChars = gVesa_Modes[giVesaCurrentMode].height/giVT_CharHeight; int x, y; - Uint32 *dest = (void*)gpVesa_Framebuffer; + Uint8 *dest = (void*)gpVesa_Framebuffer; int i; Length /= sizeof(tVT_Char); Offset /= sizeof(tVT_Char); - LOG("gVesa_Modes[%i].width = %i", giVesaCurrentMode, gVesa_Modes[giVesaCurrentMode].width); + LOG("gVesa_Modes[%i] = {height:%i, width:%i, pitch:%i}", + giVesaCurrentMode, + gVesa_Modes[giVesaCurrentMode].height, + gVesa_Modes[giVesaCurrentMode].width, + gVesa_Modes[giVesaCurrentMode].pitch + ); x = Offset % widthInChars; y = Offset / widthInChars; - LOG("(x,y) = (%i,%i) = [%i,%i]", x, y, x * giVT_CharWidth, y * giVT_CharHeight * pitch); + LOG("(x,y) = (%i,%i) = [%i,%i]", + x, + y, + x * giVT_CharWidth * depth / 8, + y * giVT_CharHeight * pitch + ); LOG("(w,h) = (%i,%i) = [%i,%i]", (int)(Length % widthInChars), (int)(Length / widthInChars), - (int)((Length % widthInChars) * giVT_CharWidth), + (int)((Length % widthInChars) * giVT_CharWidth * depth / 8), (int)((Length / widthInChars) * giVT_CharHeight * pitch) ); @@ -273,28 +284,42 @@ Uint64 Vesa_Write(tVFS_Node *Node, Uint64 Offset, Uint64 Length, void *Buffer) } dest += y * giVT_CharHeight * pitch; - dest += x * giVT_CharWidth; LOG("dest = %p", dest); for( i = 0; i < (int)Length; i++ ) { + if( + !MM_GetPhysAddr( (tVAddr)dest + x*giVT_CharWidth*depth/8 ) + // || !MM_GetPhysAddr( (tVAddr)dest + x*giVT_CharWidth*depth/8 + pitch*giVT_CharHeight-1) + ) + { + Log_Notice("VESA", "Stopped at %i, not mapped", i); + break; + } + if( y >= heightInChars ) + { + Log_Notice("VESA", "Stopped at %i", i); + break; + } + VT_Font_Render( chars->Ch, - dest + x*giVT_CharWidth, pitch, - VT_Colour12to24(chars->BGCol), - VT_Colour12to24(chars->FGCol) + dest + x*giVT_CharWidth*depth/8, depth, pitch, + VT_Colour12toN(chars->BGCol, depth), + VT_Colour12toN(chars->FGCol, depth) ); chars ++; x ++; - if( x >= widthInChars ) { + if( x >= widthInChars ) + { x = 0; y ++; dest += pitch*giVT_CharHeight; } } - Length *= sizeof(tVT_Char); + Length = i * sizeof(tVT_Char); } break; @@ -312,6 +337,7 @@ Uint64 Vesa_Write(tVFS_Node *Node, Uint64 Offset, Uint64 Length, void *Buffer) LOG("buffer = %p", Buffer); LOG("Updating Framebuffer (%p to %p)", destBuf, destBuf + (Uint)Length); + //TODO: Handle non 32-bpp framebuffer modes // Copy to Frambuffer memcpy(destBuf, Buffer, Length); @@ -411,11 +437,15 @@ int Vesa_Ioctl(tVFS_Node *Node, int ID, void *Data) * \brief Updates the video mode */ int Vesa_Int_SetMode(int mode) -{ - Log_Log("VESA", "Setting mode to %i", mode); - +{ // Sanity Check values if(mode < 0 || mode > giVesaModeCount) return -1; + + Log_Log("VESA", "Setting mode to %i (%ix%i %ibpp)", + mode, + gVesa_Modes[mode].width, gVesa_Modes[mode].height, + gVesa_Modes[mode].bpp + ); // Check for fast return if(mode == giVesaCurrentMode) return 1; @@ -441,8 +471,8 @@ int Vesa_Int_SetMode(int mode) giVesaPageCount = (gVesa_Modes[mode].fbSize + 0xFFF) >> 12; gpVesa_Framebuffer = (void*)MM_MapHWPages(gVesa_Modes[mode].framebuffer, giVesaPageCount); - Log_Log("VESA", "Framebuffer (Phys) = 0x%x", gVesa_Modes[mode].framebuffer); - Log_Log("VESA", "Framebuffer (Virt) = 0x%x", gpVesa_Framebuffer); + Log_Log("VESA", "Framebuffer (Phys) = 0x%x, (Virt) = 0x%x, Size = 0x%x", + gVesa_Modes[mode].framebuffer, gpVesa_Framebuffer, giVesaPageCount << 12); // Record Mode Set giVesaCurrentMode = mode; @@ -465,13 +495,15 @@ int Vesa_Int_FindMode(tVideo_IOCtl_Mode *data) { LOG("Mode %i (%ix%ix%i)", i, gVesa_Modes[i].width, gVesa_Modes[i].height, gVesa_Modes[i].bpp); - if(gVesa_Modes[i].width == data->width - && gVesa_Modes[i].height == data->height - && gVesa_Modes[i].bpp == data->bpp) + if(gVesa_Modes[i].width == data->width && gVesa_Modes[i].height == data->height) { - LOG("Perfect!"); - best = i; - break; + if( (data->bpp == 32 || data->bpp == 24) + && (gVesa_Modes[i].bpp == 32 || gVesa_Modes[i].bpp == 24) ) + { + LOG("Perfect!"); + best = i; + break; + } } tmp = gVesa_Modes[i].width * gVesa_Modes[i].height; @@ -519,26 +551,58 @@ int Vesa_Int_ModeInfo(tVideo_IOCtl_Mode *data) */ void Vesa_FlipCursor(void *Arg) { - int pitch = gpVesaCurMode->pitch/4; + int pitch = gpVesaCurMode->pitch; + int bytes_per_px = (gpVesaCurMode->bpp + 7) / 8; int x = giVesaCursorX*giVT_CharWidth; int y = giVesaCursorY*giVT_CharHeight; int i; - Uint32 *fb = (void*)gpVesa_Framebuffer; + Uint8 *fb = (void*)gpVesa_Framebuffer; //Debug("Cursor flip"); // Sanity check if(giVesaCursorX < 0 || giVesaCursorY < 0 - || y*pitch + x + (giVT_CharHeight-1)*pitch > (int)gpVesaCurMode->fbSize/4) { + || y*pitch + x + (giVT_CharHeight-1)*pitch > (int)gpVesaCurMode->fbSize) { Log_Notice("VESA", "Cursor OOB (%i,%i)", x, y); giVesaCursorTimer = -1; return; } // Draw cursor - fb += (y+1)*pitch + x; - for( i = 1; i < giVT_CharHeight-1; i++, fb += pitch ) - *fb = ~*fb; + fb += (y+1)*pitch + x*bytes_per_px; + + switch(bytes_per_px) + { + case 1: + for( i = 1; i < giVT_CharHeight-1; i++, fb += pitch ) + *fb = ~*fb; + break; + case 2: + for( i = 1; i < giVT_CharHeight-1; i++, fb += pitch ) { + fb[0] = ~fb[0]; + fb[1] = ~fb[1]; + } + break; + case 3: + for( i = 1; i < giVT_CharHeight-1; i++, fb += pitch ) { + fb[0] = ~fb[0]; + fb[1] = ~fb[1]; + fb[2] = ~fb[2]; + } + break; + case 4: + for( i = 1; i < giVT_CharHeight-1; i++, fb += pitch ) { + fb[0] = ~fb[0]; + fb[1] = ~fb[1]; + fb[2] = ~fb[2]; + fb[3] = ~fb[3]; + } + break; + default: + Log_Error("VESA", "Vesa_FlipCursor - Bug Report, unknown bytes_per_px (%i)", bytes_per_px); + giVesaCursorTimer = -1; + return ; + } #if BLINKING_CURSOR giVesaCursorTimer = Time_CreateTimer(VESA_CURSOR_PERIOD, Vesa_FlipCursor, Arg); @@ -550,6 +614,7 @@ void Vesa_FlipCursor(void *Arg) // ------------------------ void Vesa_2D_Fill(void *Ent, Uint16 X, Uint16 Y, Uint16 W, Uint16 H, Uint32 Colour) { + // TODO: Handle non-32bit modes int pitch = gpVesaCurMode->pitch/4; Uint32 *buf = (Uint32*)gpVesa_Framebuffer + Y*pitch + X; while( H -- ) { @@ -560,7 +625,8 @@ void Vesa_2D_Fill(void *Ent, Uint16 X, Uint16 Y, Uint16 W, Uint16 H, Uint32 Colo void Vesa_2D_Blit(void *Ent, Uint16 DstX, Uint16 DstY, Uint16 SrcX, Uint16 SrcY, Uint16 W, Uint16 H) { - int scrnpitch = gVesa_Modes[giVesaCurrentMode].pitch; + int scrnpitch = gpVesaCurMode->pitch; + int bytes_per_px = (gpVesaCurMode->bpp + 7) / 8; int dst = DstY*scrnpitch + DstX; int src = SrcY*scrnpitch + SrcX; int tmp; @@ -568,14 +634,14 @@ void Vesa_2D_Blit(void *Ent, Uint16 DstX, Uint16 DstY, Uint16 SrcX, Uint16 SrcY, //Log("Vesa_2D_Blit: (Ent=%p, DstX=%i, DstY=%i, SrcX=%i, SrcY=%i, W=%i, H=%i)", // Ent, DstX, DstY, SrcX, SrcY, W, H); - if(SrcX + W > gVesa_Modes[giVesaCurrentMode].width) - W = gVesa_Modes[giVesaCurrentMode].width - SrcX; - if(DstX + W > gVesa_Modes[giVesaCurrentMode].width) - W = gVesa_Modes[giVesaCurrentMode].width - DstX; - if(SrcY + H > gVesa_Modes[giVesaCurrentMode].height) - H = gVesa_Modes[giVesaCurrentMode].height - SrcY; - if(DstY + H > gVesa_Modes[giVesaCurrentMode].height) - H = gVesa_Modes[giVesaCurrentMode].height - DstY; + if(SrcX + W > gpVesaCurMode->width) + W = gpVesaCurMode->width - SrcX; + if(DstX + W > gpVesaCurMode->width) + W = gpVesaCurMode->width - DstX; + if(SrcY + H > gpVesaCurMode->height) + H = gpVesaCurMode->height - SrcY; + if(DstY + H > gpVesaCurMode->height) + H = gpVesaCurMode->height - DstY; //Debug("W = %i, H = %i", W, H); @@ -586,18 +652,19 @@ void Vesa_2D_Blit(void *Ent, Uint16 DstX, Uint16 DstY, Uint16 SrcX, Uint16 SrcY, while( H -- ) { dst -= scrnpitch; src -= scrnpitch; - tmp = W; + tmp = W*bytes_per_px; for( tmp = W; tmp --; ) { - *(Uint32*)(gpVesa_Framebuffer + dst + tmp) = *(Uint32*)(gpVesa_Framebuffer + src + tmp); + *(Uint8*)(gpVesa_Framebuffer + dst + tmp) = *(Uint8*)(gpVesa_Framebuffer + src + tmp); } } } else { // Normal copy is OK while( H -- ) { - memcpy((void*)gpVesa_Framebuffer + dst, (void*)gpVesa_Framebuffer + src, W*sizeof(Uint32)); + memcpy((void*)gpVesa_Framebuffer + dst, (void*)gpVesa_Framebuffer + src, W*bytes_per_px); dst += scrnpitch; src += scrnpitch; } } + //Log("Vesa_2D_Blit: RETURN"); } diff --git a/Modules/Makefile.tpl b/Modules/Makefile.tpl index 750f2dc2..dc5d6f94 100644 --- a/Modules/Makefile.tpl +++ b/Modules/Makefile.tpl @@ -4,12 +4,7 @@ _CPPFLAGS := $(CPPFLAGS) -CFGFILES := -CFGFILES += $(shell test -f ../../../Makefile.cfg && echo ../../../Makefile.cfg) -CFGFILES += $(shell test -f ../../Makefile.cfg && echo ../../Makefile.cfg) -CFGFILES += $(shell test -f ../Makefile.cfg && echo ../Makefile.cfg) -CFGFILES += $(shell test -f Makefile.cfg && echo Makefile.cfg) --include $(CFGFILES) +-include $(dir $(lastword $(MAKEFILE_LIST)))../Makefile.cfg CPPFLAGS := -I$(ACESSDIR)/Kernel/include -I$(ACESSDIR)/Kernel/arch/$(ARCHDIR)/include -DARCH=$(ARCH) $(_CPPFLAGS) CFLAGS := -Wall -Werror -fno-stack-protector -g -O3 -fno-builtin @@ -46,7 +41,8 @@ clean: install: $(BIN) ifneq ($(BUILDTYPE),static) - $(xCP) $(BIN) $(DISTROOT)/Modules/$(NAME).kmd.$(ARCH) + $(xMKDIR) $(DISTROOT)/Modules/$(ARCH) + $(xCP) $(BIN) $(DISTROOT)/Modules/$(ARCH)/$(NAME).kmd else endif diff --git a/Usermode/Applications/Makefile.tpl b/Usermode/Applications/Makefile.tpl index d18dc771..07bef0f8 100644 --- a/Usermode/Applications/Makefile.tpl +++ b/Usermode/Applications/Makefile.tpl @@ -18,6 +18,7 @@ clean: @$(RM) $(OBJ) $(DEPFILES) $(_BIN) $(BIN).dsm Map.txt install: $(_BIN) + @$(xMKDIR) $(DISTROOT)/$(DIR) $(xCP) $(_BIN) $(DISTROOT)/$(DIR)/ $(_BIN): $(OBJ) diff --git a/Usermode/Filesystem/Makefile b/Usermode/Filesystem/Makefile index b9b85f06..4cf24a37 100644 --- a/Usermode/Filesystem/Makefile +++ b/Usermode/Filesystem/Makefile @@ -3,16 +3,18 @@ -include ../../Makefile.cfg -DIRS = Bin SBin Libs Modules Applications +DIRS = Bin SBin Libs Modules Apps DIRS += Conf Conf/Auth -FILES = Conf/BootConf.cfg Conf/Auth/Users Conf/Auth/Passwords Conf/Auth/Groups +FILES = Conf/BootConf.cfg +# Conf/Auth/Users Conf/Auth/Passwords Conf/Auth/Groups #DIRS := $(addprefix $(DISTROOT)/,$(DIRS)) #FILES := $(addprefix $(DISTROOT)/,$(FILES)) .PHONY: all clean +.PHONY: $(DIRS) $(FILES) -all: $(DIRS) $(FILES) +install: $(DIRS) $(FILES) clean: @@ -20,6 +22,6 @@ $(DIRS): $(xMKDIR) $(DISTROOT)/$@ $(FILES): - $(xCP) $< $(DISTROOT)/$@ + $(xCP) $@ $(DISTROOT)/$@ force: ; diff --git a/Usermode/Libraries/Makefile.tpl b/Usermode/Libraries/Makefile.tpl index 51e404d4..ec940664 100644 --- a/Usermode/Libraries/Makefile.tpl +++ b/Usermode/Libraries/Makefile.tpl @@ -15,6 +15,7 @@ clean: $(RM) $(_BIN) $(_XBIN) $(OBJ) $(_BIN).dsm $(DEPFILES) install: all + @$(xMKDIR) $(DISTROOT)/Libs $(xCP) $(_BIN) $(_XBIN) $(DISTROOT)/Libs/ $(_BIN): $(OBJ) diff --git a/Usermode/Libraries/crt0.o_src/Makefile b/Usermode/Libraries/crt0.o_src/Makefile index a69be9b6..36ce011b 100644 --- a/Usermode/Libraries/crt0.o_src/Makefile +++ b/Usermode/Libraries/crt0.o_src/Makefile @@ -17,5 +17,5 @@ clean: $(RM) $(BIN) $(BIN): crt0.$(ARCHDIR).asm - @$(MKDIR) $(dir $(BIN)) + @mkdir -p $(dir $(BIN)) $(AS) $(ASFLAGS) $< -o $@