Skip to content

Commit

Permalink
Added function memset() and replaced loop in function print() with
Browse files Browse the repository at this point in the history
memcpy().
  • Loading branch information
Gurgel100 committed Aug 3, 2014
1 parent 7955595 commit 8a70e9a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
13 changes: 11 additions & 2 deletions kernel/bootloader.c
Original file line number Diff line number Diff line change
Expand Up @@ -293,11 +293,12 @@ void scrollScreen(int Anzahl)
char *gs = (char*)GRAFIKSPEICHER;
for(i = 0; i < Anzahl; i++)
{
for(zeile = 0; zeile < 24; zeile++)
memcpy(gs, gs + zeile * 80, 24 * 80);
/*for(zeile = 0; zeile < 24; zeile++)
for(spalte = 0; spalte < 80; spalte++)
{
gs[zeile * 80 + spalte] = gs[(zeile + 1) * 80 + spalte];
}
}*/
//Letzte Zeile löschen
zeile = 24 - i;
for(spalte = 0; spalte < 80; spalte++)
Expand Down Expand Up @@ -345,6 +346,14 @@ void *memcpy(void *to, const void *from, size_t size)
return to;
}

void *memset(void *block, int c, size_t n)
{
unsigned char volatile *i;
for(i = block; i < block + n; i++)
*i = (unsigned char)c;
return block;
}

size_t strlen(const char *cs)
{
register size_t i;
Expand Down
1 change: 1 addition & 0 deletions kernel/bootloader.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ void clearDisp(void);
void scrollScreen(int Anzahl);
char *IntToStr(int32_t Zahl);
void *memcpy(void *to, const void *from, size_t size);
void *memset(void *block, int c, size_t n);
size_t strlen(const char *cs);
void panic(const char *string);

Expand Down

0 comments on commit 8a70e9a

Please sign in to comment.