Search
lxdream.org :: lxdream/src/loader.h
lxdream 0.9.1
released Jun 29
Download Now
filename src/loader.h
changeset 1108:305ef2082079
prev736:a02d1475ccfd
next1109:700c5ab26a63
author nkeynes
date Fri Jun 04 09:13:40 2010 +1000 (11 years ago)
permissions -rw-r--r--
last change Add ability to wrap a binary program up in a virtual cd image (so that we
can boot it normally)
view annotate diff log raw
     1 /**
     2  * $Id$
     3  *
     4  * Interface declarations for the binary loader routines (loader.c, elf.c)
     5  *
     6  * Copyright (c) 2005 Nathan Keynes.
     7  *
     8  * This program is free software; you can redistribute it and/or modify
     9  * it under the terms of the GNU General Public License as published by
    10  * the Free Software Foundation; either version 2 of the License, or
    11  * (at your option) any later version.
    12  *
    13  * This program is distributed in the hope that it will be useful,
    14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
    15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    16  * GNU General Public License for more details.
    17  */
    19 #ifndef lxdream_loader_H
    20 #define lxdream_loader_H 1
    22 #include <stdio.h>
    23 #include <glib/gtypes.h>
    25 #include "drivers/cdrom/cdrom.h"
    27 #ifdef __cplusplus
    28 extern "C" {
    29 #endif
    31 /** 
    32  * NULL-terminated list of file extension/name pairs,
    33  * supported by the loader 
    34  */
    35 extern char *file_loader_extensions[][2];
    37 /**
    38  * Load the CD bootstrap, aka IP.BIN. Identified by "SEGA SEGAKATANA" at
    39  * start of file. IP.BIN is loaded as-is at 8C008000.
    40  * This is mainly for testing as it's unlikely anyone would want to do this
    41  * for any other reason.
    42  * @return TRUE on success, otherwise FALSE and errno 
    43  */
    44 gboolean file_load_bootstrap( const gchar *filename );
    46 /**
    47  * Load a miscellaneous .bin file, as commonly used in demos. No magic
    48  * applies, file is loaded as is at 8C010000
    49  */
    50 gboolean file_load_binary( const gchar *filename );
    52 /**
    53  * Load a "Self Boot Inducer" .sbi file, also commonly used to package
    54  * demos. (Actually a ZIP file with a predefined structure
    55  */
    56 gboolean file_load_sbi( const gchar *filename );
    58 /**
    59  * Load an ELF executable binary file. Origin is file-dependent.
    60  */
    61 gboolean file_load_elf( const gchar *filename );
    63 /**
    64  * Load any of the above file types, using the appropriate magic to determine
    65  * which is actually applicable
    66  */
    67 gboolean file_load_magic( const gchar *filename );
    69 cdrom_disc_t cdrom_wrap_magic( cdrom_disc_type_t type, const gchar *filename, ERROR *err );
    71 #ifdef __cplusplus
    72 }
    73 #endif
    75 #endif /* !lxdream_loader_H */
.