summaryrefslogtreecommitdiff
path: root/src/kernel.c
blob: 2cbe40a8d09d5d65333a587120a8f5e2ae3a2c44 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#include <stdint.h>

#include "vga.h"
#include "serial.h"
#include "console.h"

void entry( void )
{	
	serial_t serial;
	serial_init( &serial );

	vga_t vga;
	vga_init( &vga );
	
	console_t console;
	console_init( &console );
	console_add_vga_output( &console, &vga );
	console_add_serial_output( &console, &serial );
	
	vga_set_color( &vga, VGA_COLOR_LIGHT_GREY );
	vga_set_background_color( &vga, VGA_COLOR_BLACK );
	
	console_put_string( &console, "Initializing hardware" );
	
	const char bar[] = "\\|/-";
	int y_pos = vga_get_cursor_y( &vga );
	int x_pos = vga_get_cursor_x( &vga );
	int i = 0;
	for( i = 0; i < 10000; i++ ) {
		if( i % 1000 == 0 ) {
			vga_put_char_at( &vga, x_pos, y_pos, '.' );
			x_pos++;
			serial_put_char( &serial, '.' );
		}
		vga_put_char_at( &vga, x_pos, y_pos, bar[i%4] );
		for( int j = 0; j < 150; j++ ) {
		}
	}
	vga_put_char_at( &vga, x_pos, y_pos, '.' );	
	serial_put_char( &serial, '.' );
	
	console_put_newline( &console );

	console_put_string( &console, "Terminating" );
	console_put_newline( &console );
		   
	//~ vga_set_color( &vga, VGA_COLOR_WHITE );
	//~ vga_set_background_color( &vga, VGA_COLOR_RED );
	//~ vga_clear_screen( &vga );

	//~ for( int i = 0; i < 50; i++ ) {
		//~ for( int j = 0; j < i; j++ ) {
			//~ vga_put_char( &vga, '-' );
		//~ }
		//~ vga_put_char( &vga, '>' );
		//~ vga_put_string( &vga, (const char *)"TEST TEST TEST" );
		//~ vga_put_newline( &vga );
	//~ }
	//~ for( int j = 0; j < 50; j++ ) {
		//~ vga_put_char( &vga, '-' );
	//~ }
	//~ vga_put_char( &vga, '>' );
	//~ vga_put_string( &vga, (const char *)"TEST TEST TEST" );
}