-
Notifications
You must be signed in to change notification settings - Fork 136
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add: Add elf-loader2 with code mainly on EE
- Loading branch information
Showing
11 changed files
with
1,160 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# _____ ___ ____ ___ ____ | ||
# ____| | ____| | | |____| | ||
# | ___| |____ ___| ____| | \ PS2DEV Open Source Project. | ||
#----------------------------------------------------------------------- | ||
# Copyright ps2dev - http://www.ps2dev.org | ||
# Licenced under Academic Free License version 2.0 | ||
# Review ps2sdk README & LICENSE files for further details. | ||
|
||
EE_OBJS = \ | ||
elf.o \ | ||
elf_loader_compat.o \ | ||
elf_loader_reader.o \ | ||
elf_loader_stdio.o \ | ||
ldrsrc.o | ||
|
||
include $(PS2SDKSRC)/Defs.make | ||
include $(PS2SDKSRC)/ee/Rules.lib.make | ||
include $(PS2SDKSRC)/ee/Rules.make | ||
include $(PS2SDKSRC)/ee/Rules.release | ||
|
||
$(PS2SDKSRC)/tools/bin2c/bin/bin2c: $(PS2SDKSRC)/tools/bin2c | ||
$(MAKEREC) $< | ||
|
||
src/ldrsrc/bin/ldrsrc.bin: | ||
$(MAKEREC) src/ldrsrc | ||
|
||
$(EE_OBJS_DIR)ldrsrc.c: src/ldrsrc/bin/ldrsrc.bin $(PS2SDKSRC)/tools/bin2c/bin/bin2c | ||
$(PS2SDKSRC)/tools/bin2c/bin/bin2c $< $@ ldrsrc | ||
|
||
$(EE_OBJS_DIR)ldrsrc.o: $(EE_OBJS_DIR)ldrsrc.c | ||
$(DIR_GUARD) | ||
$(EE_C_COMPILE) $< -c -o $@ | ||
|
||
clean:: | ||
$(MAKEREC) src/ldrsrc clean | ||
|
||
.NOTPARALLEL:: \ | ||
$(PS2SDKSRC)/tools/bin2c/bin/bin2c \ | ||
src/ldrsrc/bin/ldrsrc.bin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
/* | ||
# _____ ___ ____ ___ ____ | ||
# ____| | ____| | | |____| | ||
# | ___| |____ ___| ____| | \ PS2DEV Open Source Project. | ||
#----------------------------------------------------------------------- | ||
# (c) 2020 Francisco Javier Trujillo Mata <[email protected]> | ||
# Licenced under Academic Free License version 2.0 | ||
# Review ps2sdk README & LICENSE files for further details. | ||
*/ | ||
|
||
/** | ||
* @file | ||
* ELF Loader functions. | ||
*/ | ||
|
||
#ifndef __ELFLOADER_H__ | ||
#define __ELFLOADER_H__ | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
// Before call this method be sure that you have previously called sbv_patch_disable_prefix_check(); | ||
extern int LoadELFFromFile(const char *filename, int argc, char *argv[]); | ||
|
||
/** Modify argv[0] when partition info should be kept | ||
* | ||
* @param filename path to the file itself | ||
* @param partition block device + partition name | ||
* @param argc Number of arguments. | ||
* @param argv Pointer to array of arguments. | ||
* @returns positive on success, zero value on failure | ||
* | ||
* You should prepare filename and partition before parsing in function | ||
* | ||
* filename should be changed to <fs_type>:/path_to_file_without_mountpoint | ||
* for example `pfs3:/TEST.ELF` (where `pfs3` is mountpoint name) will become | ||
* `pfs:/TEST.ELF` (where `pfs` - filesystem type) | ||
* | ||
* partition should be in form <block_device><partition_name>: | ||
* for example `hdd0:__common:` | ||
* block_device - can be `hdd0:`, `hdd1:` , `dvr_hdd0:` | ||
* <partition_name> - name of APA partition on particular block device | ||
* dont forget about leading ":" | ||
* | ||
* It is not necessary that filename should be on that partition | ||
* filename - mass:/TEST.ELF | ||
* partition - pfs:/__common | ||
* will be valid usage | ||
*/ | ||
extern int LoadELFFromFileWithPartition(const char *filename, const char *partition, int argc, char *argv[]); | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
#endif /* __ELFLOADER_H__ */ |
Oops, something went wrong.