FIX: userspace should write entire buffer.

Huge oversight... Next is to try to regenerate the results, etc.
This commit is contained in:
Zhengyi Chen 2024-02-23 17:20:57 +00:00
parent 552d6f9b73
commit b35344be26
2 changed files with 6 additions and 2 deletions

View file

@ -59,9 +59,13 @@ int main(int argc, char *argv[])
}
// Write to mmap-ed device
char *curr_buf = buf;
char to_write[4] = {0xca, 0xfe, 0xbe, 0xef};
for (size_t byte_offset = 0; byte_offset < WRITE_AMNT; byte_offset += 4)
memcpy(buf, to_write, 4);
while (curr_buf < (char *)buf + WRITE_AMNT) {
// eprintf("Writing to %p.\n", curr_buf);
memcpy(curr_buf, to_write, 4);
curr_buf += 4;
}
// Unmap device
munmap(buf, WRITE_AMNT);

Binary file not shown.