Release 1.6.0

This commit is contained in:
Jeremiah Orians 2020-04-30 22:35:22 -04:00
parent 205c383c5f
commit 87672ddfdb
No known key found for this signature in database
GPG Key ID: 5410E91C14959E87
67 changed files with 929 additions and 873 deletions

View File

@ -18,11 +18,18 @@
** Added
Added test for chdir and getcwd family of posix primitives
Added fflush stub, for code to match our behavior when compiled with GCC (we don't buffer)
Added fseek and rewind functions
** Changed
Updated kaem
Revised 27 to include dwart stubs
Restructured tests to enable future growth
Reengineered M2-Planet to leverage blood-elf v1.0's output format
** Fixed
AArch64 wasteful stack
Fixed continue behavior
Generate fully proper elf output
** Removed

View File

@ -88,6 +88,7 @@ clean:
./test/test0020/cleanup.sh
./test/test0021/cleanup.sh
./test/test0022/cleanup.sh
./test/test0023/cleanup.sh
./test/test0100/cleanup.sh
./test/test0101/cleanup.sh
./test/test0102/cleanup.sh
@ -128,6 +129,7 @@ test: test0000-aarch64-binary \
test0020-aarch64-binary \
test0021-aarch64-binary \
test0022-aarch64-binary \
test0023-aarch64-binary \
test0100-aarch64-binary \
test0101-aarch64-binary \
test0102-aarch64-binary \
@ -159,6 +161,7 @@ test: test0000-aarch64-binary \
test0020-amd64-binary \
test0021-amd64-binary \
test0022-amd64-binary \
test0023-amd64-binary \
test0100-amd64-binary \
test0101-amd64-binary \
test0102-amd64-binary \
@ -190,6 +193,7 @@ test: test0000-aarch64-binary \
test0020-knight-posix-binary \
test0021-knight-posix-binary \
test0022-knight-posix-binary \
test0023-knight-posix-binary \
test0100-knight-posix-binary \
test0101-knight-posix-binary \
test0102-knight-posix-binary \
@ -237,6 +241,7 @@ test: test0000-aarch64-binary \
test0020-armv7l-binary \
test0021-armv7l-binary \
test0022-armv7l-binary \
test0023-armv7l-binary \
test0100-armv7l-binary \
test0101-armv7l-binary \
test0102-armv7l-binary \
@ -268,6 +273,7 @@ test: test0000-aarch64-binary \
test0020-x86-binary \
test0021-x86-binary \
test0022-x86-binary \
test0023-x86-binary \
test0100-x86-binary \
test0101-x86-binary \
test0102-x86-binary \
@ -347,6 +353,9 @@ test0021-aarch64-binary: M2-Planet | results
test0022-aarch64-binary: M2-Planet | results
test/test0022/hello-aarch64.sh
test0023-aarch64-binary: M2-Planet | results
test/test0023/hello-aarch64.sh
test0100-aarch64-binary: M2-Planet | results
test/test0100/hello-aarch64.sh
@ -440,6 +449,9 @@ test0021-amd64-binary: M2-Planet | results
test0022-amd64-binary: M2-Planet | results
test/test0022/hello-amd64.sh
test0023-amd64-binary: M2-Planet | results
test/test0023/hello-amd64.sh
test0100-amd64-binary: M2-Planet | results
test/test0100/hello-amd64.sh
@ -533,6 +545,9 @@ test0021-knight-posix-binary: M2-Planet | results
test0022-knight-posix-binary: M2-Planet | results
test/test0022/hello-knight-posix.sh
test0023-knight-posix-binary: M2-Planet | results
test/test0023/hello-knight-posix.sh
test0100-knight-posix-binary: M2-Planet | results
test/test0100/hello-knight-posix.sh
@ -674,6 +689,9 @@ test0021-armv7l-binary: M2-Planet | results
test0022-armv7l-binary: M2-Planet | results
test/test0022/hello-armv7l.sh
test0023-armv7l-binary: M2-Planet | results
test/test0023/hello-armv7l.sh
test0100-armv7l-binary: M2-Planet | results
test/test0100/hello-armv7l.sh
@ -767,6 +785,9 @@ test0021-x86-binary: M2-Planet | results
test0022-x86-binary: M2-Planet | results
test/test0022/hello-x86.sh
test0023-x86-binary: M2-Planet | results
test/test0023/hello-x86.sh
test0100-x86-binary: M2-Planet | results
test/test0100/hello-x86.sh

View File

@ -16,46 +16,55 @@
### You should have received a copy of the GNU General Public License
### along with M2-Planet. If not, see <http://www.gnu.org/licenses/>.
### ELF-aarch64-debug.hex2: ARMv8 AArch64 ELF header in hex2
### stage0's hex2 format
### !<label> 1 byte relative
### $<label> 2 byte address
### @<label> 2 byte relative
### &<label> 4 byte address
### %<label> 4 byte relative
### if you wish to use this header, you need to add :ELF_end to the end of your
### M1 or hex2 files.
## ELF Header
:ELF_base
7F 45 4C 46 # e_ident[EI_MAG0-3] ELF's magic number
7F 45 4C 46 # e_ident[EI_MAG0-3] ELF's magic number
02 # e_ident[EI_CLASS] Indicating 64 bit
01 # e_ident[EI_DATA] Indicating little endianness
01 # e_ident[EI_VERSION] Indicating original elf
02 # e_ident[EI_CLASS] Indicating 64 bit
01 # e_ident[EI_DATA] Indicating little endianness
01 # e_ident[EI_VERSION] Indicating original elf
00 # e_ident[EI_OSABI] Set at 0 because none cares
00 # e_ident[EI_ABIVERSION] See above
00 # e_ident[EI_OSABI] Set at 0 because none cares
00 # e_ident[EI_ABIVERSION] See above
00 00 00 00 00 00 00 # e_ident[EI_PAD]
02 00 # e_type Indicating Executable
B7 00 # e_machine Indicating AArch64
01 00 00 00 # e_version Indicating original elf
00 00 00 00 00 00 00 # e_ident[EI_PAD]
&ELF_text 00 00 00 00 # e_entry Address of the entry point
02 00 # e_type Indicating Executable
B7 00 # e_machine Indicating AArch64
01 00 00 00 # e_version Indicating original elf
&ELF_text 00 00 00 00 # e_entry Address of the entry point
%ELF_program_headers>ELF_base 00 00 00 00 # e_phoff Address of program header table
%ELF_section_headers>ELF_base 00 00 00 00 # e_shoff Address of section header table
00 00 00 00 # e_flags
40 00 # e_ehsize Indicating our 64 Byte header
00 00 00 00 # e_flags
38 00 # e_phentsize size of a program header table
02 00 # e_phnum number of entries in program table
40 00 # e_ehsize Indicating our 64 Byte header
40 00 # e_shentsize size of a section header table
07 00 # e_shnum number of entries in section table
38 00 # e_phentsize size of a program header table
01 00 # e_phnum number of entries in program table
40 00 # e_shentsize size of a section header table
05 00 # e_shnum number of entries in section table
02 00 # e_shstrndx index of the section names
04 00 # e_shstrndx index of the section names
:ELF_program_headers
:ELF_program_header__text
01 00 00 00 # ph_type: PT-LOAD = 1
07 00 00 00 # ph_flags: PF-X|PF-W|PF-R = 7
01 00 00 00 # ph_type: PT-LOAD = 1
07 00 00 00 # ph_flags: PF-X|PF-W|PF-R = 7
00 00 00 00 00 00 00 00 # ph_offset
&ELF_base 00 00 00 00 # ph_vaddr
&ELF_base 00 00 00 00 # ph_physaddr
@ -63,135 +72,4 @@ B7 00 # e_machine Indicating AArch64
%ELF_end>ELF_base 00 00 00 00 # ph_memsz
01 00 00 00 00 00 00 00 # ph_align
#:ELF_program_header__data # NOT USED
# FIXME: linux 4.17 does not allow this overlap
# Uhuuh, elf segment at 0000000001000000
# requested but the memory is mapped already
00 00 00 00 # ph_type: PT-LOAD = 0 => no load
07 00 00 00 # ph_flags: PF-X|PF-W|PF-R = 7
00 00 00 00 00 00 00 00 # ph_offset
&ELF_base 00 00 00 00 # ph_vaddr
&ELF_base 00 00 00 00 # ph_physaddr
%ELF_end>ELF_base 00 00 00 00 # ph_filesz
%ELF_end>ELF_base 00 00 00 00 # ph_memsz
01 00 00 00 00 00 00 00 # ph_align
:ELF_comment
4d 45 53 00 00 00 00 00 # MES
00 00 00 00 00 00 00 00 # align
00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00
4d 45 53 00 00 00 00 00 # MES
00 00 00 00 00 00 00 00 # align
00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00
:ELF_shstr
00
:ELF_shstr__text
2e 74 65 78 74 00 # .text
:ELF_shstr__data
2e 64 61 74 61 00 # .data
:ELF_shstr__comment
2e 63 6f 6d 6d 65 6e 74 00 # .comment
:ELF_shstr__shstr
2e 73 68 73 74 72 74 61 62 00 # .shstrtab
:ELF_shstr__sym
2e 73 79 6d 74 61 62 00 # .symtab
:ELF_shstr__str
2e 73 74 72 74 61 62 00 # .strtab
:ELF_section_headers
00 00 00 00 # sh_name
00 00 00 00 # sh_type
00 00 00 00 00 00 00 00 # sh_flags
00 00 00 00 00 00 00 00 # sh_addr
00 00 00 00 00 00 00 00 # sh_offset
00 00 00 00 00 00 00 00 # sh_size
00 00 00 00 # sh_link
00 00 00 00 # sh_info
00 00 00 00 00 00 00 00 # sh_1?
00 00 00 00 00 00 00 00 # sh_entsize
:ELF_section_header_text
%ELF_shstr__text>ELF_shstr # sh_name
01 00 00 00 # sh_type = SHT_PROGBITS = 1
06 00 00 00 00 00 00 00 # sh_flags = SHF-ALLOC|SHF-EXEC =2 | 4 = 6
&ELF_text 00 00 00 00 # sh_addr
%ELF_text>ELF_base 00 00 00 00 # sh_offset
%ELF_data>ELF_text 00 00 00 00 # sh_size
00 00 00 00 # sh_link
00 00 00 00 # sh_info
01 00 00 00 00 00 00 00 # sh_1?
00 00 00 00 00 00 00 00 # sh_entsize
:ELF_section_header_data
%ELF_shstr__data>ELF_shstr # sh_name
01 00 00 00 # sh_type = SHT_PROGBITS = 1
03 00 00 00 00 00 00 00 # sh_flags = SHF-WRITE|SHF-ALLOC = 1 | 2 = 3
&ELF_data 00 00 00 00 # sh_addr
%ELF_data>ELF_base 00 00 00 00 # sh_offset
%ELF_sym>ELF_data 00 00 00 00 # sh_size
00 00 00 00 # sh_link
00 00 00 00 # sh_info
01 00 00 00 00 00 00 00 # sh_1?
00 00 00 00 00 00 00 00 # sh_entsize
:ELF_section_header_comment
%ELF_shstr__comment>ELF_shstr # sh_name
01 00 00 00 # sh_type = SHT_PROGBITS = 1
00 00 00 00 00 00 00 00 # sh_flags
&ELF_comment 00 00 00 00 # sh_addr
%ELF_comment>ELF_base 00 00 00 00 # sh_offset
%ELF_shstr>ELF_comment 00 00 00 00 # sh_size
00 00 00 00 # sh_link
00 00 00 00 # sh_info
01 00 00 00 00 00 00 00 # sh_1?
00 00 00 00 00 00 00 00 # sh_entsize
:ELF_section_header_shstr
%ELF_shstr__shstr>ELF_shstr # sh_name
03 00 00 00 # sh_type: str-sht-strtab
00 00 00 00 00 00 00 00 # sh_flags
&ELF_shstr 00 00 00 00 # sh_addr
%ELF_shstr>ELF_base 00 00 00 00 # sh_offset
%ELF_section_headers>ELF_shstr 00 00 00 00 # sh_size
00 00 00 00 # sh_link
00 00 00 00 # sh_info
01 00 00 00 00 00 00 00 # sh_1?
00 00 00 00 00 00 00 00 # sh_entsize
:ELF_section_header_sym
%ELF_shstr__sym>ELF_shstr # sh_name
02 00 00 00 # sh_type: str-sht-symtab
00 00 00 00 00 00 00 00 # sh_flags
&ELF_sym 00 00 00 00 # sh_addr
%ELF_sym>ELF_base 00 00 00 00 # sh_offset
%ELF_end>ELF_sym 00 00 00 00 # sh_size
06 00 00 00 # sh_link:6
00 00 00 00 # sh_info
01 00 00 00 00 00 00 00 # sh_1?
18 00 00 00 00 00 00 00 # sh_entsize
:ELF_section_header_str
%ELF_shstr__str>ELF_shstr # sh_name
03 00 00 00 # sh_type: str-sht-strtab
00 00 00 00 00 00 00 00 # sh_flags
&ELF_str 00 00 00 00 # sh_addr
%ELF_str>ELF_base 00 00 00 00 # sh_offset
%ELF_sym>ELF_str 00 00 00 00 # sh_size
00 00 00 00 # sh_link
00 00 00 00 # sh_info
01 00 00 00 00 00 00 00 # sh_1?
00 00 00 00 00 00 00 00 # sh_entsize
00 00 00 00 # align
00 00 00 00
00 00 00 00 # align
00 00 00 00
00 00 00 00
00 00 00 00
:ELF_text

View File

@ -16,54 +16,60 @@
### You should have received a copy of the GNU General Public License
### along with M2-Planet. If not, see <http://www.gnu.org/licenses/>.
### ELF-aarch64.hex2: ARMv8 AArch64 ELF header in hex2
### stage0's hex2 format
### !<label> 1 byte relative
### $<label> 2 byte address
### @<label> 2 byte relative
### &<label> 4 byte address
### %<label> 4 byte relative
### if you wish to use this header, you need to add :ELF_end to the end of your
### M1 or hex2 files.
## ELF Header
:ELF_base
7F 45 4C 46 ## e_ident[EI_MAG0-3] ELF's magic number
7F 45 4C 46 # e_ident[EI_MAG0-3] ELF's magic number
02 ## e_ident[EI_CLASS] Indicating 64 bit
01 ## e_ident[EI_DATA] Indicating little endianness
01 ## e_ident[EI_VERSION] Indicating original elf
02 # e_ident[EI_CLASS] Indicating 64 bit
01 # e_ident[EI_DATA] Indicating little endianness
01 # e_ident[EI_VERSION] Indicating original elf
00 ## e_ident[EI_OSABI] Set at 0 because none cares
00 ## e_ident[EI_ABIVERSION] See above
00 # e_ident[EI_OSABI] Set at 0 because none cares
00 # e_ident[EI_ABIVERSION] See above
00 00 00 00 00 00 00 ## e_ident[EI_PAD]
02 00 ## e_type Indicating Executable
B7 00 ## e_machine Indicating AArch64
01 00 00 00 ## e_version Indicating original elf
00 00 00 00 00 00 00 # e_ident[EI_PAD]
&ELF_text 00 00 00 00 ## e_entry Address of the entry point (Number of bytes this header is + Base Address)
%ELF_program_headers>ELF_base 00 00 00 00 ## e_phoff Address of program header table
00 00 00 00 00 00 00 00 ## e_shoff Address of section header table
02 00 # e_type Indicating Executable
B7 00 # e_machine Indicating AArch64
01 00 00 00 # e_version Indicating original elf
00 00 00 00 ## e_flags
40 00 ## e_ehsize Indicating our 64 Byte header
&ELF_text 00 00 00 00 # e_entry Address of the entry point
%ELF_program_headers>ELF_base 00 00 00 00 # e_phoff Address of program header table
00 00 00 00 00 00 00 00 # e_shoff Address of section header table
38 00 ## e_phentsize size of a program header table
01 00 ## e_phnum number of entries in program table
00 00 00 00 # e_flags
00 00 ## e_shentsize size of a section header table
00 00 ## e_shnum number of entries in section table
40 00 # e_ehsize Indicating our 64 Byte header
38 00 # e_phentsize size of a program header table
01 00 # e_phnum number of entries in program table
00 00 # e_shentsize size of a section header table
00 00 # e_shnum number of entries in section table
00 00 # e_shstrndx index of the section names
00 00 ## e_shstrndx index of the section names
## Program Header
:ELF_program_headers
01 00 00 00 ## p_type
06 00 00 00 ## Flags
00 00 00 00 00 00 00 00 ## p_offset
&ELF_base 00 00 00 00 ## p_vaddr
&ELF_base 00 00 00 00 ## p_physaddr
%ELF_end>ELF_base 00 00 00 00 ## p_filesz
%ELF_end>ELF_base 00 00 00 00 ## p_memsz
01 00 00 00 00 00 00 00 ## Required alignment
:ELF_program_header__text
01 00 00 00 # ph_type: PT-LOAD = 1
07 00 00 00 # ph_flags: PF-X|PF-W|PF-R = 7
00 00 00 00 00 00 00 00 # ph_offset
&ELF_base 00 00 00 00 # ph_vaddr
&ELF_base 00 00 00 00 # ph_physaddr
%ELF_end>ELF_base 00 00 00 00 # ph_filesz
%ELF_end>ELF_base 00 00 00 00 # ph_memsz
01 00 00 00 00 00 00 00 # ph_align
:ELF_text

View File

@ -134,6 +134,7 @@ DEFINE SET_X8_TO_SYS_FACCESSAT 080680d2
DEFINE SET_X8_TO_SYS_FCHDIR 480680d2
DEFINE SET_X8_TO_SYS_FCHMODAT a80680d2
DEFINE SET_X8_TO_SYS_GETCWD 280280d2
DEFINE SET_X8_TO_SYS_LSEEK 288480d2 # FIXME if wrong
DEFINE SET_X8_TO_SYS_OPENAT 080780d2
DEFINE SET_X8_TO_SYS_READ e80780d2
DEFINE SET_X8_TO_SYS_UNAME 081480d2

View File

@ -108,3 +108,25 @@ int fflush(FILE *stream){
/* We don't buffer, nothing to flush */
return 0;
}
// CONSTANT SEEK_SET 0
// CONSTANT SEEK_CUR 1
// CONSTANT SEEK_END 2
int fseek(FILE* f, long offset, int whence)
{
asm("SET_X0_TO_MINUS_1"
"SET_X3_FROM_X0"
"SET_X0_FROM_BP" "SUB_X0_24" "DEREF_X0"
"SET_X2_FROM_X0"
"SET_X0_FROM_BP" "SUB_X0_16" "DEREF_X0"
"SET_X1_FROM_X0"
"SET_X0_FROM_BP" "SUB_X0_8" "DEREF_X0"
"SET_X8_TO_SYS_LSEEK"
"SYSCALL");
}
void rewind(FILE* f)
{
fseek(f, 0, SEEK_SET);
}

View File

@ -15,46 +15,55 @@
### You should have received a copy of the GNU General Public License
### along with M2-Planet. If not, see <http://www.gnu.org/licenses/>.
### elf64.hex2: 64 bit elf header in hex2
### stage0's hex2 format
### !<label> 1 byte relative
### $<label> 2 byte address
### @<label> 2 byte relative
### &<label> 4 byte address
### %<label> 4 byte relative
### if you wish to use this header, you need to add :ELF_end to the end of your
### M1 or hex2 files.
## ELF Header
:ELF_base
7F 45 4C 46 # e_ident[EI_MAG0-3] ELF's magic number
7F 45 4C 46 # e_ident[EI_MAG0-3] ELF's magic number
02 # e_ident[EI_CLASS] Indicating 64 bit
01 # e_ident[EI_DATA] Indicating little endianness
01 # e_ident[EI_VERSION] Indicating original elf
02 # e_ident[EI_CLASS] Indicating 64 bit
01 # e_ident[EI_DATA] Indicating little endianness
01 # e_ident[EI_VERSION] Indicating original elf
00 # e_ident[EI_OSABI] Set at 0 because none cares
00 # e_ident[EI_ABIVERSION] See above
00 # e_ident[EI_OSABI] Set at 0 because none cares
00 # e_ident[EI_ABIVERSION] See above
00 00 00 00 00 00 00 # e_ident[EI_PAD]
02 00 # e_type Indicating Executable
3E 00 # e_machine Indicating AMD64
01 00 00 00 # e_version Indicating original elf
00 00 00 00 00 00 00 # e_ident[EI_PAD]
&ELF_text 00 00 00 00 # e_entry Address of the entry point
02 00 # e_type Indicating Executable
3E 00 # e_machine Indicating AMD64
01 00 00 00 # e_version Indicating original elf
&ELF_text 00 00 00 00 # e_entry Address of the entry point
%ELF_program_headers>ELF_base 00 00 00 00 # e_phoff Address of program header table
%ELF_section_headers>ELF_base 00 00 00 00 # e_shoff Address of section header table
00 00 00 00 # e_flags
40 00 # e_ehsize Indicating our 64 Byte header
00 00 00 00 # e_flags
38 00 # e_phentsize size of a program header table
02 00 # e_phnum number of entries in program table
40 00 # e_ehsize Indicating our 64 Byte header
40 00 # e_shentsize size of a section header table
07 00 # e_shnum number of entries in section table
38 00 # e_phentsize size of a program header table
01 00 # e_phnum number of entries in program table
40 00 # e_shentsize size of a section header table
05 00 # e_shnum number of entries in section table
02 00 # e_shstrndx index of the section names
04 00 # e_shstrndx index of the section names
:ELF_program_headers
:ELF_program_header__text
01 00 00 00 # ph_type: PT-LOAD = 1
07 00 00 00 # ph_flags: PF-X|PF-W|PF-R = 7
01 00 00 00 # ph_type: PT-LOAD = 1
07 00 00 00 # ph_flags: PF-X|PF-W|PF-R = 7
00 00 00 00 00 00 00 00 # ph_offset
&ELF_base 00 00 00 00 # ph_vaddr
&ELF_base 00 00 00 00 # ph_physaddr
@ -62,135 +71,4 @@
%ELF_end>ELF_base 00 00 00 00 # ph_memsz
01 00 00 00 00 00 00 00 # ph_align
#:ELF_program_header__data # NOT USED
# FIXME: linux 4.17 does not allow this overlap
# Uhuuh, elf segment at 0000000001000000
# requested but the memory is mapped already
00 00 00 00 # ph_type: PT-LOAD = 0 => no load
07 00 00 00 # ph_flags: PF-X|PF-W|PF-R = 7
00 00 00 00 00 00 00 00 # ph_offset
&ELF_base 00 00 00 00 # ph_vaddr
&ELF_base 00 00 00 00 # ph_physaddr
%ELF_end>ELF_base 00 00 00 00 # ph_filesz
%ELF_end>ELF_base 00 00 00 00 # ph_memsz
01 00 00 00 00 00 00 00 # ph_align
:ELF_comment
4d 45 53 00 00 00 00 00 # MES
00 00 00 00 00 00 00 00 # align
00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00
4d 45 53 00 00 00 00 00 # MES
00 00 00 00 00 00 00 00 # align
00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00
:ELF_shstr
00
:ELF_shstr__text
2e 74 65 78 74 00 # .text
:ELF_shstr__data
2e 64 61 74 61 00 # .data
:ELF_shstr__comment
2e 63 6f 6d 6d 65 6e 74 00 # .comment
:ELF_shstr__shstr
2e 73 68 73 74 72 74 61 62 00 # .shstrtab
:ELF_shstr__sym
2e 73 79 6d 74 61 62 00 # .symtab
:ELF_shstr__str
2e 73 74 72 74 61 62 00 # .strtab
:ELF_section_headers
00 00 00 00 # sh_name
00 00 00 00 # sh_type
00 00 00 00 00 00 00 00 # sh_flags
00 00 00 00 00 00 00 00 # sh_addr
00 00 00 00 00 00 00 00 # sh_offset
00 00 00 00 00 00 00 00 # sh_size
00 00 00 00 # sh_link
00 00 00 00 # sh_info
00 00 00 00 00 00 00 00 # sh_1?
00 00 00 00 00 00 00 00 # sh_entsize
:ELF_section_header_text
%ELF_shstr__text>ELF_shstr # sh_name
01 00 00 00 # sh_type = SHT_PROGBITS = 1
06 00 00 00 00 00 00 00 # sh_flags = SHF-ALLOC|SHF-EXEC =2 | 4 = 6
&ELF_text 00 00 00 00 # sh_addr
%ELF_text>ELF_base 00 00 00 00 # sh_offset
%ELF_data>ELF_text 00 00 00 00 # sh_size
00 00 00 00 # sh_link
00 00 00 00 # sh_info
01 00 00 00 00 00 00 00 # sh_1?
00 00 00 00 00 00 00 00 # sh_entsize
:ELF_section_header_data
%ELF_shstr__data>ELF_shstr # sh_name
01 00 00 00 # sh_type = SHT_PROGBITS = 1
03 00 00 00 00 00 00 00 # sh_flags = SHF-WRITE|SHF-ALLOC = 1 | 2 = 3
&ELF_data 00 00 00 00 # sh_addr
%ELF_data>ELF_base 00 00 00 00 # sh_offset
%ELF_sym>ELF_data 00 00 00 00 # sh_size
00 00 00 00 # sh_link
00 00 00 00 # sh_info
01 00 00 00 00 00 00 00 # sh_1?
00 00 00 00 00 00 00 00 # sh_entsize
:ELF_section_header_comment
%ELF_shstr__comment>ELF_shstr # sh_name
01 00 00 00 # sh_type = SHT_PROGBITS = 1
00 00 00 00 00 00 00 00 # sh_flags
&ELF_comment 00 00 00 00 # sh_addr
%ELF_comment>ELF_base 00 00 00 00 # sh_offset
%ELF_shstr>ELF_comment 00 00 00 00 # sh_size
00 00 00 00 # sh_link
00 00 00 00 # sh_info
01 00 00 00 00 00 00 00 # sh_1?
00 00 00 00 00 00 00 00 # sh_entsize
:ELF_section_header_shstr
%ELF_shstr__shstr>ELF_shstr # sh_name
03 00 00 00 # sh_type: str-sht-strtab
00 00 00 00 00 00 00 00 # sh_flags
&ELF_shstr 00 00 00 00 # sh_addr
%ELF_shstr>ELF_base 00 00 00 00 # sh_offset
%ELF_section_headers>ELF_shstr 00 00 00 00 # sh_size
00 00 00 00 # sh_link
00 00 00 00 # sh_info
01 00 00 00 00 00 00 00 # sh_1?
00 00 00 00 00 00 00 00 # sh_entsize
:ELF_section_header_sym
%ELF_shstr__sym>ELF_shstr # sh_name
02 00 00 00 # sh_type: str-sht-symtab
00 00 00 00 00 00 00 00 # sh_flags
&ELF_sym 00 00 00 00 # sh_addr
%ELF_sym>ELF_base 00 00 00 00 # sh_offset
%ELF_end>ELF_sym 00 00 00 00 # sh_size
06 00 00 00 # sh_link:6
00 00 00 00 # sh_info
01 00 00 00 00 00 00 00 # sh_1?
18 00 00 00 00 00 00 00 # sh_entsize
:ELF_section_header_str
%ELF_shstr__str>ELF_shstr # sh_name
03 00 00 00 # sh_type: str-sht-strtab
00 00 00 00 00 00 00 00 # sh_flags
&ELF_str 00 00 00 00 # sh_addr
%ELF_str>ELF_base 00 00 00 00 # sh_offset
%ELF_sym>ELF_str 00 00 00 00 # sh_size
00 00 00 00 # sh_link
00 00 00 00 # sh_info
01 00 00 00 00 00 00 00 # sh_1?
00 00 00 00 00 00 00 00 # sh_entsize
00 00 00 00 # align
00 00 00 00
00 00 00 00 # align
00 00 00 00
00 00 00 00
00 00 00 00
:ELF_text

View File

@ -15,54 +15,60 @@
### You should have received a copy of the GNU General Public License
### along with M2-Planet. If not, see <http://www.gnu.org/licenses/>.
### elf64.hex2: 64 bit elf header in hex2
### stage0's hex2 format
### !<label> 1 byte relative
### $<label> 2 byte address
### @<label> 2 byte relative
### &<label> 4 byte address
### %<label> 4 byte relative
### if you wish to use this header, you need to add :ELF_end to the end of your
### M1 or hex2 files.
## ELF Header
:ELF_base
7F 45 4C 46 ## e_ident[EI_MAG0-3] ELF's magic number
7F 45 4C 46 # e_ident[EI_MAG0-3] ELF's magic number
02 ## e_ident[EI_CLASS] Indicating 64 bit
01 ## e_ident[EI_DATA] Indicating little endianness
01 ## e_ident[EI_VERSION] Indicating original elf
02 # e_ident[EI_CLASS] Indicating 64 bit
01 # e_ident[EI_DATA] Indicating little endianness
01 # e_ident[EI_VERSION] Indicating original elf
00 ## e_ident[EI_OSABI] Set at 0 because none cares
00 ## e_ident[EI_ABIVERSION] See above
00 # e_ident[EI_OSABI] Set at 0 because none cares
00 # e_ident[EI_ABIVERSION] See above
00 00 00 00 00 00 00 ## e_ident[EI_PAD]
02 00 ## e_type Indicating Executable
3E 00 ## e_machine Indicating AMD64
01 00 00 00 ## e_version Indicating original elf
00 00 00 00 00 00 00 # e_ident[EI_PAD]
&ELF_text 00 00 00 00 ## e_entry Address of the entry point (Number of bytes this header is + Base Address)
%ELF_program_headers>ELF_base 00 00 00 00 ## e_phoff Address of program header table
00 00 00 00 00 00 00 00 ## e_shoff Address of section header table
02 00 # e_type Indicating Executable
3E 00 # e_machine Indicating AMD64
01 00 00 00 # e_version Indicating original elf
00 00 00 00 ## e_flags
40 00 ## e_ehsize Indicating our 64 Byte header
&ELF_text 00 00 00 00 # e_entry Address of the entry point
%ELF_program_headers>ELF_base 00 00 00 00 # e_phoff Address of program header table
00 00 00 00 00 00 00 00 # e_shoff Address of section header table
38 00 ## e_phentsize size of a program header table
01 00 ## e_phnum number of entries in program table
00 00 00 00 # e_flags
00 00 ## e_shentsize size of a section header table
00 00 ## e_shnum number of entries in section table
40 00 # e_ehsize Indicating our 64 Byte header
38 00 # e_phentsize size of a program header table
01 00 # e_phnum number of entries in program table
00 00 # e_shentsize size of a section header table
00 00 # e_shnum number of entries in section table
00 00 # e_shstrndx index of the section names
00 00 ## e_shstrndx index of the section names
## Program Header
:ELF_program_headers
01 00 00 00 ## p_type
06 00 00 00 ## Flags
00 00 00 00 00 00 00 00 ## p_offset
&ELF_base 00 00 00 00 ## p_vaddr
&ELF_base 00 00 00 00 ## p_physaddr
%ELF_end>ELF_base 00 00 00 00 ## p_filesz
%ELF_end>ELF_base 00 00 00 00 ## p_memsz
01 00 00 00 00 00 00 00 ## Required alignment
:ELF_program_header__text
01 00 00 00 # ph_type: PT-LOAD = 1
07 00 00 00 # ph_flags: PF-X|PF-W|PF-R = 7
00 00 00 00 00 00 00 00 # ph_offset
&ELF_base 00 00 00 00 # ph_vaddr
&ELF_base 00 00 00 00 # ph_physaddr
%ELF_end>ELF_base 00 00 00 00 # ph_filesz
%ELF_end>ELF_base 00 00 00 00 # ph_memsz
01 00 00 00 00 00 00 00 # ph_align
:ELF_text

View File

@ -49,6 +49,7 @@ DEFINE LOAD_IMMEDIATE_rax 48C7C0
DEFINE LOAD_IMMEDIATE_rbx 48C7C3
DEFINE LOAD_IMMEDIATE_rdi 48C7C7
DEFINE LOAD_IMMEDIATE_rdx 48C7C2
DEFINE LOAD_IMMEDIATE_rsi 48C7C6
DEFINE LOAD_INTEGER 488B00
DEFINE LOAD_INTEGER_rdi 488B3F
DEFINE LOAD_INTEGER_rdx 488B12

View File

@ -47,17 +47,21 @@ void fputc(char s, FILE* f)
"SYSCALL");
}
/* Important values needed for open
* O_RDONLY => 0
* O_WRONLY => 1
* O_RDWR => 2
* O_CREAT => 64
* O_TRUNC => 512
* S_IRWXU => 00700
* S_IXUSR => 00100
* S_IWUSR => 00200
* S_IRUSR => 00400
*/
/* Important values needed for open */
// CONSTANT O_RDONLY 0
// CONSTANT O_WRONLY 1
// CONSTANT O_RDWR 2
// CONSTANT O_CREAT 64
// CONSTANT O_TRUNC 512
/* 00700 in octal is 448*/
// CONSTANT S_IRWXU 448
/* 00100 in octal is 64 */
// CONSTANT S_IXUSR 64
/* 00200 in octal is 128 */
// CONSTANT S_IWUSR 128
/* 00400 in octal is 256 */
// CONSTANT S_IRUSR 256
FILE* open(char* name, int flag, int mode)
{
@ -108,3 +112,25 @@ int fflush(FILE *stream){
/* We don't buffer, nothing to flush */
return 0;
}
// CONSTANT SEEK_SET 0
// CONSTANT SEEK_CUR 1
// CONSTANT SEEK_END 2
int fseek(FILE* f, long offset, int whence)
{
/* Uses lseek directly */
asm("LOAD_EFFECTIVE_ADDRESS_rdi %24"
"LOAD_INTEGER_rdi"
"LOAD_EFFECTIVE_ADDRESS_rsi %16"
"LOAD_INTEGER_rsi"
"LOAD_EFFECTIVE_ADDRESS_rdx %8"
"LOAD_INTEGER_rdx"
"LOAD_IMMEDIATE_rax %8"
"SYSCALL");
}
void rewind(FILE* f)
{
fseek(f, 0, SEEK_SET);
}

View File

@ -1,19 +1,19 @@
### Copyright (C) 2016 Jeremiah Orians
### Copyright (C) 2017 Jan Nieuwenhuizen <janneke@gnu.org>
### This file is part of stage0.
### This file is part of M2-Planet.
###
### stage0 is free software: you can redistribute it and/or modify
### M2-Planet 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 3 of the License, or
### (at your option) any later version.
###
### stage0 is distributed in the hope that it will be useful,
### M2-Planet 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 stage0. If not, see <http://www.gnu.org/licenses/>.
### along with M2-Planet. If not, see <http://www.gnu.org/licenses/>.
### stage0's hex2 format
### !<label> 1 byte relative
@ -22,11 +22,11 @@
### &<label> 4 byte address
### %<label> 4 byte relative
### elf32.hex2: 32 bit elf header in hex2
### if you wish to use this header, you need to add :ELF_end to the end of your
### M1 or hex2 files.
## ELF Header
:ELF_base
7F 45 4C 46 # e_ident[EI_MAG0-3] ELF's magic number
@ -52,169 +52,23 @@
34 00 # e_ehsize Indicating our 52 Byte header
20 00 # e_phentsize size of a program header table
02 00 # e_phnum number of entries in program table
01 00 # e_phnum number of entries in program table
28 00 # e_shentsize size of a section header table
07 00 # e_shnum number of entries in section table
05 00 # e_shnum number of entries in section table
04 00 # e_shstrndx index of the section names
02 00 # e_shstrndx index of the section names
# @34
00 00 00 00
00 00 00 00
00 00 00 00
# @40
:ELF_program_headers
:ELF_program_header__text
01 00 00 00 # ph_type: PT-LOAD = 1
00 00 00 00 # ph_offset
&ELF_base # ph_vaddr
&ELF_base # ph_physaddr
%ELF_end>ELF_base # ph_filesz
%ELF_end>ELF_base # ph_memsz
07 00 00 00 # ph_flags: PF-X|PF-W|PF-R = 7
00 00 01 00 # ph_alignment
07 00 00 00 # p_flags
00 00 01 00 # alignment
# @60
:ELF_program_header__data
00 00 00 00 # ph_type: PT-LOAD = 0
00 00 00 00 # ph_offset
&ELF_base # ph_vaddr
&ELF_base # ph_physaddr
%ELF_end>ELF_base # ph_filesz
%ELF_end>ELF_base # ph_memsz
07 00 00 00 # ph_flags: PF-X|PF-W|PF-R = 7
01 00 00 00 # ph_align
# @80
:ELF_comment
4d 45 53 00 # MES
00 00 00 00 # align
00 00 00 00
00 00 00 00
4d 45 53 00 # MES
00 00 00 00 # align
00 00 00 00
00 00 00 00
# @a0
:ELF_shstr
00
:ELF_shstr__text
2e 74 65 78 74 00 # .text
:ELF_shstr__data
2e 64 61 74 61 00 # .data
:ELF_shstr__comment
2e 63 6f 6d 6d 65 6e 74 00 # .comment
:ELF_shstr__shstr
2e 73 68 73 74 72 74 61 62 00 # .shstrtab
:ELF_shstr__sym
2e 73 79 6d 74 61 62 00 # .symtab
:ELF_shstr__str
2e 73 74 72 74 61 62 00 # .strtab
# @d0
:ELF_section_headers
00 00 00 00 # sh_name
00 00 00 00 # sh_type
00 00 00 00 # sh_flags
00 00 00 00 # sh_addr
00 00 00 00 # sh_offset
00 00 00 00 # sh_length
00 00 00 00 # sh_link
00 00 00 00 # sh_info
01 00 00 00 # sh_1?
00 00 00 00 # sh_entsize
## FIXME: M0 for calculations?
:ELF_section_header_text
%ELF_shstr__text>ELF_shstr # sh_name
01 00 00 00 # sh_type = SHT_PROGBITS = 1
06 00 00 00 # sh_flags = SHF-ALLOC|SHF-EXEC =2 | 4 = 6
&ELF_text # sh_addr
%ELF_text>ELF_base # sh_offset
%ELF_data>ELF_text # sh_length
00 00 00 00 # sh_link
00 00 00 00 # sh_info
01 00 00 00 # sh_1?
00 00 00 00 # sh_entsize
:ELF_section_header_data
%ELF_shstr__data>ELF_shstr # sh_name
01 00 00 00 # sh_type = SHT_PROGBITS = 1
03 00 00 00 # sh_flags = SHF-WRITE|SHF-ALLOC = 1 | 2 = 3
&ELF_data # sh_addr
%ELF_data>ELF_base # sh_offset
%ELF_sym>ELF_data # sh_length
00 00 00 00 # sh_link
00 00 00 00 # sh_info
01 00 00 00 # sh_1?
00 00 00 00 # sh_entsize
:ELF_section_header_comment
%ELF_shstr__comment>ELF_shstr # sh_name
01 00 00 00 # sh_type = SHT_PROGBITS = 1
00 00 00 00 # sh_flags
&ELF_comment # sh_addr
%ELF_comment>ELF_base # sh_offset
%ELF_shstr>ELF_comment # sh_length
00 00 00 00 # sh_link
00 00 00 00 # sh_info
01 00 00 00 # sh_1?
00 00 00 00 # sh_entsize
:ELF_section_header_shstr
%ELF_shstr__shstr>ELF_shstr # sh_name
03 00 00 00 # sh_type: str-sht-strtab
00 00 00 00 # sh_flags
&ELF_shstr # sh_addr
%ELF_shstr>ELF_base # sh_offset
%ELF_section_headers>ELF_shstr # sh_length
00 00 00 00 # sh_link
00 00 00 00 # sh_info
01 00 00 00 # sh_1?
00 00 00 00 # sh_entsize
:ELF_section_header_sym
%ELF_shstr__sym>ELF_shstr # sh_name
02 00 00 00 # sh_type: str-sht-symtab
00 00 00 00 # sh_flags
&ELF_sym # sh_addr
%ELF_sym>ELF_base # sh_offset
%ELF_end>ELF_sym # sh_length
06 00 00 00 # sh_link:6
00 00 00 00 # sh_info
01 00 00 00 # sh_1?
10 00 00 00 # sh_entsize
:ELF_section_header_str
%ELF_shstr__str>ELF_shstr # sh_name
03 00 00 00 # sh_type: str-sht-strtab
00 00 00 00 # sh_flags
&ELF_str # sh_addr
%ELF_str>ELF_base # sh_offset
%ELF_sym>ELF_str # sh_length
00 00 00 00 # sh_link
00 00 00 00 # sh_info
01 00 00 00 # sh_1?
00 00 00 00 # sh_entsize
# @1e8
00 00 00 00 # align
00 00 00 00
# @1f0
00 00 00 00 # align
00 00 00 00
00 00 00 00
00 00 00 00
# @200
:ELF_text

View File

@ -1,19 +1,19 @@
### Copyright (C) 2016 Jeremiah Orians
### Copyright (C) 2017 Jan Nieuwenhuizen <janneke@gnu.org>
### This file is part of stage0.
### This file is part of M2-Planet.
###
### stage0 is free software: you can redistribute it and/or modify
### M2-Planet 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 3 of the License, or
### (at your option) any later version.
###
### stage0 is distributed in the hope that it will be useful,
### M2-Planet 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 stage0. If not, see <http://www.gnu.org/licenses/>.
### along with M2-Planet. If not, see <http://www.gnu.org/licenses/>.
### stage0's hex2 format
### !<label> 1 byte relative
@ -22,11 +22,11 @@
### &<label> 4 byte address
### %<label> 4 byte relative
### elf32.hex2: 32 bit elf header in hex2
### if you wish to use this header, you need to add :ELF_end to the end of your
### M1 or hex2 files.
## ELF Header
:ELF_base
7F 45 4C 46 # e_ident[EI_MAG0-3] ELF's magic number
@ -59,19 +59,16 @@
00 00 # e_shstrndx index of the section names
## Program Header
:ELF_program_headers
:ELF_program_header__text
01 00 00 00 # ph_type: PT-LOAD = 1
00 00 00 00 # ph_offset
&ELF_base # ph_vaddr
&ELF_base # ph_physaddr
%ELF_end>ELF_base # ph_filesz
%ELF_end>ELF_base # ph_memsz
07 00 00 00 # p_flags
00 00 01 00 # alignment
07 00 00 00 # ph_flags: PF-X|PF-W|PF-R = 7
00 00 01 00 # ph_alignment
:ELF_text

View File

@ -44,17 +44,20 @@ void fputc(char s, FILE* f)
"SYSCALL_ALWAYS");
}
/* Important values needed for open
* O_RDONLY => 0
* O_WRONLY => 1
* O_RDWR => 2
* O_CREAT => 64
* O_TRUNC => 512
* S_IRWXU => 00700
* S_IXUSR => 00100
* S_IWUSR => 00200
* S_IRUSR => 00400
*/
/* Important values needed for open */
// CONSTANT O_RDONLY 0
// CONSTANT O_WRONLY 1
// CONSTANT O_RDWR 2
// CONSTANT O_CREAT 64
// CONSTANT O_TRUNC 512
/* 00700 in octal is 448*/
// CONSTANT S_IRWXU 448
/* 00100 in octal is 64 */
// CONSTANT S_IXUSR 64
/* 00200 in octal is 128 */
// CONSTANT S_IWUSR 128
/* 00400 in octal is 256 */
// CONSTANT S_IRUSR 256
FILE* open(char* name, int flag, int mode)
{
@ -104,3 +107,24 @@ int fflush(FILE *stream){
/* We don't buffer, nothing to flush */
return 0;
}
// CONSTANT SEEK_SET 0
// CONSTANT SEEK_CUR 1
// CONSTANT SEEK_END 2
int fseek(FILE* f, long offset, int whence)
{
asm("!19 R7 LOADI8_ALWAYS"
"!12 R2 SUB R12 ARITH_ALWAYS"
"!0 R2 LOAD32 R2 MEMORY"
"!8 R1 SUB R12 ARITH_ALWAYS"
"!0 R1 LOAD32 R1 MEMORY"
"!4 R0 SUB R12 ARITH_ALWAYS"
"!0 R0 LOAD32 R0 MEMORY"
"SYSCALL_ALWAYS");
}
void rewind(FILE* f)
{
fseek(f, 0, SEEK_SET);
}

View File

@ -15,11 +15,12 @@
### You should have received a copy of the GNU General Public License
### along with M2-Planet. If not, see <http://www.gnu.org/licenses/>.
### stage0's hex2 format for x86
### stage0's hex2 format
### !<label> 1 byte relative
### $<label> 2 byte address
### @<label> 2 byte relative
### &<label> 4 byte address
### %<label> 4 byte relative
### local_<label> function-local
### string_<index> string #<index>
### if you wish to use this header, you need to add :ELF_end to the end of your
### M1 or hex2 files.

View File

@ -33,17 +33,20 @@ void fputc(char s, FILE* f)
"FPUTC");
}
/* Important values needed for open
* O_RDONLY => 0
* O_WRONLY => 1
* O_RDWR => 2
* O_CREAT => 64
* O_TRUNC => 512
* S_IRWXU => 00700
* S_IXUSR => 00100
* S_IWUSR => 00200
* S_IRUSR => 00400
*/
/* Important values needed for open */
// CONSTANT O_RDONLY 0
// CONSTANT O_WRONLY 1
// CONSTANT O_RDWR 2
// CONSTANT O_CREAT 64
// CONSTANT O_TRUNC 512
/* 00700 in octal is 448*/
// CONSTANT S_IRWXU 448
/* 00100 in octal is 64 */
// CONSTANT S_IXUSR 64
/* 00200 in octal is 128 */
// CONSTANT S_IWUSR 128
/* 00400 in octal is 256 */
// CONSTANT S_IRUSR 256
FILE* open(char* filename, int flag, int mode)
{
@ -84,3 +87,21 @@ int fflush(FILE *stream){
/* We don't buffer, nothing to flush */
return 0;
}
// CONSTANT SEEK_SET 0
// CONSTANT SEEK_CUR 1
// CONSTANT SEEK_END 2
int fseek(FILE* f, long offset, int whence)
{
asm("LOAD R0 R14 0"
"LOAD R1 R14 4"
"LOAD R2 R14 8"
"FSEEK"
"FALSE R2");
}
void rewind(FILE* f)
{
fseek(f, 0, SEEK_SET);
}

View File

@ -15,16 +15,17 @@
### You should have received a copy of the GNU General Public License
### along with M2-Planet. If not, see <http://www.gnu.org/licenses/>.
### stage0's hex2 format for x86
### stage0's hex2 format
### !<label> 1 byte relative
### $<label> 2 byte address
### @<label> 2 byte relative
### &<label> 4 byte address
### %<label> 4 byte relative
### local_<label> function-local
### string_<index> string #<index>
### elf32-header-exit-42.hex2: 32 bit elf header in hex2 for `exit 42'
### if you wish to use this header, you need to add :ELF_end to the end of your
### M1 or hex2 files.
## ELF Header
:ELF_base
7F 45 4C 46 # e_ident[EI_MAG0-3] ELF's magic number
@ -39,7 +40,7 @@
00 00 00 00 00 00 00 # e_ident[EI_PAD]
02 00 # e_type Indicating Executable
03 00 # e_machine Indicating AMD64
03 00 # e_machine Indicating 386
01 00 00 00 # e_version Indicating original elf
&ELF_text # e_entry Address of the entry point
@ -51,19 +52,14 @@
34 00 # e_ehsize Indicating our 52 Byte header
20 00 # e_phentsize size of a program header table
02 00 # e_phnum number of entries in program table
01 00 # e_phnum number of entries in program table
28 00 # e_shentsize size of a section header table
07 00 # e_shnum number of entries in section table
05 00 # e_shnum number of entries in section table
04 00 # e_shstrndx index of the section names
02 00 # e_shstrndx index of the section names
# @34
00 00 00 00
00 00 00 00
00 00 00 00
# @40
:ELF_program_headers
:ELF_program_header__text
01 00 00 00 # ph_type: PT-LOAD = 1
@ -73,147 +69,6 @@
%ELF_end>ELF_base # ph_filesz
%ELF_end>ELF_base # ph_memsz
07 00 00 00 # ph_flags: PF-X|PF-W|PF-R = 7
01 00 00 00 # ph_align
01 00 00 00 # ph_alignment
# @60
#:ELF_program_header__data # NOT USED
# FIXME: linux 4.17 does not allow this overlap
# Uhuuh, elf segment at 0000000001000000
# requested but the memory is mapped already
00 00 00 00 # ph_type: PT-LOAD = 1 => no load
00 00 00 00 # ph_offset
&ELF_base # ph_vaddr
&ELF_base # ph_physaddr
%ELF_end>ELF_base # ph_filesz
%ELF_end>ELF_base # ph_memsz
07 00 00 00 # ph_flags: PF-X|PF-W|PF-R = 7
01 00 00 00 # ph_align
# @80
:ELF_comment
4d 45 53 00 # MES
00 00 00 00 # align
00 00 00 00
00 00 00 00
4d 45 53 00 # MES
00 00 00 00 # align
00 00 00 00
00 00 00 00
# @a0
:ELF_shstr
00
:ELF_shstr__text
2e 74 65 78 74 00 # .text
:ELF_shstr__data
2e 64 61 74 61 00 # .data
:ELF_shstr__comment
2e 63 6f 6d 6d 65 6e 74 00 # .comment
:ELF_shstr__shstr
2e 73 68 73 74 72 74 61 62 00 # .shstrtab
:ELF_shstr__sym
2e 73 79 6d 74 61 62 00 # .symtab
:ELF_shstr__str
2e 73 74 72 74 61 62 00 # .strtab
# @d0
:ELF_section_headers
00 00 00 00 # sh_name
00 00 00 00 # sh_type
00 00 00 00 # sh_flags
00 00 00 00 # sh_addr
00 00 00 00 # sh_offset
00 00 00 00 # sh_length
00 00 00 00 # sh_link
00 00 00 00 # sh_info
01 00 00 00 # sh_1?
00 00 00 00 # sh_entsize
## FIXME: M0 for calculations?
:ELF_section_header_text
%ELF_shstr__text>ELF_shstr # sh_name
01 00 00 00 # sh_type = SHT_PROGBITS = 1
06 00 00 00 # sh_flags = SHF-ALLOC|SHF-EXEC =2 | 4 = 6
&ELF_text # sh_addr
%ELF_text>ELF_base # sh_offset
%ELF_data>ELF_text # sh_length
00 00 00 00 # sh_link
00 00 00 00 # sh_info
01 00 00 00 # sh_1?
00 00 00 00 # sh_entsize
:ELF_section_header_data
%ELF_shstr__data>ELF_shstr # sh_name
01 00 00 00 # sh_type = SHT_PROGBITS = 1
03 00 00 00 # sh_flags = SHF-WRITE|SHF-ALLOC = 1 | 2 = 3
&ELF_data # sh_addr
%ELF_data>ELF_base # sh_offset
%ELF_sym>ELF_data # sh_length
00 00 00 00 # sh_link
00 00 00 00 # sh_info
01 00 00 00 # sh_1?
00 00 00 00 # sh_entsize
:ELF_section_header_comment
%ELF_shstr__comment>ELF_shstr # sh_name
01 00 00 00 # sh_type = SHT_PROGBITS = 1
00 00 00 00 # sh_flags
&ELF_comment # sh_addr
%ELF_comment>ELF_base # sh_offset
%ELF_shstr>ELF_comment # sh_length
00 00 00 00 # sh_link
00 00 00 00 # sh_info
01 00 00 00 # sh_1?
00 00 00 00 # sh_entsize
:ELF_section_header_shstr
%ELF_shstr__shstr>ELF_shstr # sh_name
03 00 00 00 # sh_type: str-sht-strtab
00 00 00 00 # sh_flags
&ELF_shstr # sh_addr
%ELF_shstr>ELF_base # sh_offset
%ELF_section_headers>ELF_shstr # sh_length
00 00 00 00 # sh_link
00 00 00 00 # sh_info
01 00 00 00 # sh_1?
00 00 00 00 # sh_entsize
:ELF_section_header_sym
%ELF_shstr__sym>ELF_shstr # sh_name
02 00 00 00 # sh_type: str-sht-symtab
00 00 00 00 # sh_flags
&ELF_sym # sh_addr
%ELF_sym>ELF_base # sh_offset
%ELF_end>ELF_sym # sh_length
06 00 00 00 # sh_link:6
00 00 00 00 # sh_info
01 00 00 00 # sh_1?
10 00 00 00 # sh_entsize
:ELF_section_header_str
%ELF_shstr__str>ELF_shstr # sh_name
03 00 00 00 # sh_type: str-sht-strtab
00 00 00 00 # sh_flags
&ELF_str # sh_addr
%ELF_str>ELF_base # sh_offset
%ELF_sym>ELF_str # sh_length
00 00 00 00 # sh_link
00 00 00 00 # sh_info
01 00 00 00 # sh_1?
00 00 00 00 # sh_entsize
# @1e8
00 00 00 00 # align
00 00 00 00
# @1f0
00 00 00 00 # align
00 00 00 00
00 00 00 00
00 00 00 00
# @200
:ELF_text

View File

@ -15,64 +15,60 @@
### You should have received a copy of the GNU General Public License
### along with M2-Planet. If not, see <http://www.gnu.org/licenses/>.
### stage0's hex2 format for x86
### stage0's hex2 format
### !<label> 1 byte relative
### $<label> 2 byte address
### @<label> 2 byte relative
### &<label> 4 byte address
### %<label> 4 byte relative
### local_<label> function-local
### string_<index> string #<index>
### elf32.hex2: 32 bit elf header in hex2
### if you wish to use this header, you need to add :ELF_end to the end of your
### M1 or hex2 files.
## ELF Header
:ELF_base
7F 45 4C 46 # e_ident[EI_MAG0-3] ELF's magic number
7F 45 4C 46 # e_ident[EI_MAG0-3] ELF's magic number
01 # e_ident[EI_CLASS] Indicating 32 bit
01 # e_ident[EI_DATA] Indicating little endianness
01 # e_ident[EI_VERSION] Indicating original elf
01 # e_ident[EI_CLASS] Indicating 32 bit
01 # e_ident[EI_DATA] Indicating little endianness
01 # e_ident[EI_VERSION] Indicating original elf
00 # e_ident[EI_OSABI] Set at 0 because none cares
00 # e_ident[EI_ABIVERSION] See above
00 # e_ident[EI_OSABI] Set at 0 because none cares
00 # e_ident[EI_ABIVERSION] See above
00 00 00 00 00 00 00 # e_ident[EI_PAD]
00 00 00 00 00 00 00 # e_ident[EI_PAD]
02 00 # e_type Indicating Executable
03 00 # e_machine Indicating 32bit x86
01 00 00 00 # e_version Indicating original elf
02 00 # e_type Indicating Executable
03 00 # e_machine Indicating 386
01 00 00 00 # e_version Indicating original elf
&ELF_text # e_entry Address of the entry point
%ELF_program_headers>ELF_base # e_phoff Address of program header table
00 00 00 00 # e_shoff Address of section header table
00 00 00 00 # e_flags
00 00 00 00 # e_flags
34 00 # e_ehsize Indicating our 52 Byte header
34 00 # e_ehsize Indicating our 52 Byte header
20 00 # e_phentsize size of a program header table
01 00 # e_phnum number of entries in program table
20 00 # e_phentsize size of a program header table
01 00 # e_phnum number of entries in program table
00 00 # e_shentsize size of a section header table
00 00 # e_shnum number of entries in section table
00 00 # e_shentsize size of a section header table
00 00 # e_shnum number of entries in section table
00 00 # e_shstrndx index of the section names
00 00 # e_shstrndx index of the section names
## Program Header
:ELF_program_headers
:ELF_program_header__text
01 00 00 00 # p_type
00 00 00 00 # p_offset
&ELF_base # p_vaddr
&ELF_base # p_physaddr
%ELF_end>ELF_base # p_filesz
%ELF_end>ELF_base # p_memsz
07 00 00 00 # p_flags
01 00 00 00 # alignmen
01 00 00 00 # ph_type: PT-LOAD = 1
00 00 00 00 # ph_offset
&ELF_base # ph_vaddr
&ELF_base # ph_physaddr
%ELF_end>ELF_base # ph_filesz
%ELF_end>ELF_base # ph_memsz
07 00 00 00 # ph_flags: PF-X|PF-W|PF-R = 7
01 00 00 00 # ph_alignment
:ELF_text

View File

@ -46,17 +46,20 @@ void fputc(char s, FILE* f)
"INT_80");
}
/* Important values needed for open
* O_RDONLY => 0
* O_WRONLY => 1
* O_RDWR => 2
* O_CREAT => 64
* O_TRUNC => 512
* S_IRWXU => 00700
* S_IXUSR => 00100
* S_IWUSR => 00200
* S_IRUSR => 00400
*/
/* Important values needed for open */
// CONSTANT O_RDONLY 0
// CONSTANT O_WRONLY 1
// CONSTANT O_RDWR 2
// CONSTANT O_CREAT 64
// CONSTANT O_TRUNC 512
/* 00700 in octal is 448*/
// CONSTANT S_IRWXU 448
/* 00100 in octal is 64 */
// CONSTANT S_IXUSR 64
/* 00200 in octal is 128 */
// CONSTANT S_IWUSR 128
/* 00400 in octal is 256 */
// CONSTANT S_IRUSR 256
FILE* open(char* name, int flag, int mode)
{
@ -106,3 +109,25 @@ int fflush(FILE *stream){
/* We don't buffer, nothing to flush */
return 0;
}
// CONSTANT SEEK_SET 0
// CONSTANT SEEK_CUR 1
// CONSTANT SEEK_END 2
/* We just use lseek directly */
int fseek(FILE* f, long offset, int whence)
{
asm("LOAD_EFFECTIVE_ADDRESS_ebx %12"
"LOAD_INTEGER_ebx"
"LOAD_EFFECTIVE_ADDRESS_ecx %8"
"LOAD_INTEGER_ecx"
"LOAD_EFFECTIVE_ADDRESS_edx %4"
"LOAD_INTEGER_edx"
"LOAD_IMMEDIATE_eax %19"
"INT_80");
}
void rewind(FILE* f)
{
fseek(f, 0, SEEK_SET);
}

View File

@ -52,6 +52,7 @@ DEFINE LOAD_EFFECTIVE_ADDRESS_edx 8D9424
DEFINE LOAD_ESP_IMMEDIATE_into_eax 8B8424
DEFINE LOAD_IMMEDIATE_eax B8
DEFINE LOAD_IMMEDIATE_ebx BB
DEFINE LOAD_IMMEDIATE_ecx B9
DEFINE LOAD_IMMEDIATE_edx BA
DEFINE LOAD_INTEGER 8B00
DEFINE LOAD_INTEGER_ebx 8B1B

View File

@ -1,171 +1,176 @@
4d8af4fe5f7a5c95e34e7fb9e5fea11b3a7903874640a40c4f2f2ec5caf1902f test/results/test0000-aarch64-binary
e4482d2133772d1d9a00d30a8f46fee405a20b2354414fc735cbed077be7b61b test/results/test0000-amd64-binary
76469810cfab46889b49ad6d5694f2c158aaf7d89aeb4e7b5f8c8efd5e1bd604 test/results/test0000-aarch64-binary
ea0b937a153b677023517ffce45131c0163c7206590315444b0fb5c108621415 test/results/test0000-amd64-binary
25b38a3f5ad81ed4618a3d60fe00e0eb1bf88366f4eb031c02a9f880440ae207 test/results/test0000-armv7l-binary
0c93110e4cf2f8f69eb3a308162478e644ee63fd4881762161be5de50fbe9f06 test/results/test0000-knight-native-binary
64879eebceb475f21e54cb1f2e872996ca80e8c1fbb8b5895fb5fb6bac0c4384 test/results/test0000-knight-posix-binary
c52562bd0aabb86ce8ca177f22f8d0455769b444df2d4d62894faab63b7151d8 test/results/test0000-x86-binary
7f3189f1b5c7cc239c687cf7e5485e2ead162601a1dd6a6dc0853ab5f6200a87 test/results/test0001-aarch64-binary
2c968b3736b6f2828982bad905018bfc4f159d7871e825f86a8f50b55b90b143 test/results/test0001-amd64-binary
83c55e9f6a373f5286fdfb78cce5188690f9d68cea13e7f02a48212afddde612 test/results/test0001-aarch64-binary
6756fe4cffc510283dc9d6963ff16fc6c8862087554d9db661436b7c4d0f23c2 test/results/test0001-amd64-binary
c04bda3cf219832b37e945e416fff106b927703a23af0da2bbfa07fc812a0d92 test/results/test0001-armv7l-binary
bff3ae5a240cd319570ef0c81c499cea51c821bc1369456c23a4206e6072865e test/results/test0001-knight-native-binary
486ee05ccea796a9cfa9bfb23189b8e014b7ce8d14fea03b27d679d410fe17dd test/results/test0001-knight-posix-binary
eae96857f2b6d8e8ba86ac06e72345ea572622b358b23978bb5f2db1baadf41c test/results/test0001-x86-binary
5263cc17ed5e7e481f0a5080c98eabda3ba66d84c439a4ee5819963b0280a924 test/results/test0002-aarch64-binary
c742a827684287cb82b4a3526eb996eda941bf284e11aab431816a3ef1e0804c test/results/test0002-amd64-binary
5efc110045d4ca225ce2376217b0c8a6bcbb3008fa110b07a348d0ec79bed761 test/results/test0002-aarch64-binary
f3684318b816f047e41900cadc1a3845ab249bf742e8abf71d2d279236f448e9 test/results/test0002-amd64-binary
ef25f00027ebb22cccb9a321e6c89c380090e365c6ad691617378a1d89009d89 test/results/test0002-armv7l-binary
7631c0f224100786a4b002b4353da4ea56ecb0d6f3ac1a7bc5827b6e257d0748 test/results/test0002-knight-native-binary
e6493845b9e94a617649638252f23502f9212de583fd00cba6cc07fffd296e32 test/results/test0002-knight-posix-binary
8ead336d2f3f72d5874230492e0472edec61d355905e8636e3dfb2731695037c test/results/test0002-x86-binary
4b69ce72be338359f0cd886050e66eda7e2375c356de0e317d794cae3c1a76af test/results/test0003-aarch64-binary
c611b3cab0a736e7176dac21aa04555039b28362d0cfd3a5c56cf29ca3e48616 test/results/test0003-amd64-binary
901a73d768dbabfa8bbe81acea61e7f5aca2cf2bfb01f133a98fd88053aa8837 test/results/test0003-aarch64-binary
51da675b3e9171bcc24d43c971c9374ffda68c448e5cde47df37b4785e3d599c test/results/test0003-amd64-binary
a80264844e0d16e53c0853a5a59452343fd9504408f37ae02f7063bbd15f0220 test/results/test0003-armv7l-binary
f4affc4dd2112ecf8ec3c40ea5e575d579fc60ff9df8b244dddc1a495e9529d6 test/results/test0003-knight-native-binary
96849d5a9294799a9648c24db21b2dab1555dd5ba69d172d77df800622347226 test/results/test0003-knight-posix-binary
2313cb3f1a2b9eb6bf15f8d43418e15d6c16f7f1b5c22700fdfc2b38beb59192 test/results/test0003-x86-binary
6d6115a029cbcc86fa643377b2693c08d3c3b9158f767e04ccedc1b194940c8d test/results/test0004-aarch64-binary
b773d7ec7c550b71997ce451af7e1ee59fe6597b32adc455b271b7d173d5eae9 test/results/test0004-amd64-binary
d591655926f8f230bf241b6bc5d942b541f048f71881a78d1ffbd8cbf142995d test/results/test0004-aarch64-binary
974805d8b47c7e8557b30deb8fccd446fb85f715afd15b0e46be0450eb3ceb25 test/results/test0004-amd64-binary
fc9de9b27e154643e221f9d8281956809db5ee9f85a56d990f8a7de66d47f10a test/results/test0004-armv7l-binary
343306548109a79f599b64f8ad63331cf6a4328eb5ddb2a1f19f6eebec6b254a test/results/test0004-knight-native-binary
df9ba08dfa69ac6cbb4483146dbbe079ef575d7de8318e2e52283151ebf24bd3 test/results/test0004-knight-posix-binary
b7ddb37063c541c6a315809c4438aa235d6702f54bb64f4ffc88dbe78617de81 test/results/test0004-x86-binary
3aff4a809c9b753e2864b5c3319ed9380856265deafd1e3e8d3aabaa6254285c test/results/test0005-aarch64-binary
c4e5e2ffc3a2c3d4116589fa1369d45e5af91cc69b5d342ef5552dfca992c64b test/results/test0005-amd64-binary
748f6b9825bf9b72908dfee1ea674eaf1c3c63b0100a3e3195efefabe5048280 test/results/test0005-armv7l-binary
80a013c2c1e318abad4adf3be036fec777129482d6321aebbbfb17bbcc767360 test/results/test0005-aarch64-binary
10e185b3366b804276d070e90b7575ac05a4bcb981a18a6cc9906ffec5a3f835 test/results/test0005-amd64-binary
4166558bcd229742eae778321756497cf655f3e3c6e7120d44e7062c4d4b9349 test/results/test0005-armv7l-binary
ac909d377dad4961c3df5bb780b1562015e79f8f866d07b4fefaa19f5521f32a test/results/test0005-knight-native-binary
290a68de66c3a83ef5bd75aa1d3b9057d0d6740b310072d11f9daacb184e9100 test/results/test0005-knight-posix-binary
90321c43b2384050e5f03e5af67d345b55dd8a43e96d1f3b7f29d3c5dae3f077 test/results/test0005-x86-binary
5b4198c7e7a52f38f5b626efd121a86f47d68fad80d00c6011271bb62af00cb8 test/results/test0006-aarch64-binary
98fab6d12630465d4e3cb72102b541c818e75b034e1ca1823c26ad6dabc4a910 test/results/test0006-amd64-binary
1bf5c7905768a63ba867100885347c2761eeeeba81fdb52ea361a9420a243eb3 test/results/test0006-aarch64-binary
dced5898897d3bdf4ae95fd0617795db50c063722dc4f96c7373228281491eac test/results/test0006-amd64-binary
bb913bdbfb77b855d416a6051e0d5646275fe6eed7a89cf3373be14d83bef1c5 test/results/test0006-armv7l-binary
169d83f5dd34a1d764716342149f56db492b1f790ce323c5e93b4d577f772e7b test/results/test0006-knight-native-binary
b177d769ae44c3509d9a08d0ee631ec69654dc5d723408bf0decdc67c42aae27 test/results/test0006-knight-posix-binary
663fc6eefe965f237b6bf5a211398c8ae1210f97ff39b59603677e92462c68c7 test/results/test0006-x86-binary
d4089b614e0156cad2655247f536e775e48cb012b9db7435e452dd6f2b960d5f test/results/test0007-aarch64-binary
58af02adcf5a1bfa21dae4992ed3fe0a1f708c67bb5bf1f842a51b3b8eeddf05 test/results/test0007-amd64-binary
90536bf90e780a3ce2f49a9f2ce48be954122375ea61f116d4521b97ddaf5a51 test/results/test0007-aarch64-binary
13e3081b63ab49c873c4d496aa91c87b64429852c09ad78d905956958b5611b6 test/results/test0007-amd64-binary
5ce09fce0c670056284cf18586151060dc56e2b3b87c816939b66d351e70ccf6 test/results/test0007-armv7l-binary
525ba92027d697564cd7d7611aa32c33486e55e2e60ecf19d700bf2884571975 test/results/test0007-knight-native-binary
9159c4ba8196b24ec78bc9ebfbc7066d510ddbf03461736e7795a48634134dc5 test/results/test0007-knight-posix-binary
a9a3e332d13ded5f80d7431f8717f26527b3722b33ea57760a9a5723dffc099c test/results/test0007-x86-binary
095af0ebc63ff3843aa27d4eef40fff29a675e36bb3c6e00a1e24af2ae6c2a32 test/results/test0008-aarch64-binary
3a9a7815ad19bbdd9ea6921ecae8521089df27ac08bc207df11a2a0080f5acbb test/results/test0008-amd64-binary
8747033b48dfcf85e864d7f7e5b254ef1a4044fc1f9e6893994b474a160198ee test/results/test0008-aarch64-binary
0b60495f65045bf8adf6073ecb28ef673b00dfe2ff77864e74fe8320da530dbe test/results/test0008-amd64-binary
28b9834ef90a721c6cba5ca818547d607d0e1a63c60ddd684b6aff885cd21fc2 test/results/test0008-armv7l-binary
16c6a5a8f3723fd464d8bded94ceaeef96e95a83e38caa380bd2d5cc375415c4 test/results/test0008-knight-native-binary
b824859fd0e39f1417742a1b9a1cec18ade78afdd80ce2c64cb54cdf7683f53a test/results/test0008-knight-posix-binary
3a099298d2235ad00518bb6e2f2f9e25d429c4fe576dfc9cf083e3e0053bdcc2 test/results/test0008-x86-binary
915f2b6bb8a0f9cc78d1108b856072aaed1804d05f0ff1e00191673ff0ea2398 test/results/test0009-aarch64-binary
b1251d03f35474f9c5cec84d067d97295a47ae34dbd9f12e72a3630127cc1e07 test/results/test0009-amd64-binary
442d46faa18bbef736d42af5a26eaf5ba092557b16eeb86c4826d35fe087bc6e test/results/test0009-aarch64-binary
e1b7c972856f17216a2a6176bc9a5b7fe7bedb2a3b9d36d4c2f7be785b6e2f35 test/results/test0009-amd64-binary
4fd3351f92149ccfb103a2d09a28a90939fb828d56f14c1b39fa4507c32a8f1a test/results/test0009-armv7l-binary
e046d0be9ebb80c6053682f37af5ed18fece5afb089f67ecf98556700d7e85f0 test/results/test0009-knight-native-binary
990e82bccca98e6393f72b659abc2eb6069f272202286ce2ca51e9d8a941f3cd test/results/test0009-knight-posix-binary
9e4a0a6216bb4fde5dcefac91fd7c623e9e00b3e762946e5a47a1b50b4656103 test/results/test0009-x86-binary
280ab596580b8e1c771e690b9864a5a693c8bcf89f831de6d0897ca982e5ea6e test/results/test0010-aarch64-binary
a9cf4422e05075395ad75bbfe4b2659aec4541edd46d8c6b5064d3496b06a0b6 test/results/test0010-amd64-binary
9175763fcbe035fc51e796d0b2c63a637c47f4110968680783ee56a682f7e798 test/results/test0010-aarch64-binary
2a1ff64b0a248c6d074dffbaf9e7a176b41e9203e4e894fd31d3a8b276f3e62e test/results/test0010-amd64-binary
a0ae067746e7a2b01d33950da1cf640e12c3a70a045ab331ea2025af59dec9af test/results/test0010-armv7l-binary
e01b615db5df31392bd1054c45141dcff936b11dfb1cad270edc0aa67653f5a1 test/results/test0010-knight-native-binary
c1b5a2a3cd46c5e95e5540e871c2a916e028684ca80f51c001ef489342e27625 test/results/test0010-knight-posix-binary
b3e13d54aab689137628fb9c4487bfd8288f9bd18bef8fe756577c8d2dce1f1f test/results/test0010-x86-binary
d0034c3d48652bf52dc716ba81088132794c3085df3d42bffc9dce30943d4a8c test/results/test0011-aarch64-binary
34e6d535e30ef8826a4ad1a4d08b76cfa370c54595599ad3be784b64c9cd8ec5 test/results/test0011-amd64-binary
a2a7724b820c73f67caa9e90bf4cb41be1746262eb3060858b8b67931684cd78 test/results/test0011-aarch64-binary
a27ce71deca5ad07284ab9b0d6a5b092eb93b23d195bf4889787215dc4728a20 test/results/test0011-amd64-binary
893695e6f300a0fe055fad935a56abd549bba70d1d39c535a680f41bbb73f117 test/results/test0011-armv7l-binary
7115c4a552eb4b2c1a868ac3dca43be7d040c8e89b7b66851d0522d298429af9 test/results/test0011-knight-native-binary
63fd5fbf389d1b19031026df193ec55e98d923b8568007125b80bc246c094496 test/results/test0011-knight-posix-binary
3fd11bad4a426ce1ff8fd9c6d7d2b943effae9f3f5740b7376e426e9b0555851 test/results/test0011-x86-binary
de41ca6df213581126ef624177d768c23dbc6eca77140d44c09a5e043ca1d407 test/results/test0012-aarch64-binary
dc88f6de5ae892774760843079eab57306bf0f6f683d4999bdec0d43e4e762b2 test/results/test0012-amd64-binary
f498817b4fe04ead2f3210b7124d60c16371f053dfbcea3b10d95c7d0149f938 test/results/test0012-aarch64-binary
0525ce13777ba9ec1b69611697157417d9b104c895b9cc458fc7dc971e8919f2 test/results/test0012-amd64-binary
08b9c0110bd2fa0a6653b3064ad194e7dc2f333f57068845a0abab7f5a13499f test/results/test0012-armv7l-binary
61d043a6b25c34d470b01e8b8458427c32350574ba9f69eeed01ad1cde444167 test/results/test0012-knight-native-binary
313536f9209d29d4c3b40f6ada898f81c1fb3b650ca1a84754f90b1db3b9e001 test/results/test0012-knight-posix-binary
f98ab8e4bb35580e0dde96126d7a56aff66bda208d02c8d89390b40d6cff591c test/results/test0012-x86-binary
656109a17d7a76e7cd21fbdc4550ed23db5f04056f923ad5792d59a3a433b900 test/results/test0013-aarch64-binary
5095e23b0d6680de3e28c1898b66c352761522f42313acb96f6f39bf0707f4bb test/results/test0013-amd64-binary
4899088b96e9bd1788658b559c7cdf7693283025769b0a20406374d99dfbb24d test/results/test0013-aarch64-binary
08ba43756288e99fad89639c89dec1092b535882ca04ea1645337eb69d26e80d test/results/test0013-amd64-binary
b72e3ad2a245af1ea94de50faec05d56dfe031e75dff4cdde75e1c92c3d617a6 test/results/test0013-armv7l-binary
291900015203744afc992273d19517e5c1aa9babca7d6d04a2f31b502b163414 test/results/test0013-knight-native-binary
e50c97ba330823cb5cbe938bb9d1575340b083e60fc42db8edefcfd95851daa2 test/results/test0013-knight-posix-binary
5051ffca2615144419f8ec1a5d4999486ae81e7781428f59e47e866af97cef92 test/results/test0013-x86-binary
bc2465bbde70111a66ea62a4a305820e42fbe54805cc208f63272193a232bf6c test/results/test0014-aarch64-binary
bcc5f70b76fd7ff1a8ccbc1d13e41044b3a6f2b7158194fc0a669b0ba07d0969 test/results/test0014-amd64-binary
af98d1864e0994e714e52278936b5cc9dbd007fafd7bbc89c64f28045e8e45ea test/results/test0014-aarch64-binary
8fb3c9345247a055dc7296fadaea77d84549ba89612bf7815de8bc4836ab4414 test/results/test0014-amd64-binary
2df8a834bfabc03f04214bc330870c075367f32dd40a31e9028927dafac1f091 test/results/test0014-armv7l-binary
38c83f8d176c3cd70fcb82658b7376487402f550b2e32181dfcd5b942ae949a0 test/results/test0014-knight-posix-binary
a8218958b628066e2fda63d3933f1bf607c358d7bdfe84fc02596393698ea5f6 test/results/test0014-x86-binary
031e3b63c9e6c23d1490e3fad2716e8acfe9642dec46e874312f379a8e4936d7 test/results/test0015-aarch64-binary
062bbddee495d687df846dea8030a8a39291bc219142a98b0117bf790c09c5f2 test/results/test0015-amd64-binary
b42ba7f44b40d5e39224a06ec26b3c28d55ed9cd40b56814d1599c21f469ceca test/results/test0015-armv7l-binary
79233cc1035c4ecc683fb261af621439552bcd952d6de2da0cf446be28605edd test/results/test0015-knight-posix-binary
412f3034a67ba228ad0b3eb80b8eef1d586960a223b8d94bcb38db2fe1c4d15e test/results/test0015-x86-binary
801e852553c59844b6821bd895f7287092736bda197e1c6b904d0b1147dc42ee test/results/test0016-aarch64-binary
12a07b4d624eb6c9be702deb143efb3bb2ee31b4cb95ebf7d485456dd33608e5 test/results/test0016-amd64-binary
bf59bea5f60d8c7e5f09119f908bf96644f53283270d0956ad4f2aa495d5abd3 test/results/test0016-armv7l-binary
9eba2344e436a3d60d661c88f388f544eab2d063d899bff01077dc143faad625 test/results/test0016-knight-posix-binary
2c6cbbfcdc61284e4eb8be9420ea35df51d0663d2f3f7500865b622f299dd765 test/results/test0016-x86-binary
c2117c61b6713075f2b663135dd35a7de1420986ee9ee3b543ab93c8995c9e2d test/results/test0017-aarch64-binary
826be2799b14be83652ee28ae18e45728987205346eaba5fbffd4c6894dbec33 test/results/test0017-amd64-binary
f63dae52880eea9d7a8e8b495daa219f8381062a9a614c60a7af25925392c01a test/results/test0015-aarch64-binary
cf18dd2a780e232a6e755f4df3e49e934b26acf1c95c9cfe46907378d81b7f63 test/results/test0015-amd64-binary
28b8ef74ee4c265f6de5e6e009b6b289dbeb62930f53a028b12ea6624b51c0c7 test/results/test0015-armv7l-binary
1635f0389cda6d976855850993168240605012d67a214f1adc14902204da7f5c test/results/test0015-knight-posix-binary
087c9483d1c8d571bf57967e68460b772945e3a452f181bb192695aa1e6fbcc0 test/results/test0015-x86-binary
aa4dd0d677e3f3cf4414a4da618b5884bd61445043f2315885099b0c9b369992 test/results/test0016-aarch64-binary
bb6a9b3606af5503e1839d69f16b6459c15edcb3cf86b627f69acd2531423474 test/results/test0016-amd64-binary
b4ab1287a84182b237a9de543e57fc6324b41c9e62e62d02b584f73c41ed6917 test/results/test0016-armv7l-binary
602c12a1989ee26bbe437b8a40ce9b99b7be3936495de89a4823fa182f012c7a test/results/test0016-knight-posix-binary
cb80f6d8f9e04b70e0f6ef441612153ad90429f39cb7a6d6d8d288b21cc9a882 test/results/test0016-x86-binary
1379da42ced891fe57cf1db2a9647b7f94d14b8dc93a503aeb2d46b85e7c4151 test/results/test0017-aarch64-binary
4989fe9e42c8267b065784021dc3c82ffc52d7d713575a3dd3f5f08983ab7e29 test/results/test0017-amd64-binary
1e630c50633011aa2e78f05be2bf71f90e288117008d53b7c673255e74c4cac2 test/results/test0017-armv7l-binary
47e3fe786d27493a94c1f8aac0394e7726f85268cf0d7cfa02295f0d1629cb4a test/results/test0017-knight-native-binary
cf67b71d4010910ccf2264c52d7253b092afa88be14890f36927fe595d71cf7f test/results/test0017-knight-posix-binary
a29899250b4ee3c722045a8feedaec2e0f537b9a148f23d10d1979e135f14038 test/results/test0017-x86-binary
f97e865090271aa557cbf9244042786d4bb47c8d6d0a14f2004c8ffc6bc19886 test/results/test0018-aarch64-binary
309a8c957df7c2ea621964a0d1b15b4745431579ab9c08ac0d6845d8e705bece test/results/test0018-amd64-binary
0989f597815eda8b33c579bd07ba650b9c5c32389ecb9795a1fb3f148351d852 test/results/test0018-armv7l-binary
3b69bd290d58d29b4194cfe50304efcbb045f56bf8c525a4854a37f529900b81 test/results/test0018-aarch64-binary
83f6820acf4df90904b0667ad2efdb8f38b129088a5a846cc13016c0e882f2c8 test/results/test0018-amd64-binary
e46fff84c1ba44f8fc6808fedcbea8e48499eedc0b048f64d7a9dd4bb4a33a40 test/results/test0018-armv7l-binary
aee694dc1e2e98d69e21f6f4f95120989e8b928379f3b290fee60fd5e32882ef test/results/test0018-knight-native-binary
8a84f9fc97b2af717d5cd1bda2e2aaa9a8fe096df87ed4b8339e872740d29035 test/results/test0018-knight-posix-binary
8da8807a094fea739ab798e63ace5068d9c0a8fda3a6b2e1dfde348e4ee360cc test/results/test0018-x86-binary
0704ff42e11c03e92ea2ec25ffc9be03390c0ec8cbd7bc3ad12e7341443e8cc6 test/results/test0019-aarch64-binary
99d0436c7edd901696cbdf81f19dbc8457ad31fb8f98a0290975e146359941cf test/results/test0019-amd64-binary
0b0c3b5d90e88a596f27675bd162f50ae3c40521c611694a63f0a83dcedd106a test/results/test0019-armv7l-binary
639607c57cdc6d6dbdfabd18559d6193d953d48084ad0a19b82e7182a281c84d test/results/test0019-knight-posix-binary
5d199ac10906ac599e64f41adf963f5188a40d5ad0ae2429a276d4a022148ad2 test/results/test0019-x86-binary
e759aeb73d575fc23e7b71684be8547e6fbd93a2db42e4cf6c987215793e3dbc test/results/test0020-aarch64-binary
15950e38bab2603bfcb369b9a4941abfc2e37b7cbbd2cf9b22ebfc9aab46d5ad test/results/test0020-amd64-binary
f355d006d47d663a97c55ebf7f1eae8cafc87b76a6952524bff85b6768f530fc test/results/test0018-knight-posix-binary
183eac19d10dd4726d6d2d73557fbbfe61bcb9b15ab9ae16f0749f9bf3db5d1c test/results/test0018-x86-binary
2d6db824491ec73c4bbb817e2618c23f13ef71b9622ee971ba51d8a595ae1bde test/results/test0019-aarch64-binary
0873e1a49580f43a6b9f2de9355f0037e963774e0894332d8d5b2a50d1d053b0 test/results/test0019-amd64-binary
6d752f05c037928b8915d6dbbbe0c34e5217ca010897f4a64ec2e970fa229ee2 test/results/test0019-armv7l-binary
1368524fad579144cf693b528a19448f8dad7fb51ffa6e64bd046fc628eceba5 test/results/test0019-knight-posix-binary
cefb1ae7ca38d2a2c9bdf65cdeb16f4b71e7756a002496bbc3da88eaa8259575 test/results/test0019-x86-binary
c7e6094e6895e9f213625adecbbdaa00eacd3f7a8374bd984beacc96316d3d64 test/results/test0020-aarch64-binary
da0f89737709c997bd143a3af79ccf268fdc192f4e04bd6ff2ddc01bc11bbbc7 test/results/test0020-amd64-binary
80612ce05a2e43fceb34139577be98794505cd324ff5bc84ba004a21828b5f86 test/results/test0020-armv7l-binary
d9d40f64041a02b6a403fd3c07550cf53f9383e0ec7f7208c9c263d06ea3ce8f test/results/test0020-knight-native-binary
6a59795dbb4397d0efaf1ad613d646ec435eec62db30eb758bcf2499d651520e test/results/test0020-knight-posix-binary
0d1a43723d0482a21028164e33ff116d66302d6042a88eacf08436a351494530 test/results/test0020-x86-binary
1aee2d30cddca2dbe7fad42456f3c15c1172317da35a691eba318eeb49b51397 test/results/test0021-aarch64-binary
4996b18760b664ce79578c37cc3b745ae5ecdb02b81f2ac208e223730fe6e99d test/results/test0021-amd64-binary
41ef02dd46b0c86122afda4777e78f02652078b8700386441a33ca94fb91d2c1 test/results/test0021-armv7l-binary
68223515b47c10ff88427856b54c5ca6669bbd1756e240efefa10cdf4f5daf25 test/results/test0021-knight-posix-binary
87d39d319cac03c6dc94ea4433923ed2fe5c94183e259fe46b37bd0ebfdf6e52 test/results/test0021-x86-binary
fe10ab83134a4493bd1f849b5011ecace5f2f7fea67ebbe23147630931d27095 test/results/test0022-aarch64-binary
b2959bfffdda7d00e0c5c4b6553b73d660540c96652f726c2695a6f4eca8b6fa test/results/test0022-amd64-binary
bb5ddd52eeeeca01ccdc51bbd39e76172c4952984842ba732df8bffd2a7730a6 test/results/test0022-armv7l-binary
c3d07c7c8de93e287b5446b8df1ec70c6864df0e6505e5ae38937a13616014d7 test/results/test0022-knight-posix-binary
194bebc7c0f9b42833e331bd40d491adebbf18b64c1fa41c5e6e164e178983af test/results/test0022-x86-binary
536b1772ac1e530e336197b3039092493c73c23cc05ca5486cb62dd07d6dd615 test/results/test0100-aarch64-binary
e532a49dd16954a678bd31c00aa52e75a3e6eb0fc34a7737119bbb5da0ddbe11 test/results/test0100-amd64-binary
0592e04feb23c17b447ee6659c053a9c6db1ddfdced80a0061375b34b97c2649 test/results/test0100-armv7l-binary
a74bbd769ff87816102774d980f92a3a28164052b628aefa87994ade3b28fde3 test/results/test0100-knight-posix-binary
1302493ea2f46a70d9d834cc5016c67271fcd3e2d887e98c46b515e4446ffc1f test/results/test0100-x86-binary
ef7a261a10285ca027500e823efced4c69c888872958f25f82cf7370e7c2ce9c test/results/test0101-aarch64-binary
a0b15e61da5a2738dee5c66c3add5377635d182a4948da2f65c4ffcbf8dfc1a9 test/results/test0101-amd64-binary
a8c15948ea0644cef49b679d7a1a4fb0a3133c43558f00e178f5c9be829b7b63 test/results/test0101-armv7l-binary
2db7459499bd03497c364c1f19c3187fa855d3331fae1c50471c31f5cf6c3db2 test/results/test0101-knight-posix-binary
57af2a921925fce3921b11f8b0e204dfb3d4b73c132ba8fe47d4d0b3b9402fd2 test/results/test0101-x86-binary
937b2d07981321a39c09940ba6dec5bbe25691e64d24fa7681b1c4acd330fdc3 test/results/test0102-aarch64-binary
154902a1c56230332304ffc92f4c038e14af5d48d348df8146d882976aa3a612 test/results/test0102-amd64-binary
3094bbf621e2ff62d918512563b55e897166e0a3e29a47931752bfa172f32a94 test/results/test0102-armv7l-binary
8ef8f89d7489298d8f282462a26384079711552cce7c723b42c67d385bac990e test/results/test0102-knight-posix-binary
160f8c686d2262ab10a1c5e46a5d01a1a52c007a092944178aa7cc192a2e7b87 test/results/test0102-x86-binary
4c3ffe99acc1af34287b3372141a0304463a98e023793c71a02c3fecebaa0a3c test/results/test0103-aarch64-binary
e36a46c51b36cf8b985aa62d3854c63cf4cb137231f648349aa1968258d64047 test/results/test0103-amd64-binary
4a851094e22d553d8bea824ee7d2798001c7f2a107d999e3b7d43dc3195d8793 test/results/test0103-armv7l-binary
c4de07b7b94784823bae2c26aeb58b5efb0bf6df9f392e8e8dab2df8fbb6d814 test/results/test0103-knight-posix-binary
eadaabe9d94c2f33f4e8297f8f5f9923cd83569f7fcf7cccdf3d64622fe65b4a test/results/test0103-x86-binary
7a7817dcaa47b397f81098828f4f491dcf59db5b2969899c09becb287cca31be test/results/test0104-aarch64-binary
e92eb1179f7dc3d4727ad8293e5fe22bfd324ec56271bb7678593436ca34dd8f test/results/test0104-amd64-binary
ccc8cd59f2e584e72ef172c0c7f835b62a651943e3a07228ca01e73c84fb4ce2 test/results/test0104-armv7l-binary
3a97e126b035fbc1724cd2a69b9fedbf629c44a053449c4882899b3d96e8ff55 test/results/test0104-x86-binary
46768e2d26f8e88620cc54a0363e4ef53b2752cd96d9aaeb94a54f2cfcb63f2e test/results/test0105-aarch64-binary
ea7431ae6eddeafbc0d36a4144771c788d6f3a6a4018e53e364a29f6eb49d89d test/results/test0105-amd64-binary
ccde886cf25f6516a2d4b96c2c8cefb2c3c1ef82df0384ebd2f8a278aee7a83e test/results/test0105-armv7l-binary
edc293c1b72e59764756fa2872db4d9d9fee7443c6afa269ba5a1cda1ab3db39 test/results/test0105-x86-binary
c287f7c662cd29bdeb7258300de83c6b0895e002a18c9f46dac31ecd5476b69c test/results/test0106-aarch64-binary
717c42e1a1a91ef5b67ce298bc92a148418a5dec6761a358a52b22a01f16c928 test/results/test0106-amd64-binary
e5747e116b9fa4905b915af1fcb2aa79e176e0be529db399a80e5295d9f703b2 test/results/test0021-aarch64-binary
6613757a76367e85569881be538b909d21eb639c84063cfcb429b23559297bd5 test/results/test0021-amd64-binary
d49b3a0dc27b0bad8df5336236082a721590a18b4a0e8000104261c9b26b2387 test/results/test0021-armv7l-binary
5653ff788de1c4e5ad8c49d3d5aa91e63509ef7a53bdb4b64bffe9814d1e9ade test/results/test0021-knight-posix-binary
3895f4a5e8e903ff52dc5365a37bd41d5e9b7790d635ceec85c645fecf1dc854 test/results/test0021-x86-binary
609a079b7cbb5a0ea3c9038fa97cd2b2208fc1d7f2dad9ea1d0aec4e6397adcc test/results/test0022-aarch64-binary
124ff014513713a45267898572d0d020bdc7161e68ce52647667752596e19f61 test/results/test0022-amd64-binary
15a4585da41091b7b0b3cd156bd0a96b2b34e766377b75803095ff5631c75ab2 test/results/test0022-armv7l-binary
825ab7d2bcb15bbf22cd51a9e9b31f97ad2274052fa397aef3d3ad6cba3331e6 test/results/test0022-knight-posix-binary
9d590d7f3634b7dd2859b2121a1af5724570923bccdcc2f820df15ae312fc650 test/results/test0022-x86-binary
e438ce38381b035307a823ebbbfee6ab191ba07602aad8071d95a9f3b67334d7 test/results/test0023-aarch64-binary
3c14f18cac4d9edcf34257e549b70fe567faba359b596b983ff183010282455d test/results/test0023-amd64-binary
debed5a21b14c07f39dca14991abea9929fadcd797fb161a15b44cb35d0f1075 test/results/test0023-armv7l-binary
720334fcaf22a1e8ec13f722ab1b6da1882bedef7289e188157b29e6ab708716 test/results/test0023-knight-posix-binary
d6a72b8fa7c7b85bda27f85617b8a4a3824b5f6bfabfa625b480f9cf6a3071a0 test/results/test0023-x86-binary
a375b826c642614eb5fec127c0acdb45d1e351e738333e44a6a52095b01f788b test/results/test0100-aarch64-binary
5840a3b01216f795e2e075a7fa90f9e90c4e554fd228f5d717893bda782fddae test/results/test0100-amd64-binary
06d88b5e0adb8381b3f8c66fddade6cae29bcdd1d22b14d3f64eb085379a1845 test/results/test0100-armv7l-binary
7b439e2b7297f165cebbd17477924a077d713ed2313609c77015f9321a2d5738 test/results/test0100-knight-posix-binary
c6b8572c7e4c17dacfa6bff572118bc0bb381c55e93e3713ff2bdb2120da2884 test/results/test0100-x86-binary
633aae75d518f3745f4008a1e557092c1a89e24825b15ecf2e30928eab509319 test/results/test0101-aarch64-binary
0dfca040e6242f6b2cb75c229074a80304648b2c07e3cf473b82f39aaf286e50 test/results/test0101-amd64-binary
17468b1757f19a284e2df629b972c4b899539424b397f5fcb98e3a3557357aeb test/results/test0101-armv7l-binary
206af573a171e1209e96ed74b0d036a29c5a12082dab5851d45ec2a3ef90fc7c test/results/test0101-knight-posix-binary
9f62ad01ebf1e88a6b8a113d0941700a88720b70522293a78986c0e5924a2092 test/results/test0101-x86-binary
5d8da826c486a832da11615566cccfa6493a903da0ea1f7a0fa522a7f900377d test/results/test0102-aarch64-binary
e55e9f561015bfdfe57e6b16bb89073767a689b6c4b71c27c12ece6743b64d6f test/results/test0102-amd64-binary
79e9c3c89f297727007cbc28655e6830a78a080c83fa40fa0418037ee7c070ce test/results/test0102-armv7l-binary
2fd1859cf73d3785a39409a559818e2043f07dcc0e87c38d73a1ffb606946e57 test/results/test0102-knight-posix-binary
d94a8f4967758eba2c9c22abce0f8748d0a911d8886976ff83eee3c6a56400d9 test/results/test0102-x86-binary
ceb606e6790fdcfd466651ab6ea898c2774111a44ca4784d62def126f3f91e59 test/results/test0103-aarch64-binary
d719fcefe5f43aa0d1d40f3c4dad492143724a03bc462d072be6516753169fc7 test/results/test0103-amd64-binary
c0e65e2f627573e71852c65f9170ce0e5225ff8d093db4cab81528fd8345efb2 test/results/test0103-armv7l-binary
aa0658748cb076122f6166bc1a5759ae7e8fda92f952e139bb848ef52c5f9e69 test/results/test0103-knight-posix-binary
892c187a576a7b7da2569584549ee6b86d7b4684c78c605af8a2716cfa19b86b test/results/test0103-x86-binary
7bdf44a5a06974fa8e2325b17cd6cf07c6e3299f7c045525dd5f48d2cf5ac42e test/results/test0104-aarch64-binary
bff825bc0c7ade07aeb3db24da9458dbb39229610fa8b91674c43458ba538ba4 test/results/test0104-amd64-binary
51825d21f139a2b13802fb4c9321f68d4d3c82659021e0b0824fa610f3723cc1 test/results/test0104-armv7l-binary
f17791b6e40379132ee1e9fbc9184eb0460d89f9e7d785e1935f06fd1e3f97d5 test/results/test0104-x86-binary
bc83eba9398003813480aed133d1db6834f04ae5f6103d163d4ec2fe10a24715 test/results/test0105-aarch64-binary
45450b45b670e5e09363b7e9be46b5863918160f842c5ff60d428a1f932f558e test/results/test0105-amd64-binary
2bc74dd2808a4608be8a07a0cc1f349781212a1db35eea104def2b2264e15186 test/results/test0105-armv7l-binary
d316d45feb20453064baaff71fdca9f53de9569dc6ba870a42c44d6ff134a9bb test/results/test0105-x86-binary
3bfb1fdafee927f201de835f8ba2e306dc5968602b5bf9306dac6ee0e6735c5a test/results/test0106-aarch64-binary
5b1fc9d2188f32199ac0fff51b1c92d1010e62b5b1eb8a2e6a1d575f50e8452f test/results/test0106-amd64-binary
4e759b212b087824f7b0f14c5147272c9984c4a4d00074b2fd771c3d004c9aec test/results/test0106-armv7l-binary
45116095f72aa1a4bf09aeff9f9ddc11e0c7ca3b0c380be930ad8db762088770 test/results/test0106-knight-native-binary
13c270bacaee1748dad55532fc0adfa713904ba1cafbd69f77a9d361bdc4acd7 test/results/test0106-knight-posix-binary
e970ab9e2e85cd01c0f9c14f0af1954e3628a44c988ca8175a983037457522f9 test/results/test0106-x86-binary
acd48735d081febf668197eb3b69a03003bf5bb38572bc3191ee8667d05413b6 test/results/test1000-aarch64-binary
c926c6f5589f8a7960653e52ebf595f2ba3387dac960bc0b4b14d4301c58739f test/results/test1000-amd64-binary
81c2059568011bf3d1aafcc01bd2651a84c5727de72e830976461d61cd652fe1 test/results/test1000-armv7l-binary
a450aca2b37f674f9d3db96dc7daa128446a67831c6999cd6f855062362861d2 test/results/test1000-knight-posix-binary
065407fc6e88bc34a0e88cc3a1fccd4a7423081d6b0a3d6607d6189c980fdd48 test/results/test1000-x86-binary
ced91907394b3e9d639394744c91f0a3a51899d4b616fc8456f4dd6737df245b test/results/test1000-aarch64-binary
51726f2157c1cc3bbc448e7d8f7061b81cdfc7df5e5e064d8321872f2b66df85 test/results/test1000-amd64-binary
315ce930feb6305c3d3aae9f80e6ddd4f2acfe7a453645363d6ca8045ed8f4cd test/results/test1000-armv7l-binary
090b139722727e549ea425e2e648660f148cedb5f6fcfabd013e367ee7521c14 test/results/test1000-knight-posix-binary
97b632740878f1188a0f13ac4ba1ca0496996410357bd007a049b10c07083c11 test/results/test1000-x86-binary

View File

@ -33,6 +33,7 @@ bin/M2-Planet --architecture aarch64 \
# Build debug footer
blood-elf --64 -f test/test0021/chdir.M1 \
--entry _start \
-o test/test0021/chdir-footer.M1 || exit 2
# Macro assemble with libc written in M1-Macro

View File

@ -33,6 +33,7 @@ bin/M2-Planet --architecture amd64 \
# Build debug footer
blood-elf --64 -f test/test0021/chdir.M1 \
--entry _start \
-o test/test0021/chdir-footer.M1 || exit 2
# Macro assemble with libc written in M1-Macro

View File

@ -33,6 +33,7 @@ bin/M2-Planet --architecture armv7l \
# Build debug footer
blood-elf -f test/test0021/chdir.M1 \
--entry _start \
-o test/test0021/chdir-footer.M1 || exit 2
# Macro assemble with libc written in M1-Macro

View File

@ -35,6 +35,7 @@ bin/M2-Planet --architecture x86 \
# Build debug footer
blood-elf -f test/test0021/chdir.M1 \
--entry _start \
-o test/test0021/chdir-footer.M1 || exit 2
# Macro assemble with libc written in M1-Macro

View File

@ -31,6 +31,7 @@ bin/M2-Planet --architecture aarch64 \
# Build debug footer
blood-elf --64 -f test/test0022/continue.M1 \
--entry _start \
-o test/test0022/continue-footer.M1 || exit 2
# Macro assemble with libc written in M1-Macro

View File

@ -31,6 +31,7 @@ bin/M2-Planet --architecture amd64 \
# Build debug footer
blood-elf --64 -f test/test0022/continue.M1 \
--entry _start \
-o test/test0022/continue-footer.M1 || exit 2
# Macro assemble with libc written in M1-Macro

View File

@ -31,6 +31,7 @@ bin/M2-Planet --architecture armv7l \
# Build debug footer
blood-elf -f test/test0022/continue.M1 \
--entry _start \
-o test/test0022/continue-footer.M1 || exit 2
# Macro assemble with libc written in M1-Macro

View File

@ -31,6 +31,7 @@ bin/M2-Planet --architecture x86 \
# Build debug footer
blood-elf -f test/test0022/continue.M1 \
--entry _start \
-o test/test0022/continue-footer.M1 || exit 2
# Macro assemble with libc written in M1-Macro

19
test/test0023/.gitignore vendored Normal file
View File

@ -0,0 +1,19 @@
## Copyright (C) 2017 Jeremiah Orians
## This file is part of M2-Planet.
##
## M2-Planet 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 3 of the License, or
## (at your option) any later version.
##
## M2-Planet 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 M2-Planet. If not, see <http://www.gnu.org/licenses/>.
# Ignore the files created by script
*.M1
*.hex2
proof

20
test/test0023/cleanup.sh Executable file
View File

@ -0,0 +1,20 @@
#! /bin/sh
## Copyright (C) 2017 Jeremiah Orians
## This file is part of M2-Planet.
##
## M2-Planet 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 3 of the License, or
## (at your option) any later version.
##
## M2-Planet 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 M2-Planet. If not, see <http://www.gnu.org/licenses/>.
rm -f test/test0023/fseek.M1
rm -f test/test0023/fseek-footer.M1
rm -f test/test0023/fseek.hex2
exit 0

66
test/test0023/fseek.c Normal file
View File

@ -0,0 +1,66 @@
/* Copyright (C) 2016 Jeremiah Orians
* This file is part of M2-Planet.
*
* M2-Planet 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 3 of the License, or
* (at your option) any later version.
*
* M2-Planet 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 M2-Planet. If not, see <http://www.gnu.org/licenses/>.
*/
#include<stdio.h>
#include <stdlib.h>
int main(int argc, char** argv)
{
if(2 != argc) return 2;
FILE* f = fopen(argv[1], "r");
fseek(f, 15, SEEK_SET);
int c = fgetc(f);
fputc(c, stdout);
fseek(f, -8, SEEK_END);
c = fgetc(f);
fputc(c, stdout);
fseek(f, -19, SEEK_CUR);
c = fgetc(f);
fputc(c, stdout);
fseek(f, 7, SEEK_CUR);
c = fgetc(f);
fputc(c, stdout);
fseek(f, -2, SEEK_END);
c = fgetc(f);
fputc(c, stdout);
fseek(f, 34, SEEK_SET);
c = fgetc(f);
fputc(c, stdout);
fseek(f, 5, SEEK_CUR);
c = fgetc(f);
fputc(c, stdout);
fseek(f, -5, SEEK_CUR);
c = fgetc(f);
fputc(c, stdout);
fseek(f, 6, SEEK_CUR);
c = fgetc(f);
fputc(c, stdout);
fseek(f, -1, SEEK_END);
c = fgetc(f);
fputc(c, stdout);
return 0;
}

59
test/test0023/hello-aarch64.sh Executable file
View File

@ -0,0 +1,59 @@
#! /bin/sh
## Copyright (C) 2017 Jeremiah Orians
## This file is part of M2-Planet.
##
## M2-Planet 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 3 of the License, or
## (at your option) any later version.
##
## M2-Planet 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 M2-Planet. If not, see <http://www.gnu.org/licenses/>.
set -x
# Build the test
bin/M2-Planet --architecture aarch64 \
-f test/common_aarch64/functions/file.c \
-f test/test0023/fseek.c \
--debug \
-o test/test0023/fseek.M1 || exit 1
# Build debug footer
blood-elf --64 -f test/test0023/fseek.M1 \
--entry _start \
-o test/test0023/fseek-footer.M1 || exit 2
# Macro assemble with libc written in M1-Macro
M1 -f test/common_aarch64/aarch64_defs.M1 \
-f test/common_aarch64/libc-core.M1 \
-f test/test0023/fseek.M1 \
-f test/test0023/fseek-footer.M1 \
--LittleEndian \
--architecture aarch64 \
-o test/test0023/fseek.hex2 || exit 3
# Resolve all linkages
hex2 -f test/common_aarch64/ELF-aarch64-debug.hex2 \
-f test/test0023/fseek.hex2 \
--LittleEndian \
--architecture aarch64 \
--BaseAddress 0x400000 \
-o test/results/test0023-aarch64-binary \
--exec_enable || exit 4
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "aarch64" ]
then
. ./sha256.sh
# Verify that the resulting file works
./test/results/test0023-aarch64-binary test/test0023/question >| test/test0023/proof
[ 0 = $? ] || exit 5
out=$(sha256_check test/test0023/proof.answer)
[ "$out" = "test/test0023/proof: OK" ] || exit 6
fi
exit 0

59
test/test0023/hello-amd64.sh Executable file
View File

@ -0,0 +1,59 @@
#! /bin/sh
## Copyright (C) 2017 Jeremiah Orians
## This file is part of M2-Planet.
##
## M2-Planet 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 3 of the License, or
## (at your option) any later version.
##
## M2-Planet 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 M2-Planet. If not, see <http://www.gnu.org/licenses/>.
set -x
# Build the test
bin/M2-Planet --architecture amd64 \
-f test/common_amd64/functions/file.c \
-f test/test0023/fseek.c \
--debug \
-o test/test0023/fseek.M1 || exit 1
# Build debug footer
blood-elf --64 -f test/test0023/fseek.M1 \
--entry _start \
-o test/test0023/fseek-footer.M1 || exit 2
# Macro assemble with libc written in M1-Macro
M1 -f test/common_amd64/amd64_defs.M1 \
-f test/common_amd64/libc-core.M1 \
-f test/test0023/fseek.M1 \
-f test/test0023/fseek-footer.M1 \
--LittleEndian \
--architecture amd64 \
-o test/test0023/fseek.hex2 || exit 3
# Resolve all linkages
hex2 -f test/common_amd64/ELF-amd64-debug.hex2 \
-f test/test0023/fseek.hex2 \
--LittleEndian \
--architecture amd64 \
--BaseAddress 0x00600000 \
-o test/results/test0023-amd64-binary \
--exec_enable || exit 4
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "amd64" ]
then
. ./sha256.sh
# Verify that the resulting file works
./test/results/test0023-amd64-binary test/test0023/question >| test/test0023/proof
[ 0 = $? ] || exit 5
out=$(sha256_check test/test0023/proof.answer)
[ "$out" = "test/test0023/proof: OK" ] || exit 6
fi
exit 0

