Compare commits

..

No commits in common. "d6297305cf11ccd5be10bb687febc91565391940" and "ac8b2429877331b7f679e107c43e50be3bcd828f" have entirely different histories.

3 changed files with 6 additions and 21 deletions

5
.gitignore vendored
View file

@ -53,11 +53,6 @@ dkms.conf
.vscode/settings.json
/misc/F256xE_Kernal_Code
# lsp / clangd
/.cache/
/.clangd
/compile_commands.json
obj/
/foenixmgr.ini
/*.s37

View file

@ -168,7 +168,6 @@ bool is_bootable(enum boot_src_e device, boot_record_p * boot_record) {
switch(device) {
case BOOT_SRC_RAM:
DEBUG("Scanning boot source BOOT_SRC_RAM");
top_ram = (uint32_t)mem_get_ramtop();
for (uint32_t address = 0; address < top_ram; address += boot_record_alignment) {
record = (boot_record_p)address;
@ -181,7 +180,6 @@ bool is_bootable(enum boot_src_e device, boot_record_p * boot_record) {
break;
case BOOT_SRC_ROM:
DEBUG("Scanning boot source BOOT_SRC_ROM");
record = (boot_record_p)boot_rom_location;
if (is_valid_boot_record(record)) {
*boot_record = record;
@ -190,7 +188,6 @@ bool is_bootable(enum boot_src_e device, boot_record_p * boot_record) {
break;
case BOOT_SRC_CARTRIDGE:
DEBUG("Scanning boot source BOOT_SRC_CARTRIDGE");
record = (boot_record_p)boot_cart_location;
if (is_valid_boot_record(record)) {
*boot_record = record;
@ -199,21 +196,18 @@ bool is_bootable(enum boot_src_e device, boot_record_p * boot_record) {
break;
case BOOT_SRC_SD0:
DEBUG("Scanning boot source BOOT_SRC_SD0");
if ((fsys_stat("/sd0/fnxboot.pgx", &file_info) >= 0) || (fsys_stat("/sd0/fnxboot.pgz", &file_info) >= 0)) {
return true;
}
break;
case BOOT_SRC_SD1:
DEBUG("Scanning boot source BOOT_SRC_SD1");
if ((fsys_stat("/sd1/fnxboot.pgx", &file_info) >= 0) || (fsys_stat("/sd1/fnxboot.pgz", &file_info) >= 0)) {
return true;
}
break;
default:
DEBUG1("Unknown boot source type to scan %d, skipping", device);
break;
}
@ -441,8 +435,6 @@ static short sc_to_function(unsigned short scancode) {
*
*/
void boot_screen() {
INFO("Starting boot screen");
enum boot_src_e boot_source = BOOT_SRC_NONE;
boot_record_p boot_record[MAX_BOOT_SRC];
short boot_position = 0;
@ -528,7 +520,6 @@ void boot_screen() {
bootable[position] = false;
boot_icon(position, boot_chain[position]);
if (is_bootable(boot_chain[position], &boot_record[position])) {
DEBUG1("Determined that boot source %d is bootable", position);
boot_icon_highlight(position);
bootable[position] = true;
bootable_count++;
@ -559,7 +550,6 @@ void boot_screen() {
}
}
}
DEBUG("Finished scanning boot sources");
// List out all the selectable boot sources
if (bootable_count > 1) {
@ -573,9 +563,7 @@ void boot_screen() {
}
}
sprintf(message, "\nPress \e[93mSPACE\e[37m to boot from default source.\n");
chan_write(0, (uint8_t *)message, strlen(message));
sprintf(message, "Press \e[93m<=\e[37m to rescan for boot sources.\n");
sprintf(message, "\nPress \e[93mSPACE\e[37m to boot from default source.\nPress \e[93m<=\e[37m to rescan for boot sources.\n");
chan_write(0, (uint8_t *)message, strlen(message));
// Let the user select a boot source
@ -591,13 +579,11 @@ void boot_screen() {
short selected = sc_to_function(scancode);
if (selected == 0x20) {
INFO("Booting from default ...");
printf("Booting from default ...\n");
// SPACE was pressed... just boot the default
boot_from(boot_source, boot_record[0]);
} else if (selected > 0) {
INFO1("Booting from device %d", selected);
printf("Booting from %d ...\n", selected);
if (bootable[selected - 1]) {
boot_position = selected - 1;

View file

@ -15,7 +15,11 @@
* @return the smallest short c such that c >= a / b
*/
short ceil_div_short(short a, short b) {
return (a + (b - 1)) / b;
if (a % b) {
return (a / b) + 1;
} else {
return a / b;
}
}
/**