#include #include #include #define STARTUP_FILE_PATH "sys/startup.rc" void main() { struct file *f = open_file(STARTUP_FILE_PATH); if (!f) { tell_user_sz("Could not open " STARTUP_FILE_PATH ".\n"); return; } tell_user_sz("[init] Reading from " STARTUP_FILE_PATH ".\n"); char cmdbuf[128]; while (read_line_from_file(f, cmdbuf, 127)) { tell_user_sz("[init] Starting "); tell_user_sz(cmdbuf); tell_user_sz(": "); if (run_command(cmdbuf)) { tell_user_sz("Succeded.\n"); yield_task(); } else tell_user_sz("Failed.\n"); } close_file(f); tell_user_sz("[init] Done starting programs.\n"); }