2003-01-03 Yoshinori K. Okuji <okuji@enbug.org>
* include/i386/pc/util/biosdisk.h: New file. * util/i386/pc/biosdisk.c: Likewise. * util/i386/pc/pupa-setup.c: Likewise. * Makefile.in (INCLUDE_DISTFILES): Added include/pupa/i386/pc/util/biosdisk.h. (UTIL_DISTFILES): Added biosdisk.c and pupa-setup.c under the directory util/i386/pc. (install-local): Added a rule for sbin_UTILITIES. (uninstall): Likewise. * util/i386/pc/pupa-mkimage.c (usage): Fix a typo in the doc. * util/misc.c (xrealloc): New function. (pupa_malloc): Likewise. (pupa_free): Likewise. (pupa_realloc): Likewise. (pupa_stop): Likewise. (pupa_putchar): Likewise. * kern/disk.c (pupa_disk_read): Prevent L from underflowing. * include/pupa/util/misc.h (xrealloc): Declared. * include/pupa/i386/pc/boot.h (PUPA_BOOT_MACHINE_BPB_START): New macro. (PUPA_BOOT_MACHINE_BPBEND): Renamed to ... (PUPA_BOOT_MACHINE_BPB_END): ... this. * include/pupa/fs.h [PUPA_UTIL] (pupa_fat_init): Declared. [PUPA_UTIL] (pupa_fat_fini): Likewise. * fs/fat.c [PUPA_UTIL] (pupa_fat_init): Defined. Maybe a better way should be implemented. [PUPA_UTIL] (pupa_fat_fini): Likewise. * disk/i386/pc/biosdisk.c (pupa_biosdisk_call_hook): Increase the size of NAME for safety. (pupa_biosdisk_iterate): Search hard disks to 0x90 instead of 0x88. * conf/i386-pc.rmk (sbin_UTILITIES): New variable. (pupa_setup_SOURCES): Likewise. * genmk.rb (Utility#rule): Add $(BUILD_CFLAGS) into the rules.
This commit is contained in:
parent
08b70fe8eb
commit
1cc73a62da
17 changed files with 1809 additions and 18 deletions
|
@ -60,4 +60,9 @@ void EXPORT_FUNC(pupa_fs_unregister) (pupa_fs_t fs);
|
|||
void EXPORT_FUNC(pupa_fs_iterate) (int (*hook) (const pupa_fs_t fs));
|
||||
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);
|
||||
#endif /* PUPA_UTIL */
|
||||
|
||||
#endif /* ! PUPA_FS_HEADER */
|
||||
|
|
|
@ -24,8 +24,11 @@
|
|||
/* The signature for bootloader. */
|
||||
#define PUPA_BOOT_MACHINE_SIGNATURE 0xaa55
|
||||
|
||||
/* The offset of the start of BPB (BIOS Parameter Block). */
|
||||
#define PUPA_BOOT_MACHINE_BPB_START 0x3
|
||||
|
||||
/* The offset of the end of BPB (BIOS Parameter Block). */
|
||||
#define PUPA_BOOT_MACHINE_BPBEND 0x3e
|
||||
#define PUPA_BOOT_MACHINE_BPB_END 0x3e
|
||||
|
||||
/* The offset of the major version. */
|
||||
#define PUPA_BOOT_MACHINE_VER_MAJ 0x3e
|
||||
|
|
28
include/grub/i386/pc/util/biosdisk.h
Normal file
28
include/grub/i386/pc/util/biosdisk.h
Normal file
|
@ -0,0 +1,28 @@
|
|||
/* biosdisk.h - emulate biosdisk */
|
||||
/*
|
||||
* PUPA -- Preliminary Universal Programming Architecture for GRUB
|
||||
* Copyright (C) 2002 Yoshinori K. Okuji <okuji@enbug.org>
|
||||
*
|
||||
* 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_BIOSDISK_MACHINE_UTIL_HEADER
|
||||
#define PUPA_BIOSDISK_MACHINE_UTIL_HEADER 1
|
||||
|
||||
void pupa_util_biosdisk_init (const char *dev_map);
|
||||
void pupa_util_biosdisk_fini (void);
|
||||
char *pupa_util_biosdisk_get_pupa_dev (const char *os_dev);
|
||||
|
||||
#endif /* ! PUPA_BIOSDISK_MACHINE_UTIL_HEADER */
|
|
@ -30,6 +30,7 @@ void pupa_util_info (const char *fmt, ...);
|
|||
void pupa_util_error (const char *fmt, ...) __attribute__ ((noreturn));
|
||||
|
||||
void *xmalloc (size_t size);
|
||||
void *xrealloc (void *ptr, size_t size);
|
||||
char *xstrdup (const char *str);
|
||||
|
||||
char *pupa_util_get_path (const char *dir, const char *file);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue