Update system to minimum working status
This commit is contained in:
parent
da9283ebd1
commit
96ed9e6785
|
@ -42,7 +42,16 @@ void term_putentryat (char c, uint8_t color, size_t x, size_t y) {
|
|||
|
||||
void term_putchar(char c) {
|
||||
unsigned char uc = c;
|
||||
|
||||
switch (uc) {
|
||||
case '\n':
|
||||
terminal_column = 0;
|
||||
terminal_row += 1;
|
||||
break;
|
||||
default:
|
||||
term_putentryat(uc, current_color, terminal_column, terminal_row);
|
||||
break;
|
||||
}
|
||||
|
||||
if(++terminal_column == TERM_WIDTH)
|
||||
{
|
||||
|
@ -59,6 +68,10 @@ void term_write(const char* data, size_t size) {
|
|||
term_putchar(data[i]);
|
||||
}
|
||||
|
||||
void term_writes(const char* data) {
|
||||
term_write(data, strlen(data));
|
||||
}
|
||||
|
||||
void puts(const char* string) {
|
||||
term_write(string, strlen(string));
|
||||
term_putchar('\n');
|
||||
|
|
34
include/arch/i386/vga.h
Executable file
34
include/arch/i386/vga.h
Executable file
|
@ -0,0 +1,34 @@
|
|||
#ifndef ARCH_I386_VGA_H
|
||||
#define ARCH_I386_VGA_H
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
|
||||
enum vga_colors {
|
||||
BLACK = 0,
|
||||
BLUE = 1,
|
||||
GREEN = 2,
|
||||
CYAN = 3,
|
||||
RED = 4,
|
||||
MAGENTA = 5,
|
||||
BROWN = 6,
|
||||
LIGHT_GREY = 7,
|
||||
DARK_GREY = 8,
|
||||
LIGHT_BLUE = 9,
|
||||
LIGHT_GREEN = 10,
|
||||
LIGHT_CYAN = 11,
|
||||
LIGHT_RED = 12,
|
||||
LIGHT_MAGENTA = 13,
|
||||
LIGHT_BROWN = 14,
|
||||
WHITE = 15
|
||||
};
|
||||
|
||||
static inline uint8_t vga_color_set(enum vga_colors fg, enum vga_colors bg) {
|
||||
return fg | bg << 4;
|
||||
}
|
||||
|
||||
static inline uint16_t vga_entry(unsigned char uc, uint8_t color) {
|
||||
return (uint16_t) uc | (uint16_t) color << 8;
|
||||
}
|
||||
|
||||
#endif
|
|
@ -9,6 +9,7 @@ void screen_initialize(void);
|
|||
void term_putentryat(char, uint8_t, size_t, size_t);
|
||||
void term_putchar(char);
|
||||
void term_write(const char*, size_t);
|
||||
void term_writes(const char*);
|
||||
void puts(const char*);
|
||||
void set_cursor(int, int);
|
||||
void term_scroll(void);
|
||||
|
|
|
@ -7,13 +7,13 @@ int kernel_main(void) {
|
|||
screen_initialize();
|
||||
|
||||
//Print a copyright message.
|
||||
puts("(c)");
|
||||
term_writes("(c)");
|
||||
term_setcolor(GREEN);
|
||||
puts(" Project");
|
||||
term_writes(" Project");
|
||||
term_setcolor(RED);
|
||||
puts("RED");
|
||||
term_writes("RED");
|
||||
term_setcolor(WHITE);
|
||||
puts(", 2019\n");
|
||||
term_writes(", 2019\n");
|
||||
|
||||
for(;;) {}
|
||||
return 0;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#include <sys/stat.h>
|
||||
/*#include <sys/stat.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/fcntl.h>
|
||||
#include <sys/times.h>
|
||||
|
@ -45,3 +45,4 @@ int unlink(char* name);
|
|||
int wait(int file, char* ptr, int len);
|
||||
|
||||
int gettimeofday(struct timeval* p, struct timezone* z);
|
||||
*/
|
6
makefile
6
makefile
|
@ -80,14 +80,14 @@ install-kernel: red.kernel
|
|||
cp red.kernel $(DESTDIR)$(BOOTDIR)
|
||||
|
||||
gen-iso:
|
||||
rm -f red.iso \
|
||||
cp red.kernel iso/boot/kernel.elf \
|
||||
rm -f red.iso
|
||||
cp red.kernel iso/boot/kernel.elf
|
||||
genisoimage -R \
|
||||
-b boot/grub/stage2_eltorito \
|
||||
-no-emul-boot \
|
||||
-A ProjectRED \
|
||||
-input-charset utf8 \
|
||||
-quiet
|
||||
-quiet \
|
||||
-boot-info-table \
|
||||
-o red.iso \
|
||||
iso
|
||||
|
|
Loading…
Reference in New Issue
Block a user