summaryrefslogtreecommitdiffstats
path: root/mdk-stage1/init.c
diff options
context:
space:
mode:
Diffstat (limited to 'mdk-stage1/init.c')
-rw-r--r--mdk-stage1/init.c48
1 files changed, 36 insertions, 12 deletions
diff --git a/mdk-stage1/init.c b/mdk-stage1/init.c
index 502bb3b21..edcce8508 100644
--- a/mdk-stage1/init.c
+++ b/mdk-stage1/init.c
@@ -19,19 +19,14 @@
*
*/
-#include "minilibc.h"
-#include "config-stage1.h"
-
-#define KICK_FLOPPY 1
-#define KICK_BOOTP 2
+#ifndef INIT_HEADERS
+#include "init-libc-headers.h"
+#else
+#include INIT_HEADERS
+#endif
-#define MS_REMOUNT 32
+#include "config-stage1.h"
-#define ENV_PATH 0
-#define ENV_LD_LIBRARY_PATH 1
-#define ENV_HOME 2
-#define ENV_TERM 3
-#define ENV_DEBUG 4
char * env[] = {
"PATH=/usr/bin:/bin:/sbin:/usr/sbin:/mnt/sbin:/mnt/usr/sbin:/mnt/bin:/mnt/usr/bin",
@@ -73,6 +68,33 @@ void print_warning(char *msg)
printf("W: %s\n", msg);
}
+void print_int(int fd, int i)
+{
+ char buf[10];
+ char * chptr = buf + 9;
+ int j = 0;
+
+ if (i < 0)
+ {
+ write(1, "-", 1);
+ i = -1 * i;
+ }
+
+ while (i)
+ {
+ *chptr-- = '0' + (i % 10);
+ j++;
+ i = i / 10;
+ }
+
+ write(fd, chptr + 1, j);
+}
+
+void print_str(int fd, char * string)
+{
+ write(fd, string, strlen(string));
+}
+
/* fork to:
* (1) watch /proc/kmsg and copy the stuff to /dev/tty4
@@ -203,6 +225,8 @@ void doklog()
}
+#define LOOP_CLR_FD 0x4C01
+
void del_loop(char *device)
{
int fd;
@@ -426,7 +450,7 @@ int main(int argc, char **argv)
if (!abnormal_termination) {
printf("rebooting system\n");
sleep(2);
- reboot(0xfee1dead, 672274793, 0x1234567);
+ reboot(LINUX_REBOOT_CMD_RESTART);
} else {
printf("you may safely reboot your system\n");
while (1);