aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--com32/elflink/ldlinux/Makefile2
-rw-r--r--com32/elflink/ldlinux/cli.c5
-rw-r--r--com32/elflink/ldlinux/colors.c1
-rw-r--r--com32/elflink/ldlinux/config.h4
-rw-r--r--com32/elflink/ldlinux/getadv.c2
-rw-r--r--com32/elflink/ldlinux/ldlinux.c4
-rw-r--r--com32/elflink/ldlinux/readconfig.c22
-rw-r--r--com32/elflink/modules/background.c3
-rw-r--r--com32/elflink/modules/hello.c3
-rw-r--r--com32/elflink/modules/menu.c1
-rw-r--r--com32/elflink/modules/menu.h3
-rw-r--r--com32/elflink/modules/mytest.c1
-rw-r--r--com32/elflink/modules/passwd.c1
-rw-r--r--com32/elflink/modules/printmsg.c1
-rw-r--r--core/elflink/core-elf.h4
-rw-r--r--core/elflink/execute.c2
-rw-r--r--core/elflink/kernel.c4
17 files changed, 30 insertions, 33 deletions
diff --git a/com32/elflink/ldlinux/Makefile b/com32/elflink/ldlinux/Makefile
index 339e13ee..f9606934 100644
--- a/com32/elflink/ldlinux/Makefile
+++ b/com32/elflink/ldlinux/Makefile
@@ -13,7 +13,7 @@
topdir = ../../..
include ../modules/MCONFIG
-CFLAGS += -I../modules -I$(topdir)/core/elflink
+CFLAGS += -I../modules -I$(topdir)/core/elflink -I$(topdir)/core/include
all: ldlinux.c32
diff --git a/com32/elflink/ldlinux/cli.c b/com32/elflink/ldlinux/cli.c
index defc6d0f..172a9f68 100644
--- a/com32/elflink/ldlinux/cli.c
+++ b/com32/elflink/ldlinux/cli.c
@@ -454,7 +454,7 @@ void process_command(const char *cmd, bool history)
// dprintf("raw cmd = %s", cmd);
strcpy(temp_cmd, cmd);
- module_name = strtok(cmd, COMMAND_DELIM);
+ module_name = strtok((char *)cmd, COMMAND_DELIM);
len_mn = strlen(module_name);
if (!strcmp(module_name + len_mn - 4, ".c32")) {
@@ -473,7 +473,7 @@ void process_command(const char *cmd, bool history)
} while (argc < MAX_COMMAND_ARGS);
argv[argc] = NULL;
module_load_dependencies(module_name, MODULES_DEP);
- spawn_load(module_name, argv);
+ spawn_load(module_name, (const char **)argv);
} else if (!strcmp(module_name + len_mn - 2, ".0")) {
execute(cmd, KT_PXE);
} else if (!strcmp(module_name + len_mn - 3, ".bs")) {
@@ -494,7 +494,6 @@ void process_command(const char *cmd, bool history)
else
execute(temp_cmd, KT_KERNEL);
-cleanup:
free(argv);
free(temp_cmd);
}
diff --git a/com32/elflink/ldlinux/colors.c b/com32/elflink/ldlinux/colors.c
index 68732bdb..c1ef3904 100644
--- a/com32/elflink/ldlinux/colors.c
+++ b/com32/elflink/ldlinux/colors.c
@@ -14,6 +14,7 @@
#include <string.h>
#include <stdio.h>
#include <colortbl.h>
+#include <core-elf.h>
#include "menu.h"
/*
diff --git a/com32/elflink/ldlinux/config.h b/com32/elflink/ldlinux/config.h
index 77652663..37c57da1 100644
--- a/com32/elflink/ldlinux/config.h
+++ b/com32/elflink/ldlinux/config.h
@@ -33,7 +33,7 @@ extern short vkernel; //have we seen any "label" statements?
extern short displaycon; //conio.inc
extern short nohalt; //idle.inc
-extern char *default_cmd; //"default" command line
-extern char *onerror; //"onerror" command line
+extern const char *default_cmd; //"default" command line
+extern const char *onerror; //"onerror" command line
#endif /* __CONFIG_H__ */
diff --git a/com32/elflink/ldlinux/getadv.c b/com32/elflink/ldlinux/getadv.c
index 456084b0..5578313e 100644
--- a/com32/elflink/ldlinux/getadv.c
+++ b/com32/elflink/ldlinux/getadv.c
@@ -39,7 +39,7 @@
const void *syslinux_getadv(int tag, size_t * size)
{
const uint8_t *p;
- size_t left, len;
+ size_t left;
p = syslinux_adv_ptr();
left = syslinux_adv_size();
diff --git a/com32/elflink/ldlinux/ldlinux.c b/com32/elflink/ldlinux/ldlinux.c
index 5ebbd7fc..85066b19 100644
--- a/com32/elflink/ldlinux/ldlinux.c
+++ b/com32/elflink/ldlinux/ldlinux.c
@@ -1,6 +1,7 @@
#include <linux/list.h>
#include <sys/times.h>
#include <stdbool.h>
+#include <core.h>
#include <core-elf.h>
#include "cli.h"
#include "console.h"
@@ -12,8 +13,7 @@
static void enter_cmdline(void)
{
- struct cli_command *aux;
- char *cmdline;
+ const char *cmdline;
/* Enter endless command line prompt, should support "exit" */
while (1) {
diff --git a/com32/elflink/ldlinux/readconfig.c b/com32/elflink/ldlinux/readconfig.c
index 898ee19a..e13d6d47 100644
--- a/com32/elflink/ldlinux/readconfig.c
+++ b/com32/elflink/ldlinux/readconfig.c
@@ -59,8 +59,8 @@ short vkernel = 0; //have we seen any "label" statements?
short displaycon = 1; //conio.inc
short nohalt = 1; //idle.inc
-char *default_cmd = NULL; //"default" command line
-char *onerror = NULL; //"onerror" command line
+const char *default_cmd = NULL; //"default" command line
+const char *onerror = NULL; //"onerror" command line
/* Empty refstring */
const char *empty_string;
@@ -75,7 +75,7 @@ long long totaltimeout = 0;
/* Keep track of global default */
static int has_ui = 0; /* DEFAULT only counts if UI is found */
-extern char *globaldefault;
+extern const char *globaldefault;
static bool menusave = false; /* True if there is any "menu save" */
/* Linked list of all entires, hidden or not; used by unlabel() */
@@ -568,7 +568,7 @@ uint32_t parse_argb(char **p)
* same way as if the files had been concatenated together.
*/
//static const char *append = NULL;
-extern char *append;
+extern const char *append;
//static unsigned int ipappend = 0;
unsigned int ipappend = 0;
static struct labeldata ld;
@@ -1056,7 +1056,6 @@ do_include:
static int parse_one_config(const char *filename)
{
FILE *f;
- int i;
/*
if (!strcmp(filename, "~"))
@@ -1107,24 +1106,11 @@ static void resolve_gotos(void)
}
}
-static void dump_menu(struct menu *menu)
-{
- dprintf("will dump menu for %s:", menu->label);
- printf("entries num: %d\n", menu->nentries);
- printf("defentry: %d, nam = %s\n",
- menu->defentry, menu->menu_entries[menu->defentry]->label);
- printf("save: %d\n", menu->save);
- //printf("", menu->);
- //printf("", menu->);
- //printf("", menu->);
-}
-
void parse_configs(char **argv)
{
const char *filename;
struct menu *m;
struct menu_entry *me;
- char *cmdline;
dprintf("enter");
empty_string = refstrdup("");
diff --git a/com32/elflink/modules/background.c b/com32/elflink/modules/background.c
index 61d8c609..467f6fd9 100644
--- a/com32/elflink/modules/background.c
+++ b/com32/elflink/modules/background.c
@@ -12,6 +12,7 @@
#include <consoles.h>
#include <string.h>
+#include <core-elf.h>
#include <syslinux/vesacon.h>
#include <sys/module.h>
#include "menu.h"
@@ -33,6 +34,8 @@ int draw_background(const char *what)
else
return vesacon_load_background(what);
#endif
+
+ return 0;
}
void set_background(const char *new_background)
diff --git a/com32/elflink/modules/hello.c b/com32/elflink/modules/hello.c
index cba63e2e..b38f05c4 100644
--- a/com32/elflink/modules/hello.c
+++ b/com32/elflink/modules/hello.c
@@ -17,10 +17,9 @@
static int hello_main(int argc, char **argv)
{
int *nums = NULL;
- int i;
nums = malloc(NUM_COUNT * sizeof(int));
- printf("Hello, world, from 0x%08X! malloc return %p\n", (unsigned int)&hello_main), nums;
+ printf("Hello, world, from 0x%08X! malloc return %p\n", (unsigned int)&hello_main, nums);
free(nums);
diff --git a/com32/elflink/modules/menu.c b/com32/elflink/modules/menu.c
index a4faf898..c0813a8e 100644
--- a/com32/elflink/modules/menu.c
+++ b/com32/elflink/modules/menu.c
@@ -4,6 +4,7 @@
#include <stdio.h>
#include <stdlib.h>
+#include <core-elf.h>
#include <sys/module.h>
#include "menu.h"
diff --git a/com32/elflink/modules/menu.h b/com32/elflink/modules/menu.h
index c7d70792..90b54a54 100644
--- a/com32/elflink/modules/menu.h
+++ b/com32/elflink/modules/menu.h
@@ -208,4 +208,7 @@ void execute(const char *cmdline, enum kernel_type type);
/* drain.c */
void drain_keyboard(void);
+/* printmsg.c */
+int draw_message_file(const char *filename);
+
#endif /* MENU_H */
diff --git a/com32/elflink/modules/mytest.c b/com32/elflink/modules/mytest.c
index ddc8a0ef..04c59ac8 100644
--- a/com32/elflink/modules/mytest.c
+++ b/com32/elflink/modules/mytest.c
@@ -12,6 +12,7 @@
#include <setjmp.h>
#include <limits.h>
#include <com32.h>
+#include <core-elf.h>
#include <syslinux/adv.h>
#include <syslinux/config.h>
#include <sys/module.h>
diff --git a/com32/elflink/modules/passwd.c b/com32/elflink/modules/passwd.c
index a467a81d..d190b1c7 100644
--- a/com32/elflink/modules/passwd.c
+++ b/com32/elflink/modules/passwd.c
@@ -14,6 +14,7 @@
#include <xcrypt.h>
#include <sha1.h>
#include <base64.h>
+#include <core-elf.h>
#include <sys/module.h>
#include "menu.h"
diff --git a/com32/elflink/modules/printmsg.c b/com32/elflink/modules/printmsg.c
index da9ec29b..e5fc62c6 100644
--- a/com32/elflink/modules/printmsg.c
+++ b/com32/elflink/modules/printmsg.c
@@ -26,6 +26,7 @@
#ifdef __COM32__
#include <com32.h>
#endif
+#include <core-elf.h>
#include "menu.h"
diff --git a/core/elflink/core-elf.h b/core/elflink/core-elf.h
index d13f5062..dcca9002 100644
--- a/core/elflink/core-elf.h
+++ b/core/elflink/core-elf.h
@@ -18,9 +18,9 @@ enum kernel_type {
KT_CONFIG, /* Configuration file */
};
-extern char *append;
+extern const char *append;
extern char *ippappend;
-extern char *globaldefault;
+extern const char *globaldefault;
extern short onerrorlen;
extern int new_linux_kernel(char *okernel, char *ocmdline);
diff --git a/core/elflink/execute.c b/core/elflink/execute.c
index 79dbc553..7e703230 100644
--- a/core/elflink/execute.c
+++ b/core/elflink/execute.c
@@ -16,6 +16,8 @@
#include <dprintf.h>
#include <com32.h>
+#include <sys/exec.h>
+#include "core.h"
#include "core-elf.h"
/* Must match enum kernel_type */
diff --git a/core/elflink/kernel.c b/core/elflink/kernel.c
index 6cb33639..3ce2358d 100644
--- a/core/elflink/kernel.c
+++ b/core/elflink/kernel.c
@@ -10,8 +10,8 @@
#include "core.h"
#include "core-elf.h"
-char *globaldefault = NULL;
-char *append = NULL;
+const char *globaldefault = NULL;
+const char *append = NULL;
/* Will be called from readconfig.c */
int new_linux_kernel(char *okernel, char *ocmdline)