summaryrefslogtreecommitdiff
path: root/src/kernel.c
blob: a18e2d28b48888239824d8127a6bf3320a25b3bc (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
#include <stdint.h>

#include "vga.h"

void entry( void )
{
	vga_t vga;
	vga_init( &vga );

	vga_set_color( &vga, VGA_COLOR_LIGHT_GREY );
	vga_set_background_color( &vga, VGA_COLOR_BLACK );

	volatile char msg[] = "ABAOS 0.0.1 STARTING";
	vga_put_string( &vga, (const char *)msg );
	
	// clang 4.0.0 needs volatile otherwise it takes a random value
	// from the register in the second vga_put_char_at below??!
	volatile 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++;
		}
		vga_put_char_at( &vga, x_pos, y_pos, bar[i%4] );
		for( int j = 0; j < 1500; j++ ) {
		}
	}
	vga_put_char_at( &vga, x_pos, y_pos, '.' );	
	vga_put_newline( &vga );

	//~ 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 *)msg );
		//~ 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 *)msg );
}