* Carl-Daniel Hailfinger c-d.hailfinger.devel.2006@gmx.net [070828 01:54]:
What about creating directories for each payload so we can differentiate between multiple payloads (in the original sense)?
Yes, I would prefer something like that, too
normal/payload0/segment0 (33192 bytes, lzma compressed to 18088 bytes @0x38 load @0x100000, entry 0x105258) normal/payload0/segment1 (72 bytes, lzma compressed to 47 bytes @0x4718 load @0x1225a0, entry 0x105258) normal/payload1/segment0 (xxx bytes, lzma compressed to yyy bytes @0xfoo load @0xbar, entry 0xbaz)
Sounds reasonable and allows use of Uwe's multiple payloads in the same breath.
Maybe we should introduce a major/minor version in the LAR header? Or a different magic string for each revision?
I generally hate versions. Think features, not numbers. But since this is probably not doable without significant overhead, I'd just go with a normal version header that gets increased every time we change the format. No need for major, minor, subminor, ...
void *start; int len; u32 reallen;
- void * entry;
- void * loadaddress;
void *entry; void *loadaddress;
Not sure how these pointers sneaked in here. They do break portability and cross compilability. Compiling LinuxBIOS on a 64bit host without compiling lar 32bit is not possible with such things in the header.
I really don't like this.
#include <console.h>
+int (*pk)(int msg_level, const char *fmt, ...) = printk;
int main(void) {
- printk(BIOS_INFO, "RAM init code started.\n");
- printk(BIOS_INFO, "Nothing to do.\n");
pk(BIOS_INFO, "RAM init code started.\n");
pk(BIOS_INFO, "Nothing to do.\n");
return 0;
}
My eyes!
:-) This is not supposed to go into the repo like that, but it fixes an issue.
What was that linker auto rename trick that Marc mentioned recently?
INITRAM_OBJ = $(obj)/mainboard/$(MAINBOARDDIR)/initram.o +$(obj)/mainboard/$(MAINBOARDDIR)/initram.o: $(src)/mainboard/$(MAINBOARDDIR)/initram.c
- cc -c $(INITCFLAGS) -fPIE $(src)/mainboard/$(MAINBOARDDIR)/initram.c -o $(obj)/mainboard/$(MAINBOARDDIR)/initram.o
Rules per file are not exactly nice. Especially not when we start doing non-trivial initram sequences.
Let's do this instead:
INITRAM_OBJ = $(obj)/mainboard/$(MAINBOARDDIR)/PICOBJ/initram.o
and have a rule that handles all PICOBJ objects differently?
- $(Q)$(LD) -Ttext 0x80000 $(INITRAM_OBJ) \
--entry=main -o $(obj)/linuxbios.initram.o
- $(Q)$(LD) $(INITRAM_OBJ) \
$(Q)printf " OBJCOPY $(subst $(shell pwd)/,,$(@))\n" $(Q)$(OBJCOPY) -O binary $(obj)/linuxbios.initram.o \ $(obj)/linuxbios.initram--entry=main -R $(obj)/stage0.o -o $(obj)/linuxbios.initram.o
Could you explain that one?
Initram was changed to link statically against printf a while ago. For some reason this does not work because it craps out when jumping to the serial_tx_byte (?) function.
Instead we decided the code has to become position independent. This brings in another layer of problems we have to solve, like printk can't just be printk like that. And linking the code at 0x80000 as we did before creates a 4G file.
Stefan