59
test/test0023/hello-armv7l.sh Executable file
View File

@ -0,0 +1,59 @@
#! /bin/sh
## Copyright (C) 2017 Jeremiah Orians
## This file is part of M2-Planet.
##
## M2-Planet 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 3 of the License, or
## (at your option) any later version.
##
## M2-Planet 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 M2-Planet. If not, see <http://www.gnu.org/licenses/>.
set -x
# Build the test
bin/M2-Planet --architecture armv7l \
-f test/common_armv7l/functions/file.c \
-f test/test0023/fseek.c \
--debug \
-o test/test0023/fseek.M1 || exit 1
# Build debug footer
blood-elf -f test/test0023/fseek.M1 \
--entry _start \
-o test/test0023/fseek-footer.M1 || exit 2
# Macro assemble with libc written in M1-Macro
M1 -f test/common_armv7l/armv7l_defs.M1 \
-f test/common_armv7l/libc-core.M1 \
-f test/test0023/fseek.M1 \
-f test/test0023/fseek-footer.M1 \
--LittleEndian \
--architecture armv7l \
-o test/test0023/fseek.hex2 || exit 3
# Resolve all linkages
hex2 -f test/common_armv7l/ELF-armv7l-debug.hex2 \
-f test/test0023/fseek.hex2 \
--LittleEndian \
--architecture armv7l \
--BaseAddress 0x10000 \
-o test/results/test0023-armv7l-binary \
--exec_enable || exit 4
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "armv7l" ]
then
. ./sha256.sh
# Verify that the resulting file works
./test/results/test0023-armv7l-binary test/test0023/question >| test/test0023/proof
[ 0 = $? ] || exit 5
out=$(sha256_check test/test0023/proof.answer)
[ "$out" = "test/test0023/proof: OK" ] || exit 6
fi
exit 0

View File

@ -0,0 +1,52 @@
#! /bin/sh
## Copyright (C) 2017 Jeremiah Orians
## This file is part of M2-Planet.
##
## M2-Planet 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 3 of the License, or
## (at your option) any later version.
##
## M2-Planet 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 M2-Planet. If not, see <http://www.gnu.org/licenses/>.
set -x
# Build the test
bin/M2-Planet --architecture knight-posix \
-f test/common_knight/functions/file.c \
-f test/test0023/fseek.c \
-o test/test0023/fseek.M1 || exit 1
# Macro assemble with libc written in M1-Macro
M1 -f test/common_knight/knight_defs.M1 \
-f test/common_knight/libc-core.M1 \
-f test/test0023/fseek.M1 \
--BigEndian \
--architecture knight-posix \
-o test/test0023/fseek.hex2 || exit 3
# Resolve all linkages
hex2 -f test/common_knight/ELF-knight.hex2 \
-f test/test0023/fseek.hex2 \
--BigEndian \
--architecture knight-posix \
--BaseAddress 0x0 \
-o test/results/test0023-knight-posix-binary \
--exec_enable || exit 4
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "knight*" ]
then
. ./sha256.sh
# Verify that the resulting file works
./test/results/test0023-knight-posix-binary test/test0023/question >| test/test0023/proof
[ 0 = $? ] || exit 5
out=$(sha256_check test/test0023/proof.answer)
[ "$out" = "test/test0023/proof: OK" ] || exit 6
fi
exit 0

59
test/test0023/hello-x86.sh Executable file
View File

@ -0,0 +1,59 @@
#! /bin/sh
## Copyright (C) 2017 Jeremiah Orians
## This file is part of M2-Planet.
##
## M2-Planet 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 3 of the License, or
## (at your option) any later version.
##
## M2-Planet 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 M2-Planet. If not, see <http://www.gnu.org/licenses/>.
set -x
# Build the test
bin/M2-Planet --architecture x86 \
-f test/common_x86/functions/file.c \
-f test/test0023/fseek.c \
--debug \
-o test/test0023/fseek.M1 || exit 1
# Build debug footer
blood-elf -f test/test0023/fseek.M1 \
--entry _start \
-o test/test0023/fseek-footer.M1 || exit 2
# Macro assemble with libc written in M1-Macro
M1 -f test/common_x86/x86_defs.M1 \
-f test/common_x86/libc-core.M1 \
-f test/test0023/fseek.M1 \
-f test/test0023/fseek-footer.M1 \
--LittleEndian \
--architecture x86 \
-o test/test0023/fseek.hex2 || exit 3
# Resolve all linkages
hex2 -f test/common_x86/ELF-i386-debug.hex2 \
-f test/test0023/fseek.hex2 \
--LittleEndian \
--architecture x86 \
--BaseAddress 0x8048000 \
-o test/results/test0023-x86-binary \
--exec_enable || exit 4
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "x86" ]
then
. ./sha256.sh
# Verify that the resulting file works
./test/results/test0023-x86-binary test/test0023/question >| test/test0023/proof
[ 0 = $? ] || exit 5
out=$(sha256_check test/test0023/proof.answer)
[ "$out" = "test/test0023/proof: OK" ] || exit 6
fi
exit 0

View File

@ -0,0 +1 @@
1d3a3c2ef063b41f302f235ccbaea5502e6bbacdc32832bf152467381589a195 test/test0023/proof

1
test/test0023/question Normal file
View File

@ -0,0 +1 @@
0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz

View File

@ -31,6 +31,7 @@ set -x
# Build debug footer
blood-elf --64 -f test/test0100/blood-elf.M1 \
--entry _start \
-o test/test0100/blood-elf-footer.M1 || exit 2
# Macro assemble with libc written in M1-Macro

View File

@ -29,6 +29,7 @@ set -x
# Build debug footer
blood-elf --64 -f test/test0100/blood-elf.M1 \
--entry _start \
-o test/test0100/blood-elf-footer.M1 || exit 2
# Macro assemble with libc written in M1-Macro

View File

@ -29,6 +29,7 @@ set -x
# Build debug footer
blood-elf -f test/test0100/blood-elf.M1 \
--entry _start \
-o test/test0100/blood-elf-footer.M1 || exit 2
# Macro assemble with libc written in M1-Macro

View File

@ -29,6 +29,7 @@ set -x
# Build debug footer
blood-elf -f test/test0100/blood-elf.M1 \
--entry _start \
-o test/test0100/blood-elf-footer.M1 || exit 2
# Macro assemble with libc written in M1-Macro

