summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mdk-stage1/tools.c14
-rw-r--r--mdk-stage1/tools.h1
2 files changed, 14 insertions, 1 deletions
diff --git a/mdk-stage1/tools.c b/mdk-stage1/tools.c
index 7724c6e72..e3a0fa479 100644
--- a/mdk-stage1/tools.c
+++ b/mdk-stage1/tools.c
@@ -42,7 +42,8 @@
#include "automatic.h"
#include "tools.h"
-
+#include "probing.h"
+#include "modules.h"
static struct param_elem params[50];
static int param_number = 0;
@@ -476,6 +477,17 @@ int kernel_version(void)
return charstar_to_int(val.release + 2);
}
+char * floppy_device(void)
+{
+ char ** names, ** models;
+ my_insmod("sd_mod", ANY_DRIVER_TYPE, NULL, 0);
+ get_medias(FLOPPY, &names, &models, BUS_ANY);
+ if (names && *names)
+ return asprintf_("/dev/%s", *names);
+ else
+ return "/dev/fd0";
+}
+
char * asprintf_(const char *msg, ...)
{
int n;
diff --git a/mdk-stage1/tools.h b/mdk-stage1/tools.h
index be3883eb5..3b95a2f26 100644
--- a/mdk-stage1/tools.h
+++ b/mdk-stage1/tools.h
@@ -43,6 +43,7 @@ char ** grab_env(void);
char ** list_directory(char * direct);
int string_array_length(char ** a);
int kernel_version(void);
+char * floppy_device(void);
char * asprintf_(const char *msg, ...);
int scall_(int retval, char * msg, char * file, int line);
#define scall(retval, msg) scall_(retval, msg, __FILE__, __LINE__)