2003-11-17 Marco Gerards <metgerards@student.han.nl>

* conf/i386-pc.rmk (sbin_UTILITIES): Added pupa-emu.
	(pupa_setup_SOURCES): Added util/i386/pc/getroot.c.
	(pupa_emu_SOURCES): New variable.
	(pupa_emu_LDFLAGS): Likewise.
	* include/pupa/fs.h (pupa_ext2_init) [PUPA_UTIL]: New prototype.
	(pupa_ext2_fini) [PUPA_UTIL]: Likewise.
	* include/pupa/normal.h (pupa_normal_init) [PUPA_UTIL]: Likewise.
	(pupa_normal_fini) [PUPA_UTIL]: Likewise.
	* include/pupa/setjmp.h [PUPA_UTIL]: Include <setjmp.h>.
	(pupa_jmp_buf): New typedef.
	(pupa_setjmp) [PUPA_UTIL]: New macro.
	(pupa_longjmp) [PUPA_UTIL]: Likewise.
	* include/pupa/term.h (struct pupa_term): New member `refresh'.
	(pupa_refresh): New prototype.
	* include/pupa/util/getroot.h: New file.
	* kern/misc.c (pupa_vsprintf): Refresh the screen after updating
	it.
	* kern/rescue.c (pupa_rescue_get_command_line): Likewise.
	(pupa_rescue_cmd_cat): Likewise.
	(pupa_rescue_cmd_ls): Likewise.
	(pupa_rescue_cmd_testload): Likewise.
	(pupa_rescue_cmd_lsmod): Likewise.
	* normal/cmdline.c (pupa_cmdline_get): Likewise.
	* normal/menu.c (run_menu): Likewise.
	* kern/term.c (pupa_cls): Likewise.
	(pupa_refresh): New function.
	* normal/normal.c (pupa_normal_init) [PUPA_UTIL]: New function.
	(pupa_normal_fini) [PUPA_UTIL]: Likewise.
	* util/console.c: New file.

	* util/i386/pc/getroot.c: New file.
	* util/i386/pc/pupa-setup.c: Include <pupa/util/getroot.h>.
	(pupa_putchar): New function.
	(pupa_refresh): Likewise.
	(xgetcwd): Function moved to ...
	(strip_extra_slashes): Likewise.
	(get_prefix): Likewise.
	* util/i386/pc/getroot.c: ... here.
	(find_root_device): Function moved and renamed to...
	* util/i386/pc/getroot.c (pupa_find_root_device): ... here.
	Changed all callers.
	* util/i386/pc/pupa-setup.c (guess_root_device): Function moved
	and renamed to...
	* util/i386/pc/getroot.c (pupa_guess_root_device): ... here.
	Changed all callers.
	* util/misc.c (pupa_memalign): New function.
	(pupa_mm_init_region): Likewise.
	(pupa_register_exported_symbols): Likewise.
	(pupa_putchar): Function removed.
	* util/pupa-emu.c: New file.
This commit is contained in:
marco_g 2003-11-17 18:07:09 +00:00
parent 9a5c1adeaa
commit 1f7315a3de
19 changed files with 1027 additions and 233 deletions

View file

@ -63,6 +63,8 @@ pupa_fs_t EXPORT_FUNC(pupa_fs_probe) (pupa_device_t device);
#ifdef PUPA_UTIL
void pupa_fat_init (void);
void pupa_fat_fini (void);
void pupa_ext2_init (void);
void pupa_ext2_fini (void);
#endif /* PUPA_UTIL */
#endif /* ! PUPA_FS_HEADER */

View file

@ -129,4 +129,9 @@ int pupa_command_execute (char *cmdline);
void pupa_command_init (void);
void pupa_normal_init_page (void);
#ifdef PUPA_UTIL
void pupa_normal_init (void);
void pupa_normal_fini (void);
#endif
#endif /* ! PUPA_NORMAL_HEADER */

View file

@ -20,10 +20,17 @@
#ifndef PUPA_SETJMP_HEADER
#define PUPA_SETJMP_HEADER 1
#ifdef PUPA_UTIL
#include <setjmp.h>
typedef jmp_buf pupa_jmp_buf;
#define pupa_setjmp setjmp
#define pupa_longjmp longjmp
#else
/* This must define pupa_jmp_buf. */
#include <pupa/cpu/setjmp.h>
int pupa_setjmp (pupa_jmp_buf env);
void pupa_longjmp (pupa_jmp_buf env, int val) __attribute__ ((noreturn));
#endif
#endif /* ! PUPA_SETJMP_HEADER */

View file

@ -95,6 +95,9 @@ struct pupa_term
/* Turn on/off the cursor. */
void (*setcursor) (int on);
/* Update the screen. */
void (*refresh) (void);
/* The feature flags defined above. */
pupa_uint32_t flags;
@ -121,6 +124,7 @@ void EXPORT_FUNC(pupa_setcolorstate) (pupa_term_color_state state);
void EXPORT_FUNC(pupa_setcolor) (pupa_uint8_t normal_color,
pupa_uint8_t highlight_color);
int EXPORT_FUNC(pupa_setcursor) (int on);
void EXPORT_FUNC(pupa_refresh) (void);
/* For convenience. */
#define PUPA_TERM_ASCII_CHAR(c) ((c) & 0xff)

View file

@ -0,0 +1,26 @@
/*
* PUPA -- Preliminary Universal Programming Architecture for GRUB
* Copyright (C) 2003 Marco Gerards <metgerards@student.han.nl>
*
* PUPA is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with PUPA; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef PUPA_UTIL_GETROOT_HEADER
#define PUPA_UTIL_GETROOT_HEADER 1
char *pupa_guess_root_device (const char *dir);
char *pupa_get_prefix (const char *dir);
#endif /* ! PUPA_UTIL_GETROOT_HEADER */