View File

@ -34,6 +34,7 @@ set -x
# Build debug footer
blood-elf --64 -f test/test0101/hex2_linker.M1 \
--entry _start \
-o test/test0101/hex2_linker-footer.M1 || exit 2
# Macro assemble with libc written in M1-Macro

View File

@ -32,6 +32,7 @@ set -x
# Build debug footer
blood-elf --64 -f test/test0101/hex2_linker.M1 \
--entry _start \
-o test/test0101/hex2_linker-footer.M1 || exit 2
# Macro assemble with libc written in M1-Macro

View File

@ -32,6 +32,7 @@ set -x
# Build debug footer
blood-elf -f test/test0101/hex2_linker.M1 \
--entry _start \
-o test/test0101/hex2_linker-footer.M1 || exit 2
# Macro assemble with libc written in M1-Macro

View File

@ -32,6 +32,7 @@ set -x
# Build debug footer
blood-elf -f test/test0101/hex2_linker.M1 \
--entry _start \
-o test/test0101/hex2_linker-footer.M1 || exit 2
# Macro assemble with libc written in M1-Macro

View File

@ -34,6 +34,7 @@ set -x
# Build debug footer
blood-elf --64 -f test/test0102/M1-macro.M1 \
--entry _start \
-o test/test0102/M1-macro-footer.M1 || exit 2
# Macro assemble with libc written in M1-Macro

View File

@ -32,6 +32,7 @@ set -x
# Build debug footer
blood-elf --64 -f test/test0102/M1-macro.M1 \
--entry _start \
-o test/test0102/M1-macro-footer.M1 || exit 2
# Macro assemble with libc written in M1-Macro

View File

@ -32,6 +32,7 @@ set -x
# Build debug footer
blood-elf -f test/test0102/M1-macro.M1 \
--entry _start \
-o test/test0102/M1-macro-footer.M1 || exit 2
# Macro assemble with libc written in M1-Macro

View File

@ -32,6 +32,7 @@ set -x
# Build debug footer
blood-elf -f test/test0102/M1-macro.M1 \
--entry _start \
-o test/test0102/M1-macro-footer.M1 || exit 2
# Macro assemble with libc written in M1-Macro

View File

@ -32,6 +32,7 @@ set -x
# Build debug footer
blood-elf --64 -f test/test0103/get_machine.M1 \
--entry _start \
-o test/test0103/get_machine-footer.M1 || exit 2
# Macro assemble with libc written in M1-Macro

View File

@ -30,6 +30,7 @@ set -x
# Build debug footer
blood-elf --64 -f test/test0103/get_machine.M1 \
--entry _start \
-o test/test0103/get_machine-footer.M1 || exit 2
# Macro assemble with libc written in M1-Macro

View File

@ -30,6 +30,7 @@ set -x
# Build debug footer
blood-elf -f test/test0103/get_machine.M1 \
--entry _start \
-o test/test0103/get_machine-footer.M1 || exit 2
# Macro assemble with libc written in M1-Macro

View File

@ -30,6 +30,7 @@ set -x
# Build debug footer
blood-elf -f test/test0103/get_machine.M1 \
--entry _start \
-o test/test0103/get_machine-footer.M1 || exit 2
# Macro assemble with libc written in M1-Macro

View File

@ -35,6 +35,7 @@ set -x
# Build debug footer
blood-elf --64 -f test/test0104/kaem.M1 \
--entry _start \
-o test/test0104/kaem-footer.M1 || exit 2
# Macro assemble with libc written in M1-Macro

View File

@ -33,6 +33,7 @@ set -x
# Build debug footer
blood-elf --64 -f test/test0104/kaem.M1 \
--entry _start \
-o test/test0104/kaem-footer.M1 || exit 2
# Macro assemble with libc written in M1-Macro

View File

@ -33,6 +33,7 @@ set -x
# Build debug footer
blood-elf -f test/test0104/kaem.M1 \
--entry _start \
-o test/test0104/kaem-footer.M1 || exit 2
# Macro assemble with libc written in M1-Macro

View File

@ -33,6 +33,7 @@ set -x
# Build debug footer
blood-elf -f test/test0104/kaem.M1 \
--entry _start \
-o test/test0104/kaem-footer.M1 || exit 2
# Macro assemble with libc written in M1-Macro

View File

@ -37,6 +37,7 @@ set -x
# Build debug footer
blood-elf --64 -f test/test0105/lisp.M1 \
--entry _start \
-o test/test0105/lisp-footer.M1 || exit 2
# Macro assemble with libc written in M1-Macro

View File

@ -36,6 +36,7 @@ set -x
# Build debug footer
blood-elf --64 -f test/test0105/lisp.M1 \
--entry _start \
-o test/test0105/lisp-footer.M1 || exit 2
# Macro assemble with libc written in M1-Macro

View File

@ -36,6 +36,7 @@ set -x
# Build debug footer
blood-elf -f test/test0105/lisp.M1 \
--entry _start \
-o test/test0105/lisp-footer.M1 || exit 2
# Macro assemble with libc written in M1-Macro

View File

@ -36,6 +36,7 @@ set -x
# Build debug footer
blood-elf -f test/test0105/lisp.M1 \
--entry _start \
-o test/test0105/lisp-footer.M1 || exit 2
# Macro assemble with libc written in M1-Macro

View File

@ -41,6 +41,7 @@ set -ex
# Build debug footer
blood-elf --64 -f test/test1000/cc.M1 \
--entry _start \
-o test/test1000/cc-footer.M1 || exit 2
# Macro assemble with libc written in M1-Macro

View File

@ -40,6 +40,7 @@ set -ex
# Build debug footer
blood-elf --64 -f test/test1000/cc.M1 \
--entry _start \
-o test/test1000/cc-footer.M1 || exit 2
# Macro assemble with libc written in M1-Macro

View File

@ -40,6 +40,7 @@ set -ex
# Build debug footer
blood-elf -f test/test1000/cc.M1 \
--entry _start \
-o test/test1000/cc-footer.M1 || exit 2
# Macro assemble with libc written in M1-Macro

View File

@ -40,6 +40,7 @@ set -ex
# Build debug footer
blood-elf -f test/test1000/cc.M1 \
--entry _start \
-o test/test1000/cc-footer.M1 || exit 2
# Macro assemble with libc written in M1-Macro

View File

@ -1 +1 @@
426bf0ae687d48b630c265d562ff7e30b891a530dc53cd35e4641b78bdcd3a06 test/test1000/proof
15f5c4ccc437b217da2d0b1e26ff65379b656e8fde12f652da1d78606a9e54c5 test/test1000/proof