📄 loader.c
字号:
/* * Copyright (c) 2000 Blue Mug, Inc. All Rights Reserved. */#include <target/buffer.h>#include <target/crc.h>#include <target/io.h>#include <cs89712/ioregs.h>#include "eth.h"#include "flash.h"#include "frob.h"#include "linux.h"#include "memmap.h"/* timeout for auto-boot, in seconds */#define BOOT_TIMEOUT 5static const command_t *commands[] = { &help_command, &boot_command, &download_command, &flash_erase_command, ðer_mac_command, &frob_command, &jump_command, &linux_command, &medium_command, &memmap_command, &flash_program_command, &unzip_command, &upload_command, &version_command, 0};ABBR(boot_command, 'b')ABBR(help_command, '?')ABBR(frob_command, 'f')ABBR(version_command, 'V')static const abbrev_t *abbrevs[] = { &boot_command_abbrev, &help_command_abbrev, &frob_command_abbrev, &version_command_abbrev, 0};static inline void maybe_start_linux(void){#if defined STANDALONE /* always go to the command loop */#else /* boot linux unless a key is pressed before the timeout elapses */ hprintf("Press a key within %d seconds for console.\n", BOOT_TIMEOUT); IO_RTCMR = IO_RTCDR + BOOT_TIMEOUT; while (IO_SYSFLG1 & URXFE1) { if (IO_RTCMR <= IO_RTCDR) { /* start linux */ } }#endif}int main(void){ command_list_t command_list = { commands, abbrevs, "hermit", 0 }; maybe_start_linux(); /* startup stuff: activate LED and print version string */ (*version_command.func)(0, 0); init_crc32(); IO_LEDFLSH = 0x7c; /* LED continuous on */ do_command_loop(&command_list); for (;;);}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -