add strlen, unused----
This commit is contained in:
parent
6c72923c9e
commit
30ea392529
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
OBJ="obj"
|
OBJ="obj"
|
||||||
INCLUDE="-Isys/include"
|
INCLUDE="-Isys/include"
|
||||||
CFLAGS="-g -m32 -ffreestanding -Wall -Wextra -pedantic -nostdlib $INCLUDE"
|
CFLAGS="-m32 -ffreestanding -Wall -Wextra -pedantic -nostdlib $INCLUDE"
|
||||||
ASFLAGS="-felf32"
|
ASFLAGS="-felf32"
|
||||||
LDFLAGS="-m elf_i386"
|
LDFLAGS="-m elf_i386"
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
echo "Kernel Build"
|
echo "Kernel Build"
|
||||||
|
|
||||||
|
cc $CFLAGS -c sys/lib.c -o $OBJ/lib.o
|
||||||
cc $CFLAGS -c sys/video.c -o $OBJ/video.o
|
cc $CFLAGS -c sys/video.c -o $OBJ/video.o
|
||||||
cc $CFLAGS -c sys/sysinit.c -o $OBJ/sysinit.o
|
cc $CFLAGS -c sys/sysinit.c -o $OBJ/sysinit.o
|
||||||
|
|
|
@ -0,0 +1,9 @@
|
||||||
|
#ifndef FCNTL_H
|
||||||
|
#define FCNTL_H
|
||||||
|
|
||||||
|
#define O_RDONLY 0x0000
|
||||||
|
#define O_WRONLY 0x0010
|
||||||
|
#define O_RDWR 0x0020
|
||||||
|
#define O_CREAT 0x0200
|
||||||
|
|
||||||
|
#endif
|
|
@ -1,8 +1,11 @@
|
||||||
8 ifndef MEMORY_H
|
#ifndef MEMORY_H
|
||||||
#define MEMORY_H
|
#define MEMORY_H
|
||||||
|
|
||||||
#include <types.h>
|
#include <types.h>
|
||||||
|
|
||||||
|
#define EXTMEMBOT 0x100000
|
||||||
|
#define PHYSMEMTOP 0x0e000000
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Each allocated memory is stored internally like this:
|
* Each allocated memory is stored internally like this:
|
||||||
|
|
|
@ -0,0 +1,2 @@
|
||||||
|
#define NDEV 10
|
||||||
|
#define ROOTDEV 0
|
|
@ -0,0 +1,12 @@
|
||||||
|
#include <types.h>
|
||||||
|
|
||||||
|
u32
|
||||||
|
strlen(const char *str)
|
||||||
|
{
|
||||||
|
size_t i;
|
||||||
|
|
||||||
|
for (i = 0; str[i] != NULL; i++)
|
||||||
|
;
|
||||||
|
|
||||||
|
return i;
|
||||||
|
}
|
|
@ -3,12 +3,8 @@
|
||||||
void
|
void
|
||||||
sysinit(void)
|
sysinit(void)
|
||||||
{
|
{
|
||||||
|
char *howdy = "Om Smart";
|
||||||
|
|
||||||
vga_clearscreen();
|
vga_clearscreen();
|
||||||
vga_write("Om Smert.", 9, 0x0F);
|
vga_write(howdy, strlen(howdy), 0x1f);
|
||||||
vga_write("Om Smarter.", 11, 0x0F);
|
|
||||||
for (s16 i = 0; i < 99; i++) {
|
|
||||||
vga_write("Om Smart.", 9, 0x0F);
|
|
||||||
vga_write("Om Smarter.", 11, 0x0F);
|
|
||||||
}
|
|
||||||
vga_write("fish stick", 10, 0x07);
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,6 +21,8 @@ vga_write(s8 *sequence, s16 size, s8 flags)
|
||||||
for (s16 i = 0; i <= (unused = VGA_SIZE - needed_space); i++) {
|
for (s16 i = 0; i <= (unused = VGA_SIZE - needed_space); i++) {
|
||||||
vga_vidmem[i] = vga_vidmem[needed_space + i];
|
vga_vidmem[i] = vga_vidmem[needed_space + i];
|
||||||
}
|
}
|
||||||
|
unused--;
|
||||||
|
unused--;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (s16 i = 0; i < size; i++) {
|
for (s16 i = 0; i < size; i++) {
|
||||||
|
|
Loading…
Reference in New Issue