more current params
IDE support for primary and secondary channels. video support. improved floppy and ide support.
This commit is contained in:
parent
38f8582088
commit
14342bf376
11 changed files with 192 additions and 29 deletions
|
|
@ -26,6 +26,10 @@
|
|||
#include <stdlib.h>
|
||||
#include <boot/linuxbios_table.h>
|
||||
|
||||
#ifdef VIDEO_CONSOLE
|
||||
#include <pc80/vga.h>
|
||||
#endif
|
||||
|
||||
|
||||
#include "do_inflate.h"
|
||||
|
||||
|
|
@ -147,11 +151,17 @@ int linuxbiosmain(unsigned long base, unsigned long totalram)
|
|||
set_memory_size(empty_zero_page, 0x3c00, totalram - 2048);
|
||||
post_code(0xfa);
|
||||
|
||||
printk_notice("command line - [%s]\n", cmd_line);
|
||||
printk_notice("\ncommand line - [%s]\n", cmd_line);
|
||||
|
||||
set_command_line(empty_zero_page, cmd_line);
|
||||
set_root_rdonly(empty_zero_page);
|
||||
|
||||
#ifdef VIDEO_CONSOLE
|
||||
set_display(empty_zero_page, LINES, COLS);
|
||||
#else
|
||||
set_display(empty_zero_page, 25, 80);
|
||||
#endif
|
||||
|
||||
set_initrd(empty_zero_page, initrd_start, initrd_size);
|
||||
|
||||
/* Reset to booting from this image as late as possible */
|
||||
|
|
|
|||
|
|
@ -1,22 +1,50 @@
|
|||
/*
|
||||
*
|
||||
* modified from original freebios code
|
||||
* by Steve M. Gehlbach <steve@kesa.com>
|
||||
*
|
||||
*/
|
||||
|
||||
#include <video_subr.h>
|
||||
#include <string.h>
|
||||
#include <pc80/vga.h>
|
||||
#include <cpu/p5/io.h>
|
||||
|
||||
void beep(int ms);
|
||||
|
||||
# This used to work but has not been tested recently.
|
||||
// kludgy but this is only used here ...
|
||||
static char *vidmem; /* The video buffer, should be replaced by symbol in ldscript.ld */
|
||||
static int video_line, video_col;
|
||||
int video_line, video_col;
|
||||
|
||||
#define LINES 25 /* Number of lines and */
|
||||
#define COLS 80 /* columns on display */
|
||||
#define VIDBUFFER 0xA000;
|
||||
#define VIDBUFFER 0xB8000;
|
||||
|
||||
void memsetw(void *s, int c, unsigned int n)
|
||||
{
|
||||
int i;
|
||||
u16 *ss = (u16 *) s;
|
||||
|
||||
for (i = 0; i < n; i++) {
|
||||
ss[i] = ( u16 ) c;
|
||||
}
|
||||
}
|
||||
|
||||
void video_init(void)
|
||||
{
|
||||
|
||||
// these are globals
|
||||
video_line = 0;
|
||||
video_col = 0;
|
||||
vidmem = (char *) VIDBUFFER;
|
||||
memset(vidmem, 0, 64*1024);
|
||||
vidmem = (unsigned char *) VIDBUFFER;
|
||||
|
||||
// mainboard or chip specific init routines
|
||||
// also loads font
|
||||
vga_hardware_fixup();
|
||||
|
||||
// set attributes, char for entire screen
|
||||
// font should be previously loaded in
|
||||
// device specific code (vga_hardware_fixup)
|
||||
memsetw(vidmem, VGA_ATTR_CLR_WHT, 2*1024); //
|
||||
}
|
||||
|
||||
static void video_scroll(void)
|
||||
{
|
||||
int i;
|
||||
|
|
@ -30,15 +58,29 @@ void video_tx_byte(unsigned char byte)
|
|||
{
|
||||
if (byte == '\n') {
|
||||
video_line++;
|
||||
}
|
||||
else if (byte == '\r') {
|
||||
video_col = 0;
|
||||
}
|
||||
else {
|
||||
|
||||
} else if (byte == '\r') {
|
||||
video_col = 0;
|
||||
|
||||
} else if (byte == '\b') {
|
||||
video_col--;
|
||||
|
||||
} else if (byte == '\t') {
|
||||
video_col += 4;
|
||||
|
||||
} else if (byte == '\a') {
|
||||
//beep
|
||||
beep(500);
|
||||
|
||||
} else {
|
||||
vidmem[((video_col + (video_line *COLS)) * 2)] = byte;
|
||||
vidmem[((video_col + (video_line *COLS)) * 2) +1] = 0x07;
|
||||
vidmem[((video_col + (video_line *COLS)) * 2) +1] = VGA_ATTR_CLR_WHT;
|
||||
video_col++;
|
||||
}
|
||||
if (video_col < 0) {
|
||||
video_col = 0;
|
||||
}
|
||||
if (video_col >= COLS) {
|
||||
video_line++;
|
||||
video_col = 0;
|
||||
|
|
@ -47,4 +89,8 @@ void video_tx_byte(unsigned char byte)
|
|||
video_scroll();
|
||||
video_line--;
|
||||
}
|
||||
// move the cursor
|
||||
write_crtc((video_col + (video_line *COLS)) >> 8, CRTC_CURSOR_HI);
|
||||
write_crtc((video_col + (video_line *COLS)) & 0x0ff, CRTC_CURSOR_LO);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue