Changeset View
Changeset View
Standalone View
Standalone View
stand/forth/support.4th
Show First 20 Lines • Show All 1,051 Lines • ▼ Show 20 Lines | : rewrite_nextboot_file ( -- ) | ||||
get_nextboot_conf_file | get_nextboot_conf_file | ||||
O_WRONLY fopen fd ! | O_WRONLY fopen fd ! | ||||
fd @ -1 = if EOPEN throw then | fd @ -1 = if EOPEN throw then | ||||
fd @ s' nextboot_enable="NO" ' fwrite ( fd buf len -- nwritten ) drop | fd @ s' nextboot_enable="NO" ' fwrite ( fd buf len -- nwritten ) drop | ||||
fd @ fclose | fd @ fclose | ||||
; | ; | ||||
: include_nextboot_file ( -- ) | : include_nextboot_file ( -- ) | ||||
s" nextboot_enable" getenv dup -1 <> if | |||||
2dup s' "YES"' compare >r | |||||
2dup s' "yes"' compare >r | |||||
2dup s" YES" compare >r | |||||
2dup s" yes" compare r> r> r> and and and 0= to nextboot? | |||||
else | |||||
drop | |||||
get_nextboot_conf_file | get_nextboot_conf_file | ||||
['] peek_file catch if 2drop then | ['] peek_file catch if 2drop then | ||||
then | |||||
nextboot? if | nextboot? if | ||||
get_nextboot_conf_file | get_nextboot_conf_file | ||||
current_file_name_ref strref | current_file_name_ref strref | ||||
['] load_conf catch | ['] load_conf catch | ||||
process_conf_errors | process_conf_errors | ||||
['] rewrite_nextboot_file catch if 2drop then | ['] rewrite_nextboot_file catch if 2drop then | ||||
then | then | ||||
s' "NO"' s" nextboot_enable" setenv | |||||
; | ; | ||||
\ Module loading functions | \ Module loading functions | ||||
: load_parameters { addr -- addr addrN lenN ... addr1 len1 N } | : load_parameters { addr -- addr addrN lenN ... addr1 len1 N } | ||||
addr | addr | ||||
addr module.args strget | addr module.args strget | ||||
addr module.loadname .len @ if | addr module.loadname .len @ if | ||||
▲ Show 20 Lines • Show All 532 Lines • Show Last 20 Lines |