3 ms·
Yes, and here is an example: https://github.com/andrewrk/clashos/blob/91f45cff49128b3322f98cc78ed08df5bcec35cb/src/main.zig#L81 https://github.com/andrewrk/clas
by AndyKelley 7y ago
Yes, and here is an example: https://github.com/andrewrk/clashos/blob/91f45cff49128b3322f98cc78ed08df5bcec35cb/src/main.zig#L81 https://github.com/andrewrk/clashos/blob/91f45cff49128b3322f...
When the raspberry pi 3 hardware boots, it jumps to 0x0. So this is the part where the bootloader loads the new kernel image into memory... starting at address 0!
- __turbobrew__ 7y ago> @intToPtr([]allowzero const u8, 0 [0..@ptrToInt(&__end_init)] vs > (int*)0 They sure make you pay though the nose to cast in zig -- maybe a good thing?
- AnIdiotOnTheNet 7y agoZig's type system tries to be aware of what its pointing to. Is it an array of comptime known length? An array of unknown length? An array of runtime known length? or a single item? Is it mutable? What's its alignment requirement? etc. It even has a pointer type for "something that came from C, who the hell knows". There is an accepted proposal to have pointer types for null-terminated blocks of memory too. So when you create a pointer out of thin air, you have to inform the type system precisely what kind of pointer it is. That's why it is so much more gnarly than C, it wants you to be explicit.