Code wash !
This commit is contained in:
parent
8f248101c0
commit
c10137539f
9 changed files with 45 additions and 8 deletions
|
@ -4,11 +4,24 @@ EXEC=helpers.o
|
|||
all:$(EXEC)
|
||||
|
||||
#----- Helpers -----
|
||||
$(EXEC): memory.cpp
|
||||
$(CXX) -c -o $(EXEC) memory.cpp
|
||||
$(EXEC): memory.o memPrint.o
|
||||
ld -m elf_i386 -r -o $(EXEC) $^
|
||||
#---------------
|
||||
|
||||
|
||||
#----- Memory -----
|
||||
memory.o: memory.cpp memory.hpp
|
||||
$(CXX) -c -o $@ $<
|
||||
#------------------
|
||||
|
||||
|
||||
#----- memPrint -----
|
||||
memPrint.o: memPrint.cpp memPrint.hpp
|
||||
$(CXX) -c -o $@ $<
|
||||
#-------------------
|
||||
|
||||
|
||||
|
||||
#----- Other -----
|
||||
.PHONY:clean
|
||||
|
||||
|
|
Binary file not shown.
|
@ -1,10 +1,11 @@
|
|||
#include "./memPrint.hpp"
|
||||
|
||||
|
||||
//Constructor
|
||||
memPrint::memPrint(){
|
||||
|
||||
|
||||
}
|
||||
|
||||
//Destructor
|
||||
memPrint::~memPrint(){
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -26,13 +26,19 @@ enum colorBios{
|
|||
//Type def for biosColor
|
||||
typedef enum colorBios colorBios;
|
||||
|
||||
|
||||
//Class to print char on screen using Video Ram mapping
|
||||
class memPrint{
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//Constructor
|
||||
memPrint();
|
||||
|
||||
//Destructor
|
||||
~memPrint();
|
||||
};
|
||||
|
||||
|
|
|
@ -1,23 +1,31 @@
|
|||
#include "./memory.hpp"
|
||||
#include "./types.hpp"
|
||||
|
||||
//Fonction to copy data into memory
|
||||
int memcpy(u32 source, u32 dest, u32 size){
|
||||
|
||||
//Init source and destination pointer
|
||||
u32 *sourceTmp=(u32 *)source;
|
||||
u32 *destTmp=(u32 *)dest;
|
||||
|
||||
//Init progression
|
||||
u32 progress=0;
|
||||
|
||||
//Start copy
|
||||
while(progress != size){
|
||||
|
||||
//Copy
|
||||
*destTmp=*sourceTmp;
|
||||
|
||||
//Update source and destination
|
||||
sourceTmp++;
|
||||
destTmp++;
|
||||
|
||||
//Update progression
|
||||
progress++;
|
||||
}
|
||||
|
||||
//End and return progression
|
||||
return progress;
|
||||
|
||||
}
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
#include "./types.hpp"
|
||||
|
||||
|
||||
//Fonction to copy data into memory
|
||||
int memcpy(u32 source, u32 dest, u32 size);
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue