Merge remote-tracking branch 'original/main'

This commit is contained in:
Vincent Barrilliot 2021-12-08 11:45:35 +00:00
commit ec4eafff31
11 changed files with 7190 additions and 6376 deletions

4
.gitignore vendored
View file

@ -69,3 +69,7 @@ src/foenixmcp_ram.bin
src/foenixmcp_flash.bin
src/bin/archive/foenixmcp_u_flash_20211111_03.bin
src/bin/archive/foenixmcp_u_flash_20211112_06.bin
src/bin/archive/foenixmcp_u_ram_20211206_02.bin
src/bin/archive/foenixmcp_u_ram_20211206_01.bin
src/bin/archive/foenixmcp_u_flash_20211206_02.bin
src/bin/archive/foenixmcp_u_flash_20211206_01.bin

View file

@ -17,14 +17,11 @@ export CPU=32
# MODEL_FOENIX_A2560U 9
# MODEL_FOENIX_A2560K 13
export MODEL=9
export VER_MAJOR = 0
export VER_MINOR = 1
export VER_BUILD = 11
export AS = vasmm68k_mot
export ASFLAGS = -quiet -Fvobj -nowarn=62
export CC = vc
export DEFINES = -DCPU=$(CPU) -DMODEL=$(MODEL) -DVER_MAJOR=$(VER_MAJOR) -DVER_MINOR=$(VER_MINOR) -DVER_BUILD=$(VER_BUILD) # -DKBD_POLLED
export DEFINES = -DCPU=$(CPU) -DMODEL=$(MODEL) # -DKBD_POLLED
ifeq ($(OS),Windows_NT)
export CFLAGS = +$(VBCC)/config/m68k-foenix -I. -I$(CURDIR)/include -I$(CURDIR)

View file

@ -7,9 +7,9 @@
/*
* A function pointer for command implementations:
* int cmd_foo(short screen, char * parameters) { ... }
* short cmd_foo(short screen, char * parameters) { ... }
*/
typedef int (*cli_cmd_handler)(short screen, int argc, char * argv[]);
typedef short (*cli_cmd_handler)(short screen, int argc, char * argv[]);
/**
* About the CLI...

View file

@ -324,7 +324,7 @@ short cmd_test_print(short screen, int argc, char * argv[]) {
return 0;
}
static t_cli_test_feature cli_test_features[] = {
const t_cli_test_feature cli_test_features[] = {
{"BITMAP", "BITMAP: test the bitmap screen", cli_test_bitmap},
{"CREATE", "CREATE <path>: test creating a file", cli_test_create},
{"IDE", "IDE: test reading the MBR of the IDE drive", cli_test_ide},
@ -339,17 +339,22 @@ static t_cli_test_feature cli_test_features[] = {
{"PSG", "PSG: test the PSG sound chip", psg_test},
{"PRINT", "PRINT: sent text to the printer", cmd_test_print},
{"UART", "UART: test the serial port", cli_test_uart},
{0, 0}
{"END", "END", 0}
};
void test_help(short screen) {
p_cli_test_feature f;
int i;
int count;
print(screen, "USAGE: TEST <feature>\nFeatures supported...\n");
for (f = cli_test_features; f->name != 0; f++) {
print(screen, f->help);
print(screen, "\n");
count = sizeof(cli_test_features) / sizeof(t_cli_test_feature);
for (i = 0; i < count - 1; i++) {
if (cli_test_features[i].help != 0) {
print(screen, cli_test_features[i].help);
print(screen, "\n");
}
}
}

View file

@ -53,6 +53,7 @@ unsigned char g_fil_state[MAX_FILES]; /* Whether or not a file descriptor
FIL g_file[MAX_FILES]; /* The file descriptors */
t_dev_chan g_file_dev; /* The descriptor to use for the file channels */
t_loader_record g_file_loader[MAX_LOADERS]; /* Array of file types the loader will understand */
char g_current_directory[MAX_PATH_LEN]; /* Our current working directory */
/**
* Convert a FATFS FRESULT code to the Foenix kernel's internal error codes
@ -434,8 +435,11 @@ short fsys_rename(const char * old_path, const char * new_path) {
short fsys_set_cwd(const char * path) {
FRESULT result;
/* Send the path to FatFS */
result = f_chdir(path);
if (result == FR_OK) {
/* Set our copy of the current directory */
f_getcwd(g_current_directory, MAX_PATH_LEN);
return 0;
} else {
log_num(LOG_ERROR, "fsys_set_cwd error: ", result);
@ -454,15 +458,8 @@ short fsys_set_cwd(const char * path) {
* 0 on success, negative number on failure.
*/
short fsys_get_cwd(char * path, short size) {
FRESULT result;
result = f_getcwd(path, size);
if (result == FR_OK) {
return 0;
} else {
log_num(LOG_ERROR, "fsys_get_cwd error: ", result);
return fatfs_to_foenix(result);
}
strncpy(path, g_current_directory, size);
return 0;
}
short fchan_init() {
@ -1298,6 +1295,11 @@ short fsys_register_loader(const char * extension, p_file_loader loader) {
short fsys_init() {
int i, j;
/* Set the default working directory.
* TODO: set this based on the boot drive.
*/
strcpy(g_current_directory, "/sd");
/* Mark all directories as available */
for (i = 0; i < MAX_DIRECTORIES; i++) {
g_dir_state[i] = 0;

Binary file not shown.

View file

@ -122,13 +122,20 @@ PENDING_GRP2 = $00B00104
coldboot: lea ___STACK,sp
bsr _int_disable_all
lea ___BSSSTART,a0
; Clear BSS segment
lea ___BSSSTART,a0
move.l #___BSSSIZE,d0
beq callmain
beq.s callmain
; clrloop: clr.l (a0)+
; subq.l #4,d0
; bne clrloop
move.l #0,d1
clrloop: ; We don't use clr.l because it's a read-modify-write operation
; that is not yet supported by the FPGA's bus logic for now.
; So we use a move instead.
; clr.l (a0)+
move.l d1,(a0)+
subq.l #4,d0
bne.s clrloop
; Set TRAP #15 vector handler
lea h_trap_15,a0 ; Address of the handler

13472
src/mapfile

File diff suppressed because it is too large Load diff

16
src/newbuild.py Normal file
View file

@ -0,0 +1,16 @@
import re
# Update version.h with a new build number
with open("version.h") as ver:
lines = ver.readlines();
with open("version.h", "w") as ver:
for line in lines:
match = re.match("\#define\s*VER_BUILD\s*(\d+)", line)
if match:
build = int(match.group(1)) + 1
ver.write('#define VER_BUILD {}\n'.format(build))
else:
ver.write(line)

View file

@ -5,6 +5,7 @@
#ifndef __SYS_GENERAL_H
#define __SYS_GENERAL_H
#include "version.h"
#include "types.h"
/* IDs for the various Foenix machines supported */

12
src/version.h Normal file
View file

@ -0,0 +1,12 @@
/*
* Version numbers for the kernel
*/
#ifndef __VERSION_H
#define __VERSION_H
#define VER_MAJOR 0
#define VER_MINOR 1
#define VER_BUILD 1
#endif