Commit 564088da810384d869a65b7bcbca21dfabf3f2eb
- Diff rendering mode:
- inline
- side by side
kernel/fs/initrd.cc
(4 / 4)
|   | |||
| 55 | 55 | } tar_header; | |
| 56 | 56 | ||
| 57 | 57 | // Remember the address the initrd starts at | |
| 58 | u32int initrd_start; | ||
| 58 | uintptr initrd_start; | ||
| 59 | 59 | // Store the number of files in the archive | |
| 60 | 60 | u32int num_files; | |
| 61 | 61 | ||
| … | … | ||
| 151 | 151 | ||
| 152 | 152 | // Find the address of the initrd from the multiboot structure that GRUB gives | |
| 153 | 153 | // us, and then work out the number of files on it. | |
| 154 | u32int scan(struct multiboot * ptr) | ||
| 154 | uintptr scan(struct multiboot * ptr) | ||
| 155 | 155 | { | |
| 156 | 156 | num_files = 0; | |
| 157 | 157 | ||
| … | … | ||
| 164 | 164 | } | |
| 165 | 165 | ||
| 166 | 166 | // Get the ramdisk addres from the multiboot header | |
| 167 | size_t address = initrd_start = *((size_t *) ptr->mods_addr); | ||
| 167 | uintptr address = initrd_start = *((uintptr *) ptr->mods_addr); | ||
| 168 | 168 | tar_header * header = (tar_header *) address; | |
| 169 | 169 | ||
| 170 | 170 | // Ensure that this is a proper tar archive | |
| … | … | ||
| 204 | 204 | // Read a file from the initrd | |
| 205 | 205 | u32int read(fs::node * node, u32int offset, size_t size, u8int * buffer) | |
| 206 | 206 | { | |
| 207 | size_t address = initrd_start; | ||
| 207 | uintptr address = initrd_start; | ||
| 208 | 208 | u32int file_size; | |
| 209 | 209 | ||
| 210 | 210 | tar_header * header = (tar_header *) address; |
kernel/fs/initrd.h
(2 / 2)
|   | |||
| 24 | 24 | namespace initrd | |
| 25 | 25 | { | |
| 26 | 26 | // Set up the ramdisk and return its root node | |
| 27 | fs::node * initialise(u32int initrd_address); | ||
| 27 | fs::node * initialise(uintptr initrd_address); | ||
| 28 | 28 | ||
| 29 | 29 | // Scan the initrd to determine how many files it contains | |
| 30 | u32int scan(struct multiboot * ptr); | ||
| 30 | uintptr scan(struct multiboot * ptr); | ||
| 31 | 31 | } | |
| 32 | 32 | ||
| 33 | 33 | #endif |

