📄 loader.c
字号:
/* * Copyright (c) 2000 Blue Mug, Inc. All Rights Reserved. */#include <target/buffer.h>#include <target/crc.h>#include <target/io.h>#include <ep7211/ioregs.h>#include "eth.h"#include "flash.h"#include "frob.h"#include "keyboard.h"#include "life.h"#include "linux.h"#include "memmap.h"#define DLBUFSIZE (8*1024)unsigned char dlbuf [DLBUFSIZE];word_t dlbufsize = DLBUFSIZE;/* timeout for auto-boot, in seconds */#define BOOT_TIMEOUT 5static const command_t *commands[] = { &help_command, &download_command, &flash_erase_command, ðer_mac_command, &frob_command,#ifdef HAVE_LIFE &game_of_life_command,#endif &jump_command, &linux_command, &medium_command, &memmap_command, &flash_program_command, &unzip_command, &upload_command, &version_command, 0};ABBR(help_command, '?')ABBR(frob_command, 'f')ABBR(version_command, 'V')static const abbrev_t *abbrevs[] = { &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 */#elif defined HAVE_KEYBOARD if (!is_any_key_pressed()) start_linux();#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_SYSFLG2 & URXFE2) { 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 + -