Merge pull request #29 from vinz6751/remove-warnings-1
Remove warnings 2
This commit is contained in:
commit
363271e085
|
@ -189,7 +189,7 @@ short cdev_init(short dev) {
|
||||||
* Returns:
|
* Returns:
|
||||||
* the number of the channel opened, negative number on error
|
* the number of the channel opened, negative number on error
|
||||||
*/
|
*/
|
||||||
short chan_open(short dev, uint8_t * path, short mode) {
|
short chan_open(short dev, const uint8_t * path, short mode) {
|
||||||
short result;
|
short result;
|
||||||
p_channel chan;
|
p_channel chan;
|
||||||
p_dev_chan cdev;
|
p_dev_chan cdev;
|
||||||
|
|
|
@ -65,12 +65,12 @@ typedef struct s_dev_chan {
|
||||||
short number; // The number of the device (assigned by registration)
|
short number; // The number of the device (assigned by registration)
|
||||||
char * name; // The name of the device
|
char * name; // The name of the device
|
||||||
FUNC_V_2_S init; // short init() -- Initialize the device
|
FUNC_V_2_S init; // short init() -- Initialize the device
|
||||||
FUNC_CBS_2_S open; // short open(t_channel * chan, uint8_t * path, short mode) -- open a channel for the device
|
FUNC_CcBS_2_S open; // short open(t_channel * chan, const uint8_t * path, short mode) -- open a channel for the device
|
||||||
FUNC_V_2_S close; // short close(t_channel * chan) -- called when a channel is closed
|
FUNC_V_2_S close; // short close(t_channel * chan) -- called when a channel is closed
|
||||||
FUNC_CBS_2_S read; // short read(t_channel *, uint8_t * buffer, short size) -- Read a a buffer from the device
|
FUNC_CBS_2_S read; // short read(t_channel *, uint8_t * buffer, short size) -- Read a a buffer from the device
|
||||||
FUNC_CBS_2_S readline; // short readline(t_channel *, uint8_t * buffer, short size) -- Read a line of text from the device
|
FUNC_CBS_2_S readline; // short readline(t_channel *, uint8_t * buffer, short size) -- Read a line of text from the device
|
||||||
FUNC_C_2_S read_b; // short read_b(t_channel *) -- read a single uint8_t from the device
|
FUNC_C_2_S read_b; // short read_b(t_channel *) -- read a single uint8_t from the device
|
||||||
FUNC_CcBS_2_S write; // short write(t_channel *, uint8_t * buffer, short size) -- Write a buffer to the device
|
FUNC_CcBS_2_S write; // short write(t_channel *, const uint8_t * buffer, short size) -- Write a buffer to the device
|
||||||
FUNC_CB_2_S write_b; // short write_b(t_channel *, const uint8_t b) -- Write a single uint8_t to the device
|
FUNC_CB_2_S write_b; // short write_b(t_channel *, const uint8_t b) -- Write a single uint8_t to the device
|
||||||
FUNC_C_2_S status; // short status(t_channel *) -- Get the status of the device
|
FUNC_C_2_S status; // short status(t_channel *) -- Get the status of the device
|
||||||
FUNC_C_2_S flush; // short flush(t_channel *) -- Ensure that any pending writes to teh device have been completed
|
FUNC_C_2_S flush; // short flush(t_channel *) -- Ensure that any pending writes to teh device have been completed
|
||||||
|
@ -140,7 +140,7 @@ extern short cdev_init(short dev);
|
||||||
* Returns:
|
* Returns:
|
||||||
* the number of the channel opened, negative number on error
|
* the number of the channel opened, negative number on error
|
||||||
*/
|
*/
|
||||||
extern short chan_open(short dev, uint8_t * path, short mode);
|
extern short chan_open(short dev, const uint8_t * path, short mode);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Close a channel
|
* Close a channel
|
||||||
|
|
|
@ -58,6 +58,7 @@ extern void ansi_el(p_channel chan, short arg_count, short args[]);
|
||||||
extern void ansi_ich(p_channel chan, short arg_count, short args[]);
|
extern void ansi_ich(p_channel chan, short arg_count, short args[]);
|
||||||
extern void ansi_dch(p_channel chan, short arg_count, short args[]);
|
extern void ansi_dch(p_channel chan, short arg_count, short args[]);
|
||||||
extern void ansi_sgr(p_channel chan, short arg_count, short args[]);
|
extern void ansi_sgr(p_channel chan, short arg_count, short args[]);
|
||||||
|
static short con_flush(p_channel chan);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Console variables and constants
|
* Console variables and constants
|
||||||
|
@ -414,7 +415,7 @@ short con_init() {
|
||||||
* Returns
|
* Returns
|
||||||
* 0 on success, negative number on failure
|
* 0 on success, negative number on failure
|
||||||
*/
|
*/
|
||||||
short con_open(p_channel chan, uint8_t * path, short mode) {
|
short con_open(p_channel chan, const uint8_t * path, short mode) {
|
||||||
int i;
|
int i;
|
||||||
p_console_data con_data;
|
p_console_data con_data;
|
||||||
|
|
||||||
|
@ -422,7 +423,7 @@ short con_open(p_channel chan, uint8_t * path, short mode) {
|
||||||
|
|
||||||
/* Initialize the console data for this channel */
|
/* Initialize the console data for this channel */
|
||||||
|
|
||||||
con_data = &(chan->data);
|
con_data = (p_console_data)&(chan->data);
|
||||||
con_data->control = CON_CTRL_ANSI;
|
con_data->control = CON_CTRL_ANSI;
|
||||||
con_data->ansi_buffer_count = 0;
|
con_data->ansi_buffer_count = 0;
|
||||||
for (i = 0; i < ANSI_BUFFER_SIZE; i++) {
|
for (i = 0; i < ANSI_BUFFER_SIZE; i++) {
|
||||||
|
@ -439,11 +440,11 @@ short con_open(p_channel chan, uint8_t * path, short mode) {
|
||||||
* Really only does something if the console is set to process ANSI escape codes
|
* Really only does something if the console is set to process ANSI escape codes
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
short con_flush(p_channel chan) {
|
static short con_flush(p_channel chan) {
|
||||||
int i;
|
int i;
|
||||||
p_console_data con_data;
|
p_console_data con_data;
|
||||||
|
|
||||||
con_data = &(chan->data);
|
con_data = (p_console_data)&(chan->data);
|
||||||
if (con_data->control & CON_CTRL_ANSI) {
|
if (con_data->control & CON_CTRL_ANSI) {
|
||||||
for (i = 0; i < con_data->ansi_buffer_count; i++) {
|
for (i = 0; i < con_data->ansi_buffer_count; i++) {
|
||||||
text_put_raw(chan->dev, con_data->ansi_buffer[i]);
|
text_put_raw(chan->dev, con_data->ansi_buffer[i]);
|
||||||
|
@ -473,7 +474,7 @@ short con_write_b(p_channel chan, uint8_t b) {
|
||||||
p_console_data con_data;
|
p_console_data con_data;
|
||||||
|
|
||||||
/* Check to see if we need to process ANSI codes */
|
/* Check to see if we need to process ANSI codes */
|
||||||
con_data = &(chan->data);
|
con_data = (p_console_data)&(chan->data);
|
||||||
if (con_data->control & CON_CTRL_ANSI) {
|
if (con_data->control & CON_CTRL_ANSI) {
|
||||||
/* ANSI codes are to be processed */
|
/* ANSI codes are to be processed */
|
||||||
ansi_process_c(chan, con_data, (char)b);
|
ansi_process_c(chan, con_data, (char)b);
|
||||||
|
@ -492,7 +493,7 @@ short con_read_b(p_channel chan) {
|
||||||
p_console_data con_data;
|
p_console_data con_data;
|
||||||
|
|
||||||
/* Check to see if we need to process ANSI codes */
|
/* Check to see if we need to process ANSI codes */
|
||||||
con_data = &(chan->data);
|
con_data = (p_console_data)&(chan->data);
|
||||||
|
|
||||||
char c;
|
char c;
|
||||||
do {
|
do {
|
||||||
|
@ -625,7 +626,7 @@ short con_has_input(p_channel chan) {
|
||||||
char c;
|
char c;
|
||||||
|
|
||||||
/* Check to see if we need to process ANSI codes */
|
/* Check to see if we need to process ANSI codes */
|
||||||
con_data = &(chan->data);
|
con_data = (p_console_data)&(chan->data);
|
||||||
|
|
||||||
if (con_data->key_buffer != 0) {
|
if (con_data->key_buffer != 0) {
|
||||||
/* If we already peeked and have a character... return true */
|
/* If we already peeked and have a character... return true */
|
||||||
|
@ -685,7 +686,7 @@ short con_ioctrl(p_channel chan, short command, uint8_t * buffer, short size) {
|
||||||
p_console_data con_data;
|
p_console_data con_data;
|
||||||
|
|
||||||
/* Check to see if we need to process ANSI codes */
|
/* Check to see if we need to process ANSI codes */
|
||||||
con_data = &(chan->data);
|
con_data = (p_console_data)&(chan->data);
|
||||||
|
|
||||||
switch (command) {
|
switch (command) {
|
||||||
case CON_IOCTRL_ANSI_ON:
|
case CON_IOCTRL_ANSI_ON:
|
||||||
|
|
|
@ -9,16 +9,16 @@
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include "log.h"
|
|
||||||
#include "syscalls.h"
|
|
||||||
#include "fsys.h"
|
|
||||||
#include "fatfs/ff.h"
|
|
||||||
#include "dev/channel.h"
|
#include "dev/channel.h"
|
||||||
#include "simpleio.h"
|
|
||||||
#include "errors.h"
|
#include "errors.h"
|
||||||
#include "elf.h"
|
#include "elf.h"
|
||||||
|
#include "fsys.h"
|
||||||
|
#include "fatfs/ff.h"
|
||||||
|
#include "log.h"
|
||||||
|
#include "syscalls.h"
|
||||||
|
#include "simpleio.h"
|
||||||
|
|
||||||
#define MAX_DRIVES 8 /* Maximum number of drives */
|
#define MAX_DRIVES 8 /* Maximum number of drives */
|
||||||
#define MAX_DIRECTORIES 8 /* Maximum number of open directories */
|
#define MAX_DIRECTORIES 8 /* Maximum number of open directories */
|
||||||
|
@ -332,7 +332,7 @@ short fsys_findnext(short dir, p_file_info file) {
|
||||||
FRESULT fres;
|
FRESULT fres;
|
||||||
|
|
||||||
if (g_dir_state[dir]) {
|
if (g_dir_state[dir]) {
|
||||||
fres = f_findnext(&g_dir_state[dir], &finfo);
|
fres = f_findnext(&g_directory[dir], &finfo);
|
||||||
if (fres != FR_OK) {
|
if (fres != FR_OK) {
|
||||||
return fatfs_to_foenix(fres);
|
return fatfs_to_foenix(fres);
|
||||||
|
|
||||||
|
@ -539,7 +539,7 @@ short fchan_read_b(t_channel * chan) {
|
||||||
|
|
||||||
file = fchan_to_file(chan);
|
file = fchan_to_file(chan);
|
||||||
if (file) {
|
if (file) {
|
||||||
result = f_read(file, buffer, 1, &total_read);
|
result = f_read(file, buffer, 1, (UINT*)&total_read);
|
||||||
if (result == FR_OK) {
|
if (result == FR_OK) {
|
||||||
return (short)(buffer[0] & 0x00ff);
|
return (short)(buffer[0] & 0x00ff);
|
||||||
} else {
|
} else {
|
||||||
|
@ -991,7 +991,7 @@ short fsys_elf_loader(short chan, long destination, long * start) {
|
||||||
elf32_program_header progHeader;
|
elf32_program_header progHeader;
|
||||||
|
|
||||||
chan_seek(chan, 0, 0);
|
chan_seek(chan, 0, 0);
|
||||||
numBytes = chan_read(chan, &header, sizeof(header));
|
numBytes = chan_read(chan, (uint8_t*)&header, sizeof(header));
|
||||||
|
|
||||||
if (header.ident.magic[0] != 0x7F ||
|
if (header.ident.magic[0] != 0x7F ||
|
||||||
header.ident.magic[1] != 'E' ||
|
header.ident.magic[1] != 'E' ||
|
||||||
|
@ -1002,7 +1002,7 @@ short fsys_elf_loader(short chan, long destination, long * start) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (header.machine != CPU_ARCH) {
|
if (header.machine != CPU_ARCH) {
|
||||||
sprintf(&log_buffer, "[!] Incompatible CPU arch: expected %s, but found %s\n", elf_cpu_desc[CPU_ARCH], elf_cpu_desc[header.machine]);
|
sprintf((char*)&log_buffer, "[!] Incompatible CPU arch: expected %s, but found %s\n", (char*)elf_cpu_desc[CPU_ARCH], (char*)elf_cpu_desc[header.machine]);
|
||||||
DEBUG(log_buffer);
|
DEBUG(log_buffer);
|
||||||
return ERR_BAD_BINARY;
|
return ERR_BAD_BINARY;
|
||||||
}
|
}
|
||||||
|
@ -1024,7 +1024,7 @@ short fsys_elf_loader(short chan, long destination, long * start) {
|
||||||
|
|
||||||
while (progIndex < header.progNum) {
|
while (progIndex < header.progNum) {
|
||||||
chan_seek(chan, progIndex * header.progSize + header.progOffset, 0);
|
chan_seek(chan, progIndex * header.progSize + header.progOffset, 0);
|
||||||
numBytes = chan_read(chan, &progHeader, sizeof(progHeader));
|
numBytes = chan_read(chan, (uint8_t*)&progHeader, sizeof(progHeader));
|
||||||
switch (progHeader.type) {
|
switch (progHeader.type) {
|
||||||
case PT_NULL:
|
case PT_NULL:
|
||||||
case PT_PHDR:
|
case PT_PHDR:
|
||||||
|
|
|
@ -542,7 +542,7 @@ short pata_ioctrl(short command, unsigned char * buffer, short size) {
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PATA_GET_DRIVE_INFO:
|
case PATA_GET_DRIVE_INFO:
|
||||||
p_info = (p_drive_info *)buffer;
|
p_info = (p_drive_info)buffer;
|
||||||
result = pata_identity(p_info);
|
result = pata_identity(p_info);
|
||||||
if (result != 0) {
|
if (result != 0) {
|
||||||
return result;
|
return result;
|
||||||
|
|
|
@ -3,12 +3,14 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include "errors.h"
|
#include "errors.h"
|
||||||
#include "log.h"
|
#include "log.h"
|
||||||
#include "types.h"
|
#include "types.h"
|
||||||
#include "ring_buffer.h"
|
#include "ring_buffer.h"
|
||||||
#include "interrupt.h"
|
#include "interrupt.h"
|
||||||
|
#include "simpleio.h"
|
||||||
#include "vicky_general.h"
|
#include "vicky_general.h"
|
||||||
#include "dev/ps2.h"
|
#include "dev/ps2.h"
|
||||||
#include "dev/rtc.h"
|
#include "dev/rtc.h"
|
||||||
|
@ -1095,14 +1097,14 @@ short kbd_layout(const char * tables) {
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Reset the translation tables to their default values */
|
/* Reset the translation tables to their default values */
|
||||||
g_kbd_control.keys_unmodified = g_us_sc_unmodified;
|
g_kbd_control.keys_unmodified = (char*)g_us_sc_unmodified;
|
||||||
g_kbd_control.keys_shift = g_us_sc_shift;
|
g_kbd_control.keys_shift = (char*)g_us_sc_shift;
|
||||||
g_kbd_control.keys_control = g_us_sc_ctrl;
|
g_kbd_control.keys_control = (char*)g_us_sc_ctrl;
|
||||||
g_kbd_control.keys_control_shift = g_us_sc_ctrl_shift;
|
g_kbd_control.keys_control_shift = (char*)g_us_sc_ctrl_shift;
|
||||||
g_kbd_control.keys_caps = g_us_sc_lock;
|
g_kbd_control.keys_caps = (char*)g_us_sc_lock;
|
||||||
g_kbd_control.keys_caps_shift = g_us_sc_lock_shift;
|
g_kbd_control.keys_caps_shift = (char*)g_us_sc_lock_shift;
|
||||||
g_kbd_control.keys_r_alt = g_us_sc_alt;
|
g_kbd_control.keys_r_alt = (char*)g_us_sc_alt;
|
||||||
g_kbd_control.keys_r_alt_shift = g_us_sc_alt_shift;
|
g_kbd_control.keys_r_alt_shift = (char*)g_us_sc_alt_shift;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
/* No: we're setting new tables */
|
/* No: we're setting new tables */
|
||||||
|
@ -1156,14 +1158,14 @@ short ps2_init() {
|
||||||
|
|
||||||
// Set the default keyboard layout to US
|
// Set the default keyboard layout to US
|
||||||
|
|
||||||
g_kbd_control.keys_unmodified = g_us_sc_unmodified;
|
g_kbd_control.keys_unmodified = (char*)g_us_sc_unmodified;
|
||||||
g_kbd_control.keys_shift = g_us_sc_shift;
|
g_kbd_control.keys_shift = (char*)g_us_sc_shift;
|
||||||
g_kbd_control.keys_control = g_us_sc_ctrl;
|
g_kbd_control.keys_control = (char*)g_us_sc_ctrl;
|
||||||
g_kbd_control.keys_control_shift = g_us_sc_ctrl_shift;
|
g_kbd_control.keys_control_shift = (char*)g_us_sc_ctrl_shift;
|
||||||
g_kbd_control.keys_caps = g_us_sc_lock;
|
g_kbd_control.keys_caps = (char*)g_us_sc_lock;
|
||||||
g_kbd_control.keys_caps_shift = g_us_sc_lock_shift;
|
g_kbd_control.keys_caps_shift = (char*)g_us_sc_lock_shift;
|
||||||
g_kbd_control.keys_r_alt = g_us_sc_alt;
|
g_kbd_control.keys_r_alt = (char*)g_us_sc_alt;
|
||||||
g_kbd_control.keys_r_alt_shift = g_us_sc_alt_shift;
|
g_kbd_control.keys_r_alt_shift = (char*)g_us_sc_alt_shift;
|
||||||
g_kbd_control.translation_table = 0;
|
g_kbd_control.translation_table = 0;
|
||||||
|
|
||||||
// Disable the PS/2 interrupts...
|
// Disable the PS/2 interrupts...
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
#include "gabe_reg.h"
|
#include "gabe_reg.h"
|
||||||
#include "rtc.h"
|
#include "rtc.h"
|
||||||
#include "rtc_reg.h"
|
#include "rtc_reg.h"
|
||||||
|
#include "simpleio.h"
|
||||||
#include "timers.h"
|
#include "timers.h"
|
||||||
|
|
||||||
static long rtc_ticks;
|
static long rtc_ticks;
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
* Startup file for the Foenix/MCP
|
* Startup file for the Foenix/MCP
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include "sys_general.h"
|
#include "sys_general.h"
|
||||||
|
@ -101,7 +102,7 @@ void load_splashscreen() {
|
||||||
long target_ticks;
|
long target_ticks;
|
||||||
int i;
|
int i;
|
||||||
unsigned char * pixels;
|
unsigned char * pixels;
|
||||||
unsigned char * vram = VRAM_Bank0;
|
volatile unsigned char * vram = VRAM_Bank0;
|
||||||
|
|
||||||
/* Turn off the screen */
|
/* Turn off the screen */
|
||||||
*MasterControlReg_A = VKY3_MCR_BLANK_EN;
|
*MasterControlReg_A = VKY3_MCR_BLANK_EN;
|
||||||
|
|
|
@ -111,7 +111,7 @@ extern int32_t syscall(int32_t function, ...);
|
||||||
* Inputs:
|
* Inputs:
|
||||||
* result = the code to return to the kernel
|
* result = the code to return to the kernel
|
||||||
*/
|
*/
|
||||||
extern void sys_exit(int result);
|
extern void sys_exit(short result);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Enable all interrupts
|
* Enable all interrupts
|
||||||
|
@ -307,7 +307,7 @@ extern short sys_chan_ioctrl(short channel, short command, uint8_t * buffer, sho
|
||||||
* Returns:
|
* Returns:
|
||||||
* the number of the channel opened, negative number on error
|
* the number of the channel opened, negative number on error
|
||||||
*/
|
*/
|
||||||
extern short sys_chan_open(short dev, uint8_t * path, short mode);
|
extern short sys_chan_open(short dev, const uint8_t * path, short mode);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Close a channel
|
* Close a channel
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
#include "interrupt.h"
|
#include "interrupt.h"
|
||||||
#include "log.h"
|
#include "log.h"
|
||||||
#include "simpleio.h"
|
#include "simpleio.h"
|
||||||
|
#include "syscalls.h"
|
||||||
#include "dev/text_screen_iii.h"
|
#include "dev/text_screen_iii.h"
|
||||||
|
|
||||||
static short log_channel = 0;
|
static short log_channel = 0;
|
||||||
|
@ -98,7 +99,7 @@ void err_print(short channel, const char * message, short err_number) {
|
||||||
/*
|
/*
|
||||||
* Display a panic screen
|
* Display a panic screen
|
||||||
*/
|
*/
|
||||||
void panic() {
|
void panic(void) {
|
||||||
char buffer[80];
|
char buffer[80];
|
||||||
short column = 18;
|
short column = 18;
|
||||||
short row = 10;
|
short row = 10;
|
||||||
|
|
|
@ -33,7 +33,7 @@ extern void err_print(short channel, const char * message, short err_number);
|
||||||
* Inputs:
|
* Inputs:
|
||||||
* vector = the number of the vector that was called
|
* vector = the number of the vector that was called
|
||||||
*/
|
*/
|
||||||
extern void panic(unsigned short exception_number);
|
extern void panic(void);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Set the maximum level of verbosity in logging.
|
* Set the maximum level of verbosity in logging.
|
||||||
|
|
|
@ -41,11 +41,11 @@ unsigned long syscall_dispatch(int32_t function, int32_t param0, int32_t param1,
|
||||||
|
|
||||||
case KFN_INT_ENABLE:
|
case KFN_INT_ENABLE:
|
||||||
int_enable((unsigned short)param0);
|
int_enable((unsigned short)param0);
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
case KFN_INT_DISABLE:
|
case KFN_INT_DISABLE:
|
||||||
int_disable((unsigned short)param0);
|
int_disable((unsigned short)param0);
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
case KFN_INT_ENABLE_ALL:
|
case KFN_INT_ENABLE_ALL:
|
||||||
return int_enable_all();
|
return int_enable_all();
|
||||||
|
@ -55,14 +55,14 @@ unsigned long syscall_dispatch(int32_t function, int32_t param0, int32_t param1,
|
||||||
|
|
||||||
case KFN_INT_CLEAR:
|
case KFN_INT_CLEAR:
|
||||||
int_clear((unsigned short)param0);
|
int_clear((unsigned short)param0);
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
case KFN_INT_PENDING:
|
case KFN_INT_PENDING:
|
||||||
return int_pending((unsigned short)param0);
|
return int_pending((unsigned short)param0);
|
||||||
|
|
||||||
case KFN_SYS_GET_INFO:
|
case KFN_SYS_GET_INFO:
|
||||||
sys_get_information((p_sys_info)param0);
|
sys_get_information((p_sys_info)param0);
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return ERR_GENERAL;
|
return ERR_GENERAL;
|
||||||
|
@ -82,10 +82,10 @@ unsigned long syscall_dispatch(int32_t function, int32_t param0, int32_t param1,
|
||||||
return chan_read_b((short)param0);
|
return chan_read_b((short)param0);
|
||||||
|
|
||||||
case KFN_CHAN_READ:
|
case KFN_CHAN_READ:
|
||||||
return chan_read((short)param0, (const uint8_t *)param1, (short)param2);
|
return chan_read((short)param0, (uint8_t *)param1, (short)param2);
|
||||||
|
|
||||||
case KFN_CHAN_READ_LINE:
|
case KFN_CHAN_READ_LINE:
|
||||||
return chan_readline((short)param0, (const uint8_t *)param1, (short)param2);
|
return chan_readline((short)param0, (uint8_t *)param1, (short)param2);
|
||||||
|
|
||||||
case KFN_CHAN_STATUS:
|
case KFN_CHAN_STATUS:
|
||||||
return chan_status((short)param0);
|
return chan_status((short)param0);
|
||||||
|
@ -100,7 +100,7 @@ unsigned long syscall_dispatch(int32_t function, int32_t param0, int32_t param1,
|
||||||
return chan_ioctrl((short)param0, (short)param1, (unsigned char *)param2, (short)param3);
|
return chan_ioctrl((short)param0, (short)param1, (unsigned char *)param2, (short)param3);
|
||||||
|
|
||||||
case KFN_CHAN_OPEN:
|
case KFN_CHAN_OPEN:
|
||||||
return chan_open((short)param0, (const char *)param1, (short)param2);
|
return chan_open((short)param0, (const uint8_t *)param1, (short)param2);
|
||||||
|
|
||||||
case KFN_CHAN_CLOSE:
|
case KFN_CHAN_CLOSE:
|
||||||
return chan_close((short)param0);
|
return chan_close((short)param0);
|
||||||
|
@ -183,7 +183,7 @@ unsigned long syscall_dispatch(int32_t function, int32_t param0, int32_t param1,
|
||||||
return fsys_setlabel((short)param0, (char *)param1);
|
return fsys_setlabel((short)param0, (char *)param1);
|
||||||
|
|
||||||
case KFN_GET_CWD:
|
case KFN_GET_CWD:
|
||||||
return fsys_get_cwd((char *)param0);
|
return fsys_get_cwd((char *)param0, (short)param1);
|
||||||
|
|
||||||
case KFN_SET_CWD:
|
case KFN_SET_CWD:
|
||||||
return fsys_set_cwd((char *)param0);
|
return fsys_set_cwd((char *)param0);
|
||||||
|
@ -201,7 +201,7 @@ unsigned long syscall_dispatch(int32_t function, int32_t param0, int32_t param1,
|
||||||
/* Process and Memory functions */
|
/* Process and Memory functions */
|
||||||
switch (function) {
|
switch (function) {
|
||||||
case KFN_RUN:
|
case KFN_RUN:
|
||||||
return proc_run((char *)param0, (int)param1, (char *)param2);
|
return proc_run((char *)param0, (int)param1, (char **)param2);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
|
|
@ -255,7 +255,7 @@ unsigned char splashscreen_lut[] = {
|
||||||
0xFD, 0xFD, 0xFD, 0x00,
|
0xFD, 0xFD, 0xFD, 0x00,
|
||||||
0xFE, 0xFE, 0xFE, 0x00,
|
0xFE, 0xFE, 0xFE, 0x00,
|
||||||
0xFF, 0xFF, 0xFF, 0x00,
|
0xFF, 0xFF, 0xFF, 0x00,
|
||||||
}
|
};
|
||||||
|
|
||||||
unsigned char splashscreen_pix[] = {
|
unsigned char splashscreen_pix[] = {
|
||||||
0xFF, 0x1F, 0xFF, 0x1F, 0xFF, 0x1F, 0xFF, 0x1F, 0xFF, 0x1F, 0xFF, 0x1F, 0xFF, 0x1F, 0xFF, 0x1F,
|
0xFF, 0x1F, 0xFF, 0x1F, 0xFF, 0x1F, 0xFF, 0x1F, 0xFF, 0x1F, 0xFF, 0x1F, 0xFF, 0x1F, 0xFF, 0x1F,
|
||||||
|
@ -824,4 +824,4 @@ unsigned char splashscreen_pix[] = {
|
||||||
0xFF, 0x1F, 0xFF, 0x1F, 0xFF, 0x1F, 0xFF, 0x1F, 0xFF, 0x1F, 0xFF, 0x1F, 0xFF, 0x1F, 0xFF, 0x1F,
|
0xFF, 0x1F, 0xFF, 0x1F, 0xFF, 0x1F, 0xFF, 0x1F, 0xFF, 0x1F, 0xFF, 0x1F, 0xFF, 0x1F, 0xFF, 0x1F,
|
||||||
0xFF, 0x1F, 0xFF, 0x1F, 0xFF, 0x1F, 0xFF, 0x1F, 0xFF, 0x1F, 0xFF, 0x1F, 0xFF, 0x1F, 0xFF, 0x1F,
|
0xFF, 0x1F, 0xFF, 0x1F, 0xFF, 0x1F, 0xFF, 0x1F, 0xFF, 0x1F, 0xFF, 0x1F, 0xFF, 0x1F, 0xFF, 0x1F,
|
||||||
0x69, 0x1F, 0x00, 0x00
|
0x69, 0x1F, 0x00, 0x00
|
||||||
}
|
};
|
|
@ -2,9 +2,11 @@
|
||||||
* A simple collection of I/O functions the kernel will need often
|
* A simple collection of I/O functions the kernel will need often
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <ctype.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include "syscalls.h"
|
#include "syscalls.h"
|
||||||
#include "simpleio.h"
|
#include "simpleio.h"
|
||||||
|
#include "dev/text_screen_iii.h"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Print a character to a channel
|
* Print a character to a channel
|
||||||
|
@ -94,7 +96,7 @@ void print_hex_16(short channel, unsigned short x) {
|
||||||
* channel = the number of the channel
|
* channel = the number of the channel
|
||||||
* n = the number to print
|
* n = the number to print
|
||||||
*/
|
*/
|
||||||
void print_hex_32(short channel, long n) {
|
void print_hex_32(short channel, unsigned long n) {
|
||||||
char number[9];
|
char number[9];
|
||||||
short digit;
|
short digit;
|
||||||
short i;
|
short i;
|
||||||
|
|
|
@ -30,7 +30,7 @@ extern void print_c(short channel, char c);
|
||||||
* channel = the number of the channel
|
* channel = the number of the channel
|
||||||
* n = the number to print
|
* n = the number to print
|
||||||
*/
|
*/
|
||||||
extern void print_hex_8(short channel, short n);
|
extern void print_hex_8(short channel, unsigned short n);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Print an 16-bit number as hex to a channel
|
* Print an 16-bit number as hex to a channel
|
||||||
|
@ -39,7 +39,7 @@ extern void print_hex_8(short channel, short n);
|
||||||
* channel = the number of the channel
|
* channel = the number of the channel
|
||||||
* n = the number to print
|
* n = the number to print
|
||||||
*/
|
*/
|
||||||
extern void print_hex_16(short channel, short n);
|
extern void print_hex_16(short channel, unsigned short n);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Print an 32-bit number as hex to a channel
|
* Print an 32-bit number as hex to a channel
|
||||||
|
@ -48,7 +48,7 @@ extern void print_hex_16(short channel, short n);
|
||||||
* channel = the number of the channel
|
* channel = the number of the channel
|
||||||
* n = the number to print
|
* n = the number to print
|
||||||
*/
|
*/
|
||||||
extern void print_hex_32(short channel, long n);
|
extern void print_hex_32(short channel, unsigned long n);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Convert a BCD byte to an integer
|
* Convert a BCD byte to an integer
|
||||||
|
|
|
@ -247,7 +247,7 @@ short sys_chan_ioctrl(short channel, short command, uint8_t * buffer, short size
|
||||||
* Returns:
|
* Returns:
|
||||||
* the number of the channel opened, negative number on error
|
* the number of the channel opened, negative number on error
|
||||||
*/
|
*/
|
||||||
short sys_chan_open(short dev, uint8_t * path, short mode) {
|
short sys_chan_open(short dev, const uint8_t * path, short mode) {
|
||||||
return syscall(KFN_CHAN_OPEN, path, mode);
|
return syscall(KFN_CHAN_OPEN, path, mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -272,7 +272,7 @@ short sys_chan_close(short chan) {
|
||||||
* screen = the screen number 0 for channel A, 1 for channel B
|
* screen = the screen number 0 for channel A, 1 for channel B
|
||||||
*/
|
*/
|
||||||
void sys_text_setsizes(short chan) {
|
void sys_text_setsizes(short chan) {
|
||||||
return syscall(KFN_TEXT_SETSIZES, chan);
|
syscall(KFN_TEXT_SETSIZES, chan);
|
||||||
}
|
}
|
||||||
|
|
||||||
/***
|
/***
|
||||||
|
@ -467,7 +467,7 @@ short sys_fsys_findnext(short dir, p_file_info file) {
|
||||||
* path = path to the drive
|
* path = path to the drive
|
||||||
* label = buffer that will hold the label... should be at least 35 bytes
|
* label = buffer that will hold the label... should be at least 35 bytes
|
||||||
*/
|
*/
|
||||||
short sys_fsys_get_label(char * path, char * label) {
|
short sys_fsys_get_label(const char * path, char * label) {
|
||||||
return (short)syscall(KFN_GET_LABEL, path, label);
|
return (short)syscall(KFN_GET_LABEL, path, label);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -600,7 +600,7 @@ short sys_fsys_register_loader(const char * extension, p_file_loader loader) {
|
||||||
* Returns:
|
* Returns:
|
||||||
* the number of jiffies since the last reset
|
* the number of jiffies since the last reset
|
||||||
*/
|
*/
|
||||||
extern long sys_time_jiffies() {
|
long sys_time_jiffies() {
|
||||||
return syscall(KFN_TIME_JIFFIES);
|
return syscall(KFN_TIME_JIFFIES);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue