Skip to content

Commit

Permalink
ELF Data tested OK
Browse files Browse the repository at this point in the history
  • Loading branch information
lupyuen committed Jan 31, 2024
1 parent c2f2e5b commit 704be7e
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions riscv_machine.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
#define _info(...) {} ////
// #define _info printf ////

#ifndef NOTUSED
#ifdef NOTUSED
uint8_t elf_data2[] = { ////
0x7F, 0x45, 0x4C, 0x46, 0x02, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x01, 0x00, 0xF3, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
Expand Down Expand Up @@ -1035,14 +1035,7 @@ static void copy_bios(RISCVMachine *s, const uint8_t *buf, int buf_len,
// Patch the ELF Data to a.out in Initial RAM Disk
uint64_t elf_addr = 0;
printf("elf_len=%d\n", elf_len);
for (int i = 0; i < elf_len; i++) {
printf("elf_data[%d]=0x%x\n", i, elf_data[i]);
if (elf_data[i] != elf_data2[i]) {
printf("*** elf_data2[%d]=0x%x\n", i, elf_data2[i]);
}
}
if (elf_len > 0) {
printf("memcmp=%d\n", memcmp(elf_data, elf_data2, elf_len)); ////
//// TODO: Fix the Image Size
for (int i = 0; i < 0xD61680; i++) {
const uint8_t pattern[] = { 0x22, 0x05, 0x69, 0x00 };
Expand Down

0 comments on commit 704be7e

Please sign in to comment.