Ongoing changes to the boot and splash screen code
This commit is contained in:
parent
4821a4317d
commit
a9fa53550d
51
docs/notes/bootsector.md
Normal file
51
docs/notes/bootsector.md
Normal file
|
@ -0,0 +1,51 @@
|
|||
## FAT32 Volume Boot Record Format
|
||||
|
||||
Windows 10 checks for the following (https://github.com/microsoft/Windows-driver-samples/blob/16022c593787aef040b8a37ef697316e07f1322e/filesys/fastfat/fsctrl.c#L2546):
|
||||
|
||||
* [offset=0x000, length=3] First byte must be: 0xE9, 0xEB, 0x49
|
||||
* [offset=0x00B, length=2] BytesPerSector must be: 128, 256, 512, 1024, 2048, or 4096
|
||||
* [offset=0x00D, length=1] SectorsPerCluster must be: 1, 2, 4, 8, 16, 32, 64, or 128
|
||||
* [offset=0x00E, length=2] ReservedSectors must be > 0
|
||||
* [offset=0x010, length=1] NumberOfFATs must be > 0
|
||||
* Either [offset=0x013, length=2] Sectors or [offset=0x020, length=4] LargeSectors must be > 0
|
||||
* [offset=0x016, length=2] SectorsPerFat > 0 or ([offset=0x024, length=4] LargeSectorsPerFAT > 0 and [offset=0x02A, length=2] FsVersion = 0)
|
||||
* [offset=0x015, length=1] MediaType must be: 0xF0, 0xF8, 0xF9, 0xFB, 0xFD, 0xFE, 0xFF
|
||||
* Either [offset=0x016, length=2] SectorPerFAT = 0 or RootEntries > 0
|
||||
* Either [offset=0x016, length=2] SectorPerFAT > 0 or MirrorDisabled
|
||||
|
||||
Important Fields:
|
||||
* 0x000 - 0x002 : Boot jump code {0xEB 0xFE 0x00}
|
||||
* 0x003 - 0x00A : OEM Name
|
||||
* 0x00B - 0x05A : BPB and Extended BPB
|
||||
* 0x05B : CPU #
|
||||
* 0x05C - 0x05D : Adjustment spot for checksum (?)
|
||||
* 0x05E - 0x05F : Unused
|
||||
* 0x060 - 0x1FC : Boot sector code area
|
||||
* 0x1FD : Physical drive number (?)
|
||||
* 0x1FE - 0x1FF : Signature: 0x55 0xAA
|
||||
|
||||
For Foenix/MCP: 16-bit big-endian checksum of entire sector must equal 0x2560
|
||||
|
||||
Checksum: `sum = ((sum & 1) << 15) + (sum >> 1) + *w++;`
|
||||
|
||||
### Boot Process from Floppy and SDC
|
||||
|
||||
1. Load VBR into memory at 0x00000400
|
||||
2. Compute checksum and verify it comes to 0x2560
|
||||
3. Check that 0x05B has the right CPU ID
|
||||
4. Call to 0x00000460 as a subroutine
|
||||
|
||||
## Master Boot Record Format
|
||||
|
||||
* 0x000 - 0x1BD : Boot code area (approximate end point)
|
||||
* 0x1BE - 0x1FD : Partition data
|
||||
* 0x1FE - 0x1FF : Signature: 0x55 0xAA
|
||||
|
||||
For Foenix/MCP: 16-bit big-endian checksum of entire sector must equal 0x2560
|
||||
|
||||
### Boot Process for PATA drive
|
||||
|
||||
1. Load MBR into memory at 0x00000400
|
||||
2. Compute checksum and verify it comes to 0x2560
|
||||
3. Check that 0x05B has the right CPU ID
|
||||
4. Call to 0x00000400 as a subroutine
|
385
src/boot.c
Normal file
385
src/boot.c
Normal file
|
@ -0,0 +1,385 @@
|
|||
/**
|
||||
* @file boot.c
|
||||
*
|
||||
* Routines to support the boot process
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include "boot.h"
|
||||
#include "gabe_reg.h"
|
||||
#include "log.h"
|
||||
#include "simpleio.h"
|
||||
#include "syscalls.h"
|
||||
#include "sys_general.h"
|
||||
#include "vicky_general.h"
|
||||
#include "cli/cli.h"
|
||||
#include "dev/txt_screen.h"
|
||||
|
||||
#include "rsrc/font/quadrotextFONT.h"
|
||||
#if MODEL == MODEL_FOENIX_A2560U || MODEL == MODEL_FOENIX_A2560U_PLUS
|
||||
#include "rsrc/bitmaps/splash_a2560u.h"
|
||||
#elif MODEL == MODEL_FOENIX_A2560K
|
||||
#include "rsrc/bitmaps/splash_a2560k.h"
|
||||
#endif
|
||||
|
||||
#define SPLASH_WAIT_SEC 15
|
||||
|
||||
/*
|
||||
* Important scan codes
|
||||
*/
|
||||
#define SC_F1 0x3B
|
||||
#define SC_F2 0x3C
|
||||
#define SC_F3 0x3D
|
||||
#define SC_SPACE 0x39
|
||||
#define SC_RETURN 0x1C
|
||||
|
||||
/* TODO: move this to constants.h */
|
||||
#define MAX_PATH_LEN 256
|
||||
|
||||
#define BOOT_SECTOR_BUFFER ((volatile unsigned char *)0x00004000)
|
||||
#define BOOT_SECTOR_VBR_OFF 0x060
|
||||
#define BOOT_SECTOR_MBR_OFF 0x000
|
||||
|
||||
const char * MCP_INIT_SDC = "/sd/system/mcp.init"; /**< Path to config file on the SD card */
|
||||
const char * MCP_INIT_FDC = "/fd/system/mcp.init"; /**< Path to config file on the floppy drive */
|
||||
const char * MCP_INIT_HDC = "/hd/system/mcp.init"; /**< Path to config file on the IDE drive */
|
||||
|
||||
short cli_screen = 0; /**< The default screen to use for the REPL of the CLI */
|
||||
char cli_command_path[MAX_PATH_LEN]; /**< Path to the command processor (empty string for built-in) */
|
||||
|
||||
/**
|
||||
* Set the path of the command shell
|
||||
*
|
||||
* @param path the path to the command processor executable (0 or empty string for default)
|
||||
*/
|
||||
void cli_command_set(const char * path) {
|
||||
if (path) {
|
||||
// Copy the desired path
|
||||
strncpy(cli_command_path, path, MAX_PATH_LEN);
|
||||
|
||||
} else {
|
||||
// Set to the default CLI
|
||||
cli_command_path[0] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the path of the command shell
|
||||
*
|
||||
* @param path pointer to the buffer to store the path (empty string means default)
|
||||
*/
|
||||
void cli_command_get(char * path) {
|
||||
// Copy the desired path
|
||||
strncpy(path, cli_command_path, MAX_PATH_LEN);
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if a sector loaded from a device is bootable
|
||||
*
|
||||
* @param sector pointer to where the sector is stored in memory
|
||||
* @param device the number of the block device
|
||||
*
|
||||
* @return 0 if not bootable, non-zero if bootable
|
||||
*/
|
||||
short is_bootable(unsigned short * sector, short device) {
|
||||
short bootable = 0;
|
||||
|
||||
switch(device) {
|
||||
case BDEV_FDC:
|
||||
case BDEV_SDC:
|
||||
break;
|
||||
|
||||
case BDEV_HDC:
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return bootable;
|
||||
}
|
||||
|
||||
/**
|
||||
* Run the code in the boot sector
|
||||
*
|
||||
* @param device the number of the block device for the sector
|
||||
*/
|
||||
void boot_sector_run(short device) {
|
||||
FUNC_V_2_V boot_sector = (FUNC_V_2_V)(BOOT_SECTOR_BUFFER + 0x060);
|
||||
|
||||
switch(device) {
|
||||
case BDEV_FDC:
|
||||
case BDEV_SDC:
|
||||
boot_sector = (FUNC_V_2_V)(BOOT_SECTOR_BUFFER + BOOT_SECTOR_VBR_OFF);
|
||||
boot_sector();
|
||||
break;
|
||||
|
||||
case BDEV_HDC:
|
||||
boot_sector = (FUNC_V_2_V)(BOOT_SECTOR_BUFFER + BOOT_SECTOR_MBR_OFF);
|
||||
boot_sector();
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void make_key_name(const char * original, char * buffer) {
|
||||
int x;
|
||||
for (x = 0; x < strlen(original); x++) {
|
||||
buffer[x] = 0x80 | original[x];
|
||||
}
|
||||
buffer[strlen(original)] = 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Load and display the boot splash screen on the graphics screen
|
||||
*
|
||||
* @return boot device selected by user
|
||||
*/
|
||||
short boot_screen() {
|
||||
t_rect region;
|
||||
short device = BOOT_DEFAULT;
|
||||
short screen = 0;
|
||||
char buffer[256];
|
||||
char entry[50];
|
||||
long target_jiffies = 0;
|
||||
int i = 0;
|
||||
const unsigned char * pixels;
|
||||
volatile unsigned char * vram = VRAM_Bank0;
|
||||
t_sys_info info;
|
||||
char f1[3], f2[3], f3[3];
|
||||
char space[10], cr_text[10];
|
||||
|
||||
#if MODEL == MODEL_FOENIX_A2560K
|
||||
screen = 1;
|
||||
#else
|
||||
screen = 0;
|
||||
#endif
|
||||
|
||||
/* Turn off the screen */
|
||||
txt_set_mode(screen, 0);
|
||||
|
||||
for (i = 0; i < 256; i++) {
|
||||
LUT_0[4*i] = splashscreen_lut[4*i];
|
||||
LUT_0[4*i+1] = splashscreen_lut[4*i+1];
|
||||
LUT_0[4*i+2] = splashscreen_lut[4*i+2];
|
||||
LUT_0[4*i+3] = splashscreen_lut[4*i+3];
|
||||
}
|
||||
|
||||
/* Copy the bitmap to video RAM */
|
||||
for (pixels = splashscreen_pix; *pixels != 0;) {
|
||||
unsigned char count = *pixels++;
|
||||
unsigned char pixel = *pixels++;
|
||||
for (i = 0; i < count; i++) {
|
||||
*vram++ = pixel;
|
||||
}
|
||||
}
|
||||
|
||||
/* Set up the bitmap */
|
||||
*BM0_Addy_Pointer_Reg = 0;
|
||||
*BM0_Control_Reg = 1;
|
||||
|
||||
/* Set a background color for the bitmap mode */
|
||||
#if MODEL == MODEL_FOENIX_A2560K
|
||||
*BackGroundControlReg_B = 0x00202020;
|
||||
screen = 1;
|
||||
#else
|
||||
*BackGroundControlReg_A = 0x00202020;
|
||||
screen = 0;
|
||||
#endif
|
||||
|
||||
/* Display the splashscreen at 640x480 without a border */
|
||||
txt_set_resolution(screen, 640, 680);
|
||||
txt_set_border(screen, 0, 0);
|
||||
txt_set_font(screen, 8, 8, quadrotextFONT);
|
||||
|
||||
region.origin.x = 0;
|
||||
region.origin.y = 0;
|
||||
region.size.width = 0;
|
||||
region.size.height = 0;
|
||||
txt_set_region(screen, ®ion);
|
||||
txt_setsizes(screen);
|
||||
txt_set_mode(screen, TXT_MODE_TEXT | TXT_MODE_BITMAP);
|
||||
|
||||
/* Disable the cursor, set the color, clear the text screen, and display the text message */
|
||||
txt_set_cursor(screen, 0, 0, 0); // Disable the cursor
|
||||
txt_set_color(screen, 15, 0); // White on transparent
|
||||
txt_fill(screen, ' '); // Clear the screen
|
||||
|
||||
make_key_name("F1", f1);
|
||||
make_key_name("F2", f2);
|
||||
make_key_name("F3", f3);
|
||||
make_key_name("SPACE", space);
|
||||
make_key_name("RETURN", cr_text);
|
||||
|
||||
sprintf(buffer, "BOOT: %s=FLOPPY, %s=SD CARD, %s=HARD DRIVE, %s=DEFAULT, %s=SAFE", f1, f2, f3, space, cr_text);
|
||||
txt_set_xy(screen, (80 - strlen(buffer)) / 2, 58);
|
||||
sys_chan_write(screen, buffer, strlen(buffer));
|
||||
|
||||
// Get the information about the system
|
||||
sys_get_info(&info);
|
||||
|
||||
region.origin.x = 49;
|
||||
region.origin.y = 1;
|
||||
region.size.width = 40;
|
||||
region.size.height = 20;
|
||||
txt_set_region(screen, ®ion);
|
||||
|
||||
sprintf(buffer, "\x1b[HFOENIX/MCP V: %02d.%02d.%04d\n", info.mcp_version, info.mcp_rev, info.mcp_build);
|
||||
print(screen, buffer);
|
||||
str_upcase(info.model_name, entry);
|
||||
sprintf(buffer, " MODEL: %s\n", entry);
|
||||
print(screen, buffer);
|
||||
str_upcase(info.cpu_name, entry);
|
||||
sprintf(buffer, " CPU: %s\n", entry);
|
||||
print(screen, buffer);
|
||||
sprintf(buffer, " BOARD: %s\n", info.pcb_version);
|
||||
print(screen, buffer);
|
||||
sprintf(buffer, " FPGA V: %02d.%02d.%04d\n", info.fpga_model, info.fpga_version, info.fpga_subver);
|
||||
print(screen, buffer);
|
||||
sprintf(buffer, " FPGA DATE: %06X\n", info.fpga_date);
|
||||
print(screen, buffer);
|
||||
|
||||
/* Wait until the target duration has been reached _or_ the user presses a key */
|
||||
sprintf(buffer, "Booting using the default device.");
|
||||
target_jiffies = sys_time_jiffies() + SPLASH_WAIT_SEC * 60;
|
||||
while (target_jiffies > sys_time_jiffies()) {
|
||||
short scan_code = sys_kbd_scancode();
|
||||
if (scan_code != 0) {
|
||||
switch (scan_code) {
|
||||
case SC_F1:
|
||||
device = BDEV_FDC;
|
||||
sprintf(buffer, "Booting from floppy drive.");
|
||||
break;
|
||||
|
||||
case SC_F2:
|
||||
device = BDEV_SDC;
|
||||
sprintf(buffer, "Booting from SD card.");
|
||||
break;
|
||||
|
||||
case SC_F3:
|
||||
device = BDEV_HDC;
|
||||
sprintf(buffer, "Booting from hard drive.");
|
||||
break;
|
||||
|
||||
case SC_RETURN:
|
||||
device = BOOT_SAFE;
|
||||
sprintf(buffer, "Booting directly to the command line.");
|
||||
break;
|
||||
|
||||
default:
|
||||
device = BOOT_DEFAULT;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
txt_init_screen(screen);
|
||||
print(screen, buffer);
|
||||
|
||||
return device;
|
||||
}
|
||||
|
||||
/**
|
||||
* Start the boot process after initializing the MCP
|
||||
*
|
||||
* @param device the number of the block device to use for booting (-1 to go straight to CLI)
|
||||
*/
|
||||
void boot_from_bdev(short device) {
|
||||
unsigned short boot_dip = 0; // The setting on the user and boot mode DIP switches
|
||||
short bootable = 0; // Is the boot sector of the selected device bootable?
|
||||
|
||||
// Get the boot device
|
||||
switch (device) {
|
||||
case BOOT_DEFAULT:
|
||||
// User chose the default. Look at the DIP switches to determine the boot source
|
||||
boot_dip = *GABE_DIP_REG & GABE_DIP_BOOT_MASK;
|
||||
switch (boot_dip) {
|
||||
case 0x0000:
|
||||
// Boot from IDE
|
||||
device = BDEV_HDC;
|
||||
log(LOG_INFO, "Boot DIP set for IDE");
|
||||
break;
|
||||
|
||||
case 0x0001:
|
||||
// Boot from SDC
|
||||
device = BDEV_SDC;
|
||||
log(LOG_INFO, "Boot DIP set for SDC");
|
||||
break;
|
||||
|
||||
case 0x0002:
|
||||
// Boot from Floppy
|
||||
device = BDEV_FDC;
|
||||
log(LOG_INFO, "Boot DIP set for FDC");
|
||||
break;
|
||||
|
||||
default:
|
||||
// Boot straight to REPL
|
||||
log(LOG_INFO, "Boot DIP set for REPL");
|
||||
device = -1;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
// if (device >= 0) {
|
||||
// // Try to load the boot sector
|
||||
// short result = bdev_read(device, 0, BOOT_SECTOR_BUFFER, 512);
|
||||
// if (result == 0) {
|
||||
// // Check to see if it's bootable
|
||||
// switch (device) {
|
||||
// bootable = is_bootable(BOOT_SECTOR_BUFFER, device);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
// if (bootable) {
|
||||
// // If bootable, run it
|
||||
// boot_sector_run(device);
|
||||
//
|
||||
// } else {
|
||||
// If not bootable...
|
||||
if (device >= 0) {
|
||||
// Execute startup file on boot device (if present)
|
||||
switch (device) {
|
||||
case BDEV_SDC:
|
||||
print(cli_screen, "Reading configuration from SDC.\n");
|
||||
if (cli_exec_batch(cli_screen, MCP_INIT_SDC) != 0) {
|
||||
cli_exec_batch(cli_screen, MCP_INIT_HDC);
|
||||
}
|
||||
break;
|
||||
|
||||
case BDEV_FDC:
|
||||
print(cli_screen, "Reading configuration from floppy.\n");
|
||||
if (cli_exec_batch(cli_screen, MCP_INIT_FDC) != 0) {
|
||||
cli_exec_batch(cli_screen, MCP_INIT_HDC);
|
||||
}
|
||||
break;
|
||||
|
||||
case BDEV_HDC:
|
||||
print(cli_screen, "Reading configuration from PATA.\n");
|
||||
cli_exec_batch(cli_screen, MCP_INIT_HDC);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Start up the command shell
|
||||
if (cli_command_path[0] != 0) {
|
||||
// Over-ride path provided, boot it
|
||||
sys_proc_run(cli_command_path, 0, 0);
|
||||
|
||||
} else {
|
||||
// No over-ride provided... boot the default
|
||||
cli_repl(cli_screen);
|
||||
}
|
||||
// }
|
||||
}
|
41
src/boot.h
Normal file
41
src/boot.h
Normal file
|
@ -0,0 +1,41 @@
|
|||
/**
|
||||
* @file boot.h
|
||||
*
|
||||
* Routines to support the boot process
|
||||
*/
|
||||
|
||||
#ifndef __BOOT_H
|
||||
#define __BOOT_H
|
||||
|
||||
#define BOOT_DEFAULT -1
|
||||
#define BOOT_SAFE -2
|
||||
|
||||
/**
|
||||
* Set the path of the command shell
|
||||
*
|
||||
* @param path the path to the command processor executable (0 or empty string for default)
|
||||
*/
|
||||
extern void cli_command_set(const char * path);
|
||||
|
||||
/**
|
||||
* Gets the path of the command shell
|
||||
*
|
||||
* @param path pointer to the buffer to store the path (empty string means default)
|
||||
*/
|
||||
extern void cli_command_get(char * path);
|
||||
|
||||
/*
|
||||
* Load and display the boot splash screen on the graphics screen
|
||||
*
|
||||
* @return boot device selected by user
|
||||
*/
|
||||
extern short boot_screen();
|
||||
|
||||
/**
|
||||
* Start the boot process after initializing the MCP
|
||||
*
|
||||
* @param device the number of the block device to use for booting (-1 to go straight to CLI)
|
||||
*/
|
||||
extern void boot_from_bdev(short device);
|
||||
|
||||
#endif
|
|
@ -781,7 +781,10 @@ short con_install() {
|
|||
/* Pre-open the console and EVID channels */
|
||||
|
||||
chan_open(CDEV_CONSOLE, 0, 0);
|
||||
// chan_open(CDEV_EVID, 0, 0);
|
||||
|
||||
#if MODEL == MODEL_FOENIX_A2560K
|
||||
chan_open(CDEV_EVID, 0, 0);
|
||||
#endif
|
||||
|
||||
return result;
|
||||
}
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
#include "dev/txt_screen.h"
|
||||
#include "dev/txt_a2560k_a.h"
|
||||
|
||||
extern const unsigned char foenix_st_8x8[];
|
||||
extern const unsigned char MSX_CP437_8x8_bin[];
|
||||
|
||||
/* Default text color lookup table values (AARRGGBB) */
|
||||
const unsigned long a2560k_a_lut[VKY3_A_LUT_SIZE] = {
|
||||
|
@ -545,7 +545,7 @@ void txt_a2560k_a_init() {
|
|||
txt_a2560k_a_set_color(0x07, 0x04);
|
||||
|
||||
/* Set the font */
|
||||
txt_a2560k_a_set_font(8, 8, foenix_st_8x8); /* Use 8x8 font */
|
||||
txt_a2560k_a_set_font(8, 8, MSX_CP437_8x8_bin); /* Use 8x8 font */
|
||||
|
||||
/* Set the cursor */
|
||||
txt_a2560k_a_set_cursor(1, 0, 0xB1);
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
#include "dev/txt_screen.h"
|
||||
#include "dev/txt_a2560k_b.h"
|
||||
|
||||
extern const unsigned char foenix_st_8x8[];
|
||||
extern const unsigned char MSX_CP437_8x8_bin[];
|
||||
|
||||
/* Default text color lookup table values (AARRGGBB) */
|
||||
const unsigned long a2560k_b_lut[VKY3_B_LUT_SIZE] = {
|
||||
|
@ -544,14 +544,14 @@ void txt_a2560k_b_init() {
|
|||
txt_a2560k_b_set_color(0x07, 0x04);
|
||||
|
||||
/* Set the font */
|
||||
txt_a2560k_b_set_font(8, 8, foenix_st_8x8); /* Use 8x8 font */
|
||||
txt_a2560k_b_set_font(8, 8, MSX_CP437_8x8_bin); /* Use 8x8 font */
|
||||
|
||||
/* Set the cursor */
|
||||
txt_a2560k_b_set_cursor(1, 0, 0xB1);
|
||||
|
||||
/* Set the border */
|
||||
txt_a2560k_b_set_border(32, 32); /* No border for now */
|
||||
txt_a2560k_b_set_border_color(0x7f, 0x00, 0x7f);
|
||||
txt_a2560k_b_set_border(16, 16); /* Set up the border */
|
||||
txt_a2560k_b_set_border_color(0, 0, 0x3f);
|
||||
|
||||
/*
|
||||
* Enable set_sizes, now that everything is set up initially
|
||||
|
|
178
src/foenixmcp.c
178
src/foenixmcp.c
|
@ -19,11 +19,11 @@
|
|||
|
||||
#include "syscalls.h"
|
||||
#include "timers.h"
|
||||
#include "boot.h"
|
||||
#include "dev/block.h"
|
||||
#include "dev/channel.h"
|
||||
#include "dev/console.h"
|
||||
#include "dev/fdc.h"
|
||||
// #include "dev/text_screen_iii.h"
|
||||
#include "dev/txt_screen.h"
|
||||
#include "dev/txt_a2560k_a.h"
|
||||
#include "dev/txt_a2560k_b.h"
|
||||
|
@ -40,23 +40,10 @@
|
|||
#include "snd/yamaha.h"
|
||||
#include "fatfs/ff.h"
|
||||
#include "cli/cli.h"
|
||||
|
||||
#if MODEL == MODEL_FOENIX_A2560U || MODEL == MODEL_FOENIX_A2560U_PLUS
|
||||
#include "rsrc/bitmaps/splash_a2560u.h"
|
||||
#elif MODEL == MODEL_FOENIX_A2560K
|
||||
#include "rsrc/bitmaps/splash_a2560k.h"
|
||||
#endif
|
||||
|
||||
#include "rsrc/font/foenix_st_8_8.h"
|
||||
#include "rsrc/font/MSX_CP437_8x8.h"
|
||||
|
||||
const char* VolumeStr[FF_VOLUMES] = { "sd", "fd", "hd" };
|
||||
|
||||
const char * MCP_INIT_SDC = "/sd/system/mcp.init"; /**< Path to config file on the SD card */
|
||||
const char * MCP_INIT_FDC = "/fd/system/mcp.init"; /**< Path to config file on the floppy drive */
|
||||
const char * MCP_INIT_HDC = "/hd/system/mcp.init"; /**< Path to config file on the IDE drive */
|
||||
|
||||
short cli_screen = 0; /**< The default screen to use for the REPL of the CLI */
|
||||
|
||||
#if MODEL == MODEL_FOENIX_A2560K
|
||||
/*
|
||||
* Initialize the SuperIO registers
|
||||
|
@ -116,64 +103,6 @@ short cli_screen = 0; /**< The default screen to use for the REPL of the CLI *
|
|||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Load and display the splash screen
|
||||
*/
|
||||
void load_splashscreen() {
|
||||
long target_ticks;
|
||||
int i;
|
||||
const unsigned char * pixels;
|
||||
volatile unsigned char * vram = VRAM_Bank0;
|
||||
|
||||
/* Turn off the screen */
|
||||
#if MODEL == MODEL_FOENIX_A2560K
|
||||
*MasterControlReg_B = VKY3_MCR_VIDEO_DISABLE;
|
||||
#else
|
||||
*MasterControlReg_A = VKY3_MCR_VIDEO_DISABLE;
|
||||
#endif
|
||||
|
||||
for (i = 0; i < 256; i++) {
|
||||
LUT_0[4*i] = splashscreen_lut[4*i];
|
||||
LUT_0[4*i+1] = splashscreen_lut[4*i+1];
|
||||
LUT_0[4*i+2] = splashscreen_lut[4*i+2];
|
||||
LUT_0[4*i+3] = splashscreen_lut[4*i+3];
|
||||
}
|
||||
|
||||
/* Copy the bitmap to video RAM */
|
||||
for (pixels = splashscreen_pix; *pixels != 0;) {
|
||||
unsigned char count = *pixels++;
|
||||
unsigned char pixel = *pixels++;
|
||||
for (i = 0; i < count; i++) {
|
||||
*vram++ = pixel;
|
||||
}
|
||||
}
|
||||
|
||||
/* Set up the bitmap */
|
||||
*BM0_Addy_Pointer_Reg = 0;
|
||||
*BM0_Control_Reg = 1;
|
||||
|
||||
/* Turn off the border */
|
||||
#if MODEL == MODEL_FOENIX_A2560K
|
||||
*BorderControlReg_L_B = 0;
|
||||
#else
|
||||
*BorderControlReg_L_A = 0;
|
||||
#endif
|
||||
|
||||
/* Set a background color for the bitmap mode */
|
||||
#if MODEL == MODEL_FOENIX_A2560K
|
||||
*BackGroundControlReg_B = 0x00202020;
|
||||
#else
|
||||
*BackGroundControlReg_A = 0x00202020;
|
||||
#endif
|
||||
|
||||
/* Display the splashscreen: 640x480 */
|
||||
#if MODEL == MODEL_FOENIX_A2560K
|
||||
*MasterControlReg_B = VKY3_MCR_GRAPH_EN | VKY3_MCR_BITMAP_EN;
|
||||
#else
|
||||
*MasterControlReg_A = VKY3_MCR_GRAPH_EN | VKY3_MCR_BITMAP_EN;
|
||||
#endif
|
||||
}
|
||||
|
||||
void print_error(short channel, char * message, short code) {
|
||||
print(channel, message);
|
||||
print(channel, ": ");
|
||||
|
@ -252,9 +181,6 @@ void initialize() {
|
|||
int_enable_all();
|
||||
log(LOG_TRACE, "Interrupts enabled");
|
||||
|
||||
// /* Display the splash screen */
|
||||
//load_splashscreen();
|
||||
|
||||
/* Play the SID test bong on the Gideon SID implementation */
|
||||
sid_test_internal();
|
||||
|
||||
|
@ -317,97 +243,6 @@ void initialize() {
|
|||
|
||||
#define BOOT_DEFAULT -1 // User chose default, or the time to over-ride has passed
|
||||
|
||||
/**
|
||||
* Process the final boot chain.
|
||||
*
|
||||
* @param selection the user's selection from the splash screen for desired boot device
|
||||
*/
|
||||
void boot_chain(short selection) {
|
||||
unsigned char boot_sector[512];
|
||||
short bootable = 0;
|
||||
short device = -1;
|
||||
unsigned short boot_dip = 0;
|
||||
|
||||
// Get the boot device
|
||||
switch (selection) {
|
||||
case BOOT_DEFAULT:
|
||||
// User chose the default. Look at the DIP switches to determine the boot source
|
||||
boot_dip = *GABE_DIP_REG & GABE_DIP_BOOT_MASK;
|
||||
switch (boot_dip) {
|
||||
case 0x0000:
|
||||
// Boot from IDE
|
||||
device = BDEV_HDC;
|
||||
log(LOG_INFO, "Boot DIP set for IDE");
|
||||
break;
|
||||
|
||||
case 0x0001:
|
||||
// Boot from SDC
|
||||
device = BDEV_SDC;
|
||||
log(LOG_INFO, "Boot DIP set for SDC");
|
||||
break;
|
||||
|
||||
case 0x0002:
|
||||
// Boot from Floppy
|
||||
device = BDEV_FDC;
|
||||
log(LOG_INFO, "Boot DIP set for FDC");
|
||||
break;
|
||||
|
||||
default:
|
||||
// Boot straight to REPL
|
||||
log(LOG_INFO, "Boot DIP set for REPL");
|
||||
device = -1;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
device = selection;
|
||||
break;
|
||||
}
|
||||
|
||||
// if (device >= 0) {
|
||||
// // Try to load the boot sector
|
||||
// short result = bdev_read(device, 0, boot_sector, 512);
|
||||
// if (result == 0) {
|
||||
// // Check to see if it's bootable
|
||||
//
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// if (bootable) {
|
||||
// // TODO: If bootable, run it
|
||||
//
|
||||
// } else {
|
||||
// If not bootable...
|
||||
if (device >= 0) {
|
||||
// Execute startup file on boot device (if present)
|
||||
switch (device) {
|
||||
case BDEV_SDC:
|
||||
if (cli_exec_batch(cli_screen, MCP_INIT_SDC) != 0) {
|
||||
cli_exec_batch(cli_screen, MCP_INIT_HDC);
|
||||
}
|
||||
break;
|
||||
|
||||
case BDEV_FDC:
|
||||
if (cli_exec_batch(cli_screen, MCP_INIT_FDC) != 0) {
|
||||
cli_exec_batch(cli_screen, MCP_INIT_HDC);
|
||||
}
|
||||
break;
|
||||
|
||||
case BDEV_HDC:
|
||||
cli_exec_batch(cli_screen, MCP_INIT_HDC);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Start up REPL
|
||||
cli_repl(cli_screen);
|
||||
// }
|
||||
}
|
||||
|
||||
int main(int argc, char * argv[]) {
|
||||
const char * color_bars = "\x1b[31m\x0b\x0c\x1b[35m\x0b\x0c\x1b[33m\x0b\x0c\x1b[32m\x0b\x0c\x1b[36m\x0b\x0c";
|
||||
|
||||
|
@ -443,6 +278,12 @@ int main(int argc, char * argv[]) {
|
|||
|
||||
initialize();
|
||||
|
||||
// Make sure the command path is set to the default before we get started
|
||||
cli_command_set("");
|
||||
|
||||
// Display the splash screen and wait for user input
|
||||
short boot_dev = boot_screen();
|
||||
|
||||
sprintf(welcome, " %s%s\n %s %s\n %s %s\n %s %s\n%s %s\n\n", color_bars, title_1, color_bars, title_2, color_bars, title_3, color_bars, title_4, color_bars, title_5);
|
||||
sys_chan_write(0, welcome, strlen(welcome));
|
||||
|
||||
|
@ -450,8 +291,7 @@ int main(int argc, char * argv[]) {
|
|||
sys_chan_write(0, welcome, strlen(welcome));
|
||||
|
||||
// Start the boot process
|
||||
// TODO: allow for a user keypress to over-ride the boot device
|
||||
boot_chain(BDEV_SDC);
|
||||
boot_from_bdev(boot_dev);
|
||||
|
||||
log(LOG_INFO, "Stopping.");
|
||||
|
||||
|
|
9265
src/foenixmcp.s68
9265
src/foenixmcp.s68
File diff suppressed because it is too large
Load diff
|
@ -706,4 +706,14 @@ extern const char * sys_err_message(short err_number);
|
|||
*/
|
||||
extern short sys_kbd_layout(const char * tables);
|
||||
|
||||
/**
|
||||
* Load and execute an executable file
|
||||
*
|
||||
* @param path the path to the executable file
|
||||
* @param argc the number of arguments passed
|
||||
* @param argv the array of string arguments
|
||||
* @return the return result of the program
|
||||
*/
|
||||
extern short sys_proc_run(const char * path, int argc, char * argv[]);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -40,6 +40,7 @@ typedef struct s_color4 {
|
|||
* Function types
|
||||
*/
|
||||
|
||||
typedef short (*FUNC_V_2_V)();
|
||||
typedef short (*FUNC_V_2_S)();
|
||||
typedef short (*FUNC_S_2_S)(char *);
|
||||
typedef short (*FUNC_BS_2_S)(unsigned char *, short);
|
||||
|
|
18188
src/mapfile
18188
src/mapfile
File diff suppressed because it is too large
Load diff
BIN
src/rsrc/font/quadrotextFONT.bin
Normal file
BIN
src/rsrc/font/quadrotextFONT.bin
Normal file
Binary file not shown.
173
src/rsrc/font/quadrotextFONT.h
Normal file
173
src/rsrc/font/quadrotextFONT.h
Normal file
|
@ -0,0 +1,173 @@
|
|||
const unsigned char quadrotextFONT[] = {
|
||||
0x7e, 0x42, 0x5a, 0x52, 0x5e, 0x40, 0x7e, 0x00, 0x00, 0x00, 0x7e, 0x02,
|
||||
0x7e, 0x42, 0x7e, 0x00, 0x40, 0x40, 0x7e, 0x42, 0x42, 0x42, 0x7e, 0x00,
|
||||
0x00, 0x00, 0x7e, 0x40, 0x40, 0x40, 0x7e, 0x00, 0x02, 0x02, 0x7e, 0x42,
|
||||
0x42, 0x42, 0x7e, 0x00, 0x00, 0x00, 0x7e, 0x42, 0x7e, 0x40, 0x7e, 0x00,
|
||||
0x1c, 0x10, 0x10, 0x7c, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, 0x7e, 0x42,
|
||||
0x42, 0x7e, 0x02, 0x7e, 0x40, 0x40, 0x7e, 0x42, 0x42, 0x42, 0x42, 0x00,
|
||||
0x08, 0x00, 0x18, 0x08, 0x08, 0x08, 0x08, 0x00, 0x04, 0x00, 0x04, 0x04,
|
||||
0x04, 0x04, 0x44, 0x7c, 0x40, 0x40, 0x44, 0x48, 0x50, 0x68, 0x44, 0x00,
|
||||
0x18, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x00, 0x00, 0x00, 0x7f, 0x49,
|
||||
0x49, 0x49, 0x49, 0x00, 0x00, 0x00, 0x7e, 0x42, 0x42, 0x42, 0x42, 0x00,
|
||||
0x00, 0x00, 0x7e, 0x42, 0x42, 0x42, 0x7e, 0x00, 0x00, 0x00, 0x7e, 0x42,
|
||||
0x42, 0x7e, 0x40, 0x40, 0x00, 0x00, 0x7e, 0x42, 0x42, 0x7e, 0x02, 0x02,
|
||||
0x00, 0x00, 0x7e, 0x42, 0x40, 0x40, 0x40, 0x00, 0x00, 0x00, 0x7e, 0x40,
|
||||
0x7e, 0x02, 0x7e, 0x00, 0x10, 0x10, 0x7c, 0x10, 0x10, 0x10, 0x1c, 0x00,
|
||||
0x00, 0x00, 0x42, 0x42, 0x42, 0x42, 0x7e, 0x00, 0x00, 0x00, 0x42, 0x42,
|
||||
0x42, 0x24, 0x18, 0x00, 0x00, 0x00, 0x41, 0x49, 0x49, 0x49, 0x7f, 0x00,
|
||||
0x00, 0x00, 0x42, 0x24, 0x18, 0x24, 0x42, 0x00, 0x00, 0x00, 0x42, 0x42,
|
||||
0x42, 0x7e, 0x02, 0x7e, 0x00, 0x00, 0x7e, 0x04, 0x18, 0x20, 0x7e, 0x00,
|
||||
0x24, 0x00, 0x7e, 0x02, 0x7e, 0x42, 0x7e, 0x00, 0x24, 0x00, 0x7e, 0x42,
|
||||
0x42, 0x42, 0x7e, 0x00, 0x24, 0x00, 0x42, 0x42, 0x42, 0x42, 0x7e, 0x00,
|
||||
0x7c, 0x44, 0x44, 0x4c, 0x44, 0x44, 0x5c, 0x40, 0x18, 0x18, 0x7e, 0x02,
|
||||
0x7e, 0x42, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x08, 0x08, 0x08, 0x08, 0x00, 0x00, 0x08, 0x00, 0x24, 0x24, 0x24, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x24, 0x24, 0x7e, 0x24, 0x7e, 0x24, 0x24, 0x00,
|
||||
0x08, 0x3e, 0x28, 0x3e, 0x0a, 0x3e, 0x08, 0x00, 0x00, 0x62, 0x64, 0x08,
|
||||
0x10, 0x26, 0x46, 0x00, 0x78, 0x48, 0x48, 0x30, 0x4a, 0x44, 0x7a, 0x00,
|
||||
0x04, 0x08, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x08, 0x10, 0x10,
|
||||
0x10, 0x08, 0x04, 0x00, 0x20, 0x10, 0x08, 0x08, 0x08, 0x10, 0x20, 0x00,
|
||||
0x08, 0x2a, 0x1c, 0x3e, 0x1c, 0x2a, 0x08, 0x00, 0x00, 0x08, 0x08, 0x3e,
|
||||
0x08, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x08, 0x10,
|
||||
0x00, 0x00, 0x00, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x18, 0x18, 0x00, 0x00, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x00,
|
||||
0x3e, 0x22, 0x22, 0x22, 0x22, 0x22, 0x3e, 0x00, 0x04, 0x0c, 0x14, 0x04,
|
||||
0x04, 0x04, 0x04, 0x00, 0x3e, 0x02, 0x02, 0x3e, 0x20, 0x20, 0x3e, 0x00,
|
||||
0x3e, 0x02, 0x02, 0x3e, 0x02, 0x02, 0x3e, 0x00, 0x22, 0x22, 0x22, 0x3e,
|
||||
0x02, 0x02, 0x02, 0x00, 0x3e, 0x20, 0x20, 0x3e, 0x02, 0x02, 0x3e, 0x00,
|
||||
0x3e, 0x20, 0x20, 0x3e, 0x22, 0x22, 0x3e, 0x00, 0x3e, 0x02, 0x02, 0x04,
|
||||
0x08, 0x08, 0x08, 0x00, 0x3e, 0x22, 0x22, 0x3e, 0x22, 0x22, 0x3e, 0x00,
|
||||
0x3e, 0x22, 0x22, 0x3e, 0x02, 0x02, 0x3e, 0x00, 0x00, 0x00, 0x08, 0x00,
|
||||
0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x08, 0x08, 0x10,
|
||||
0x0e, 0x18, 0x30, 0x60, 0x30, 0x18, 0x0e, 0x00, 0x00, 0x00, 0x7e, 0x00,
|
||||
0x7e, 0x00, 0x00, 0x00, 0x70, 0x18, 0x0c, 0x06, 0x0c, 0x18, 0x70, 0x00,
|
||||
0x7e, 0x42, 0x02, 0x1e, 0x10, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0xff, 0x00, 0x00, 0x00, 0x7e, 0x42, 0x42, 0x7e, 0x42, 0x42, 0x42, 0x00,
|
||||
0x7c, 0x42, 0x42, 0x7c, 0x42, 0x42, 0x7c, 0x00, 0x7e, 0x42, 0x40, 0x40,
|
||||
0x40, 0x42, 0x7e, 0x00, 0x78, 0x44, 0x42, 0x42, 0x42, 0x44, 0x78, 0x00,
|
||||
0x7e, 0x40, 0x40, 0x78, 0x40, 0x40, 0x7e, 0x00, 0x7e, 0x40, 0x40, 0x78,
|
||||
0x40, 0x40, 0x40, 0x00, 0x7e, 0x42, 0x40, 0x4e, 0x42, 0x42, 0x7e, 0x00,
|
||||
0x42, 0x42, 0x42, 0x7e, 0x42, 0x42, 0x42, 0x00, 0x1c, 0x08, 0x08, 0x08,
|
||||
0x08, 0x08, 0x1c, 0x00, 0x0e, 0x04, 0x04, 0x04, 0x04, 0x44, 0x7c, 0x00,
|
||||
0x42, 0x44, 0x48, 0x70, 0x48, 0x44, 0x42, 0x00, 0x40, 0x40, 0x40, 0x40,
|
||||
0x40, 0x40, 0x7e, 0x00, 0x42, 0x66, 0x5a, 0x5a, 0x42, 0x42, 0x42, 0x00,
|
||||
0x42, 0x62, 0x52, 0x4a, 0x46, 0x42, 0x42, 0x00, 0x7e, 0x42, 0x42, 0x42,
|
||||
0x42, 0x42, 0x7e, 0x00, 0x7e, 0x42, 0x42, 0x7e, 0x40, 0x40, 0x40, 0x00,
|
||||
0x7e, 0x42, 0x42, 0x42, 0x4a, 0x46, 0x7e, 0x00, 0x7e, 0x42, 0x42, 0x7e,
|
||||
0x48, 0x44, 0x42, 0x00, 0x7e, 0x42, 0x40, 0x7e, 0x02, 0x42, 0x7e, 0x00,
|
||||
0x3e, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x00, 0x42, 0x42, 0x42, 0x42,
|
||||
0x42, 0x42, 0x7e, 0x00, 0x42, 0x42, 0x42, 0x42, 0x42, 0x24, 0x18, 0x00,
|
||||
0x42, 0x42, 0x42, 0x5a, 0x5a, 0x66, 0x42, 0x00, 0x42, 0x42, 0x24, 0x18,
|
||||
0x24, 0x42, 0x42, 0x00, 0x22, 0x22, 0x22, 0x14, 0x08, 0x08, 0x08, 0x00,
|
||||
0x7e, 0x02, 0x04, 0x18, 0x20, 0x40, 0x7e, 0x00, 0x24, 0x7e, 0x42, 0x42,
|
||||
0x7e, 0x42, 0x42, 0x00, 0x24, 0x7e, 0x42, 0x42, 0x42, 0x42, 0x7e, 0x00,
|
||||
0x24, 0x42, 0x42, 0x42, 0x42, 0x42, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x7f,
|
||||
0x54, 0x14, 0x14, 0x00, 0x40, 0xc0, 0x40, 0x40, 0x40, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x08, 0x08, 0x08,
|
||||
0x08, 0x08, 0x08, 0x08, 0xe0, 0xa0, 0xa0, 0xa0, 0xe0, 0x00, 0x00, 0x00,
|
||||
0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0xff, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,
|
||||
0x00, 0x00, 0x44, 0x44, 0x44, 0x44, 0x7a, 0x40, 0x01, 0x01, 0x01, 0x01,
|
||||
0x01, 0x01, 0x01, 0x01, 0x7e, 0x42, 0x20, 0x10, 0x20, 0x42, 0x7e, 0x00,
|
||||
0x1e, 0x12, 0x10, 0x10, 0x10, 0x10, 0x90, 0xf0, 0x3e, 0x22, 0x38, 0x24,
|
||||
0x24, 0x1c, 0x44, 0x7c, 0x01, 0x03, 0x05, 0x09, 0x11, 0x21, 0x7f, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x0f, 0x0f, 0x0f, 0x0f, 0x00, 0x00, 0x7a, 0x44,
|
||||
0x44, 0x44, 0x7a, 0x00, 0x00, 0x00, 0x41, 0x22, 0x14, 0x08, 0x14, 0x1c,
|
||||
0xe0, 0x20, 0xe0, 0x80, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0,
|
||||
0xa0, 0xa0, 0xa0, 0xe0, 0x00, 0x00, 0x00, 0x40, 0xc0, 0x40, 0x40, 0x40,
|
||||
0x00, 0x00, 0x00, 0xe0, 0x20, 0xe0, 0x80, 0xe0, 0x00, 0x00, 0x00, 0xe0,
|
||||
0x20, 0xe0, 0x20, 0xe0, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0xe0, 0x20, 0x20,
|
||||
0x00, 0x00, 0x00, 0xe0, 0x80, 0xe0, 0x20, 0xe0, 0x00, 0x00, 0x00, 0xe0,
|
||||
0x80, 0xe0, 0xa0, 0xe0, 0x00, 0x00, 0x00, 0xe0, 0x20, 0x40, 0x40, 0x40,
|
||||
0x00, 0x00, 0x00, 0xe0, 0xa0, 0xe0, 0xa0, 0xe0, 0x00, 0x00, 0x00, 0xe0,
|
||||
0xa0, 0xe0, 0x20, 0xe0, 0xe0, 0x20, 0xe0, 0x20, 0xe0, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0xf0, 0xf0, 0xf0, 0xf0, 0x08, 0x10, 0x20, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x1e, 0x12, 0x10, 0x78, 0x10, 0x12, 0x7e, 0x00,
|
||||
0x10, 0x08, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xf0, 0xf0, 0xf0,
|
||||
0x0f, 0x0f, 0x0f, 0x0f, 0x81, 0xbd, 0xa5, 0xad, 0xa1, 0xbf, 0x81, 0xff,
|
||||
0xff, 0xff, 0x81, 0xfd, 0x81, 0xbd, 0x81, 0xff, 0xbf, 0xbf, 0x81, 0xbd,
|
||||
0xbd, 0xbd, 0x81, 0xff, 0xff, 0xff, 0x81, 0xbf, 0xbf, 0xbf, 0x81, 0xff,
|
||||
0xfd, 0xfd, 0x81, 0xbd, 0xbd, 0xbd, 0x81, 0xff, 0xff, 0xff, 0x81, 0xbd,
|
||||
0x81, 0xbf, 0x81, 0xff, 0xe3, 0xef, 0xef, 0x83, 0xef, 0xef, 0xef, 0xff,
|
||||
0xff, 0xff, 0x81, 0xbd, 0xbd, 0x81, 0xfd, 0x81, 0xbf, 0xbf, 0x81, 0xbd,
|
||||
0xbd, 0xbd, 0xbd, 0xff, 0xf7, 0xff, 0xe7, 0xf7, 0xf7, 0xf7, 0xf7, 0xff,
|
||||
0xfb, 0xff, 0xfb, 0xfb, 0xfb, 0xfb, 0xbb, 0x83, 0xbf, 0xbf, 0xbb, 0xb7,
|
||||
0xaf, 0x97, 0xbb, 0xff, 0xe7, 0xf7, 0xf7, 0xf7, 0xf7, 0xf7, 0xf7, 0xff,
|
||||
0xff, 0xff, 0x80, 0xb6, 0xb6, 0xb6, 0xb6, 0xff, 0xff, 0xff, 0x81, 0xbd,
|
||||
0xbd, 0xbd, 0xbd, 0xff, 0xff, 0xff, 0x81, 0xbd, 0xbd, 0xbd, 0x81, 0xff,
|
||||
0xff, 0xff, 0x81, 0xbd, 0xbd, 0x81, 0xbf, 0xbf, 0xff, 0xff, 0x81, 0xbd,
|
||||
0xbd, 0x81, 0xfd, 0xfd, 0xff, 0xff, 0x81, 0xbd, 0xbf, 0xbf, 0xbf, 0xff,
|
||||
0xff, 0xff, 0x81, 0xbf, 0x81, 0xfd, 0x81, 0xff, 0xef, 0xef, 0x83, 0xef,
|
||||
0xef, 0xef, 0xe3, 0xff, 0xff, 0xff, 0xbd, 0xbd, 0xbd, 0xbd, 0x81, 0xff,
|
||||
0xff, 0xff, 0xbd, 0xbd, 0xbd, 0xdb, 0xe7, 0xff, 0xff, 0xff, 0xbe, 0xb6,
|
||||
0xb6, 0xb6, 0x80, 0xff, 0xff, 0xff, 0xbd, 0xdb, 0xe7, 0xdb, 0xbd, 0xff,
|
||||
0xff, 0xff, 0xbd, 0xbd, 0xbd, 0x81, 0xfd, 0x81, 0xff, 0xff, 0x81, 0xfb,
|
||||
0xe7, 0xdf, 0x81, 0xff, 0xdb, 0xff, 0x81, 0xfd, 0x81, 0xbd, 0x81, 0xff,
|
||||
0xdb, 0xff, 0x81, 0xbd, 0xbd, 0xbd, 0x81, 0xff, 0xdb, 0xff, 0xbd, 0xbd,
|
||||
0xbd, 0xbd, 0x81, 0xff, 0x83, 0xbb, 0xbb, 0xb3, 0xbb, 0xbb, 0xa3, 0xbf,
|
||||
0xe7, 0xe7, 0x81, 0xfd, 0x81, 0xbd, 0x81, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
0xff, 0xff, 0xff, 0xff, 0xf7, 0xf7, 0xf7, 0xf7, 0xff, 0xff, 0xf7, 0xff,
|
||||
0xdb, 0xdb, 0xdb, 0xff, 0xff, 0xff, 0xff, 0xff, 0xdb, 0xdb, 0x81, 0xdb,
|
||||
0x81, 0xdb, 0xdb, 0xff, 0xf7, 0xc1, 0xd7, 0xc1, 0xf5, 0xc1, 0xf7, 0xff,
|
||||
0xff, 0x9d, 0x9b, 0xf7, 0xef, 0xd9, 0xb9, 0xff, 0x87, 0xb7, 0xb7, 0xcf,
|
||||
0xb5, 0xbb, 0x85, 0xff, 0xfb, 0xf7, 0xef, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
0xfb, 0xf7, 0xef, 0xef, 0xef, 0xf7, 0xfb, 0xff, 0xdf, 0xef, 0xf7, 0xf7,
|
||||
0xf7, 0xef, 0xdf, 0xff, 0xf7, 0xd5, 0xe3, 0xc1, 0xe3, 0xd5, 0xf7, 0xff,
|
||||
0xff, 0xf7, 0xf7, 0xc1, 0xf7, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
0xff, 0xf7, 0xf7, 0xef, 0xff, 0xff, 0xff, 0x81, 0xff, 0xff, 0xff, 0xff,
|
||||
0x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 0xbb, 0xbb, 0x85, 0xff, 0xff, 0xff, 0xbe, 0xdd,
|
||||
0xeb, 0xf7, 0xeb, 0xe3, 0x1f, 0xdf, 0x1f, 0x7f, 0x1f, 0xff, 0xff, 0xff,
|
||||
0xff, 0xff, 0xff, 0x1f, 0x5f, 0x5f, 0x5f, 0x1f, 0xff, 0xff, 0xff, 0xbf,
|
||||
0x3f, 0xbf, 0xbf, 0xbf, 0xff, 0xff, 0xff, 0x1f, 0xdf, 0x1f, 0x7f, 0x1f,
|
||||
0xff, 0xff, 0xff, 0x1f, 0xdf, 0x1f, 0xdf, 0x1f, 0xff, 0xff, 0xff, 0x5f,
|
||||
0x5f, 0x1f, 0xdf, 0xdf, 0xff, 0xff, 0xff, 0x1f, 0x7f, 0x1f, 0xdf, 0x1f,
|
||||
0xff, 0xff, 0xff, 0x1f, 0x7f, 0x1f, 0x5f, 0x1f, 0xff, 0xff, 0xff, 0x1f,
|
||||
0xdf, 0xbf, 0xbf, 0xbf, 0xff, 0xff, 0xff, 0x1f, 0x5f, 0x1f, 0x5f, 0x1f,
|
||||
0xff, 0xff, 0xff, 0x1f, 0x5f, 0x1f, 0xdf, 0x1f, 0x1f, 0xdf, 0x1f, 0xdf,
|
||||
0x1f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x0f, 0x0f, 0x0f,
|
||||
0xf7, 0xef, 0xdf, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe1, 0xed, 0xef, 0x87,
|
||||
0xef, 0xed, 0x81, 0xff, 0xef, 0xf7, 0xfb, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
0x0f, 0x0f, 0x0f, 0x0f, 0xf0, 0xf0, 0xf0, 0x00
|
||||
};
|
|
@ -205,3 +205,17 @@ void dump_buffer(short channel, const unsigned char * buffer, short size, short
|
|||
print(channel, ascii_buffer);
|
||||
print(channel, "\n");
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert a string to upper case
|
||||
*
|
||||
* @param src the string to convert
|
||||
* @param dst the buffer in which to copy the converted string
|
||||
*/
|
||||
void str_upcase(const char * src, char * dst) {
|
||||
int i;
|
||||
for (i = 0; i < strlen(src); i++) {
|
||||
dst[i] = toupper(src[i]);
|
||||
}
|
||||
dst[strlen(src)] = 0;
|
||||
}
|
||||
|
|
|
@ -83,4 +83,12 @@ extern unsigned char i_to_bcd(unsigned short n);
|
|||
*/
|
||||
extern void dump_buffer(short channel, const unsigned char * buffer, short size, short labels);
|
||||
|
||||
/**
|
||||
* Convert a string to upper case
|
||||
*
|
||||
* @param src the string to convert
|
||||
* @param dst the buffer in which to copy the converted string
|
||||
*/
|
||||
extern void str_upcase(const char * src, char * dst);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -682,3 +682,15 @@ const char * sys_err_message(short err_number) {
|
|||
short sys_kbd_layout(const char * tables) {
|
||||
return syscall(KFN_KBD_LAYOUT, tables);
|
||||
}
|
||||
|
||||
/**
|
||||
* Load and execute an executable file
|
||||
*
|
||||
* @param path the path to the executable file
|
||||
* @param argc the number of arguments passed
|
||||
* @param argv the array of string arguments
|
||||
* @return the return result of the program
|
||||
*/
|
||||
short sys_proc_run(const char * path, int argc, char * argv[]) {
|
||||
return syscall(KFN_RUN, path, argc, argv);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue