ldlinux.elf : ldlinux.o cli.o readconfig.o refstr.o colors.o getadv.o \
adv.o execute.o chainboot.o kernel.o get_key.o \
- advwrite.o setadv.o eprintf.o loadhigh.o msg.o
+ advwrite.o setadv.o loadhigh.o msg.o
$(LD) $(LDFLAGS) -soname $(patsubst %.elf,%.c32,$(@F)) -o $@ $^ $(LIBS)
LNXCFLAGS += -D__export='__attribute__((visibility("default")))'
memset(buf, 0, MAX_CMDLINE_LEN);
- eprintf("\033[1G\033[1;36m(reverse-i-search)`': \033[0m");
+ printf("\033[1G\033[1;36m(reverse-i-search)`': \033[0m");
while (1) {
key = mygetkey_timeout(kbd_to, tto);
*cursor = p - last_good->command;
}
- eprintf("\033[?7l\033[?25l");
+ printf("\033[?7l\033[?25l");
/* Didn't handle the line wrap case here */
- eprintf("\033[1G\033[1;36m(reverse-i-search)\033[0m`%s': %s",
+ printf("\033[1G\033[1;36m(reverse-i-search)\033[0m`%s': %s",
buf, last_good->command ? : "");
- eprintf("\033[K\r");
+ printf("\033[K\r");
}
return last_good ? last_good->command : NULL;
* so that it follows whatever text has been written to the screen
* previously.
*/
- eprintf("%s ", input);
+ printf("%s ", input);
while (!done) {
if (redraw > 1) {
if (pDraw_Menu)
(*pDraw_Menu) (-1, top, 1);
prev_len = 0;
- eprintf("\033[2J\033[H");
+ printf("\033[2J\033[H");
// printf("\033[0m\033[2J\033[H");
}
prev_len = max(len, prev_len);
/* Redraw the command line */
- eprintf("\033[?7l\033[?25l");
- eprintf("\033[1G%s ", input);
+ printf("\033[?7l\033[?25l");
+ printf("\033[1G%s ", input);
x = strlen(input);
y = 0;
at++;
x++;
if (x >= width) {
- eprintf("\r\n");
+ printf("\r\n");
x = 0;
y++;
}
}
- eprintf("\033[K\r");
+ printf("\033[K\r");
dy = y - (cursor + strlen(input) + 1) / width;
x = (cursor + strlen(input) + 1) % width;
if (dy) {
- eprintf("\033[%dA", dy);
+ printf("\033[%dA", dy);
y -= dy;
}
if (x)
- eprintf("\033[%dC", x);
- eprintf("\033[?25h");
+ printf("\033[%dC", x);
+ printf("\033[?25h");
prev_len = len;
redraw = 0;
}
cursor++;
x++;
if (x >= width) {
- eprintf("\r\n");
+ printf("\r\n");
y++;
x = 0;
}
}
case KEY_CTRL('V'):
if (BIOSName)
- eprintf("%s%s%s", syslinux_banner,
- MK_PTR(0, BIOSName), copyright_str);
+ printf("%s%s%s", syslinux_banner,
+ (char *)MK_PTR(0, BIOSName), copyright_str);
else
- eprintf("%s%s", syslinux_banner, copyright_str);
+ printf("%s%s", syslinux_banner, copyright_str);
redraw = 1;
break;
cursor++;
x++;
if (x >= width) {
- eprintf("\r\n\033[K");
+ printf("\r\n\033[K");
y++;
x = 0;
}
}
}
- eprintf("\033[?7h");
+ printf("\033[?7h");
/* Add the command to the history */
comm_counter = malloc(sizeof(struct cli_command));
extern struct menu_entry *find_label(const char *str);
extern void print_labels(const char *prefix, size_t len);
-extern void eprintf(const char *filename, ...);
-
extern int new_linux_kernel(char *okernel, char *ocmdline);
extern void pm_load_high(com32sys_t *regs);
+++ /dev/null
-#include <stdio.h>
-#include <string.h>
-#include <stdarg.h>
-#include <core.h>
-
-#define BUFFER_SIZE 4096
-
-static void veprintf(const char *format, va_list ap)
-{
- int rv, _rv;
- char buffer[BUFFER_SIZE];
- char *p;
-
- _rv = rv = vsnprintf(buffer, BUFFER_SIZE, format, ap);
-
- if (rv < 0)
- return;
-
- if (rv > BUFFER_SIZE - 1)
- rv = BUFFER_SIZE - 1;
-
- p = buffer;
- while (rv--)
- write_serial(*p++);
-
- _fwrite(buffer, _rv, stdout);
-}
-
-void eprintf(const char *format, ...)
-{
- va_list ap;
-
- va_start(ap, format);
- veprintf(format, ap);
- va_end(ap);
-}
#include "config.h"
#include "syslinux/adv.h"
#include "syslinux/boot.h"
+#include "syslinux/config.h"
#include <sys/module.h>
parse_configs(config_argv);
+ __syslinux_set_serial_console_info();
+
adv = syslinux_getadv(ADV_BOOTONCE, &count);
if (adv && count) {
/*
#include <graphics.h>
static uint8_t TextAttribute; /* Text attribute for message file */
-static uint8_t DisplayMask; /* Display modes mask */
+extern uint8_t DisplayMask; /* Display modes mask */
/* Routine to interpret next print char */
static void (*NextCharJump)(uint8_t);
NextCharJump(ch); /* Do what shall be done */
}
+ DisplayMask = 0x07;
+
fclose(f);
return 0;
}
uint8_t bg, fg;
uint8_t mask = UsingVGA & 0x1;
- /* Write to serial port */
- if (DisplayMask & 0x4)
- write_serial(data);
-
/* 0x1 = text mode, 0x2 = graphics mode */
- if (!(DisplayMask & ++mask))
- return; /* Not screen */
+ if (!(DisplayMask & ++mask) || !(DisplayCon & 0x01)) {
+ /* Write to serial port */
+ if (DisplayMask & 0x4)
+ write_serial(data);
- if (!(DisplayCon & 0x01))
- return;
+ return; /* Not screen */
+ }
fg = convert_to_pcdisplay[(TextAttribute & 0x7)];
bg = convert_to_pcdisplay[((TextAttribute >> 4) & 0x7)];
#include <syslinux/config.h>
#include <dprintf.h>
#include <ctype.h>
+#include <bios.h>
#include <core.h>
#include <fs.h>
short includelevel = 1; //nesting level
short defaultlevel = 0; //the current level of default
short vkernel = 0; //have we seen any "label" statements?
-short displaycon = 1; //conio.inc
extern short NoHalt; //idle.c
const char *onerror = NULL; //"onerror" command line
{
struct menu_entry *me;
- eprintf("\n");
+ printf("\n");
for (me = all_entries; me; me = me->next ) {
if (!strncmp(prefix, me->label, len))
- eprintf(" %s", me->label);
+ printf(" %s", me->label);
}
- eprintf("\n");
+ printf("\n");
}
struct menu_entry *find_label(const char *str)
return;
if (cm->fkeyhelp[fkey].textname) {
- eprintf("\n");
+ printf("\n");
get_msg_file((char *)cm->fkeyhelp[fkey].textname);
}
}
extern void sirq_install(void);
extern void write_serial_str(char *);
-static inline void io_delay(void)
-{
- outb(0, 0x80);
- outb(0, 0x80);
-}
-
extern void loadfont(char *);
extern void loadkeys(char *);
} else if (looking_at(p, "prompt")) {
forceprompt = atoi(skipspace(p + 6));
} else if (looking_at(p, "console")) {
- displaycon = atoi(skipspace(p + 7));
+ DisplayCon = atoi(skipspace(p + 7));
} else if (looking_at(p, "allowoptions")) {
allowoptions = atoi(skipspace(p + 12));
} else if (looking_at(p, "noescape")) {
write_serial_str(syslinux_banner);
write_serial_str(copyright_str);
}
+
} else if (looking_at(p, "say")) {
- eprintf("%s\n", p+4);
+ printf("%s\n", p+4);
} else if (looking_at(p, "path")) {
/* PATH-based lookup */
const char *new_path;
free(PATH);
PATH = _p;
} else
- eprintf("Failed to realloc PATH\n");
+ printf("Failed to realloc PATH\n");
}
}
}
uint16_t flowctl;
};
+extern void __syslinux_set_serial_console_info(void);
+
extern __nocommon struct syslinux_serial_console_info
__syslinux_serial_console_info;
static inline const struct syslinux_serial_console_info
struct syslinux_serial_console_info __syslinux_serial_console_info;
-void __constructor __syslinux_get_serial_console_info(void)
+void __syslinux_set_serial_console_info(void)
{
uint16_t flowctl;
__export uint16_t DisplayCon = 0x01; /* Display console enabled */
__export uint8_t FlowOutput = 0; /* Output to assert for serial flow */
+__export uint8_t DisplayMask = 0x07; /* Display modes mask */
+
uint8_t ScrollAttribute = 0x07; /* Grey on white (normal text color) */
/*
if (!SerialPort)
return;
+ if (!(DisplayMask & 0x04))
+ return;
+
while (1) {
char ch;
/* Already-queued input? */
if (SerialTail == SerialHead) {
/* LSR */
- data = inb(SerialPort + 5) & 1;
- if (data) {
+ data = !(inb(SerialPort + 5) & 1);
+ if (!data) {
/* MSR */
data = inb(SerialPort + 6);
/* Required status bits */
- if (data) {
- data &= FlowIgnore;
- if (data != FlowIgnore)
- data = 0;
- else
- data = 1;
- }
- }
- }
+ data &= FlowIgnore;
+
+ if (data == FlowIgnore)
+ data = 1;
+ else
+ data = 0;
+ } else
+ data = 1;
+ } else
+ data = 1;
sti();
}
sti(); /* We already know we'll consume data */
data = *SerialTail++;
- SerialTail = (char *)((unsigned long)SerialTail & (serial_buf_size - 1));
+ if (SerialTail > SerialHead + serial_buf_size)
+ SerialTail = SerialHead;
} else {
/* LSR */
data = inb(SerialPort + 5) & 1;