示例#1
0
文件: vga.c 项目: Vkd1WV/boot_stub
// Print a string on the next line after the cursor position
uint kputs(const char *buf){
	uint i;
	uint16_t* pos;
	
//	if (start => VGA_SIZE) {
//		_scroll();
//		start =- VGA_WIDTH;
//	}
	pos = VGA_BUF+cursor.pos;
	
	for(i=0; buf[i] != '\0'; i++){
		if (buf[i] == '\n') {
			cursor.pos = (cursor.pos/VGA_WIDTH)*VGA_WIDTH + VGA_WIDTH;
			pos = VGA_BUF + cursor.pos;
		}
		else if (buf[i] == '\t'){
			cursor.pos = (cursor.pos/TAB_WIDTH)*TAB_WIDTH + TAB_WIDTH;
			pos = VGA_BUF + cursor.pos;
		}
		else{
			*pos = _mk_vgacell(buf[i]);
			pos++;
			cursor.pos++;
		}
	}
	
	_set_cursor(cursor.pos);
	
	return i;
}
示例#2
0
文件: vga.c 项目: Vkd1WV/boot_stub
// Print a character at the cursor position
void kputc(char c){
	uint16_t* pos;
	
	pos = VGA_BUF+cursor.pos;
	
	*pos = _mk_vgacell(c);
	_set_cursor(cursor.pos+1);
}
示例#3
0
文件: kconsole.c 项目: zzh8829/OSPP
void set_cursor(int x,int y)
{
	_set_cursor(x,y);
	uint16_t pos = (y*80)+x;
	outb(0x3d4, 0x0e);
	outb(0x3d5, (uint8_t)((pos>>8)&0xff));
	outb(0x3d4, 0x0f);
	outb(0x3d5, (uint8_t)(pos&0xff));
}
示例#4
0
文件: vga.c 项目: Vkd1WV/boot_stub
// Clear the screen
void clear_vga(){
	uint16_t  cell;
	uint16_t* pos;
	
	set_color(BLACK, WHITE);
	cell = _mk_vgacell(' ');
	
	for(pos=VGA_BUF; pos < VGA_BUF+VGA_SIZE; pos++){
		*pos = cell;
	}
	
	_set_cursor(0);
}
示例#5
0
void bb_litehtml_document_container::set_cursor( const litehtml::tchar_t *cursor ){
	_set_cursor( cursor );
}