- Timestamp:
- 2008-11-11T08:00:42Z (17 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- f3c4a26
- Parents:
- a2a5529
- Location:
- boot/arch/ia64/loader
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
boot/arch/ia64/loader/Makefile
ra2a5529 r59e4864 89 89 90 90 COMPONENTS = \ 91 $(KERNELDIR)/kernel.bin 92 NOCOMPONENTS = \ 91 93 $(KERNELDIR)/kernel.bin \ 92 94 $(USPACEDIR)/srv/ns/ns \ -
boot/arch/ia64/loader/asm.S
ra2a5529 r59e4864 38 38 movl r8 = 0x4404000;; 39 39 mov b1 = r8 ;; 40 mov r1 = in0; 40 mov r1 = in0; #Save bootinfo prt 41 41 br.call.sptk.many b0 = b1;; 42 .global ofw43 ofw: -
boot/arch/ia64/loader/boot.S
ra2a5529 r59e4864 35 35 start: 36 36 37 37 38 mov ar.rsc = r0 38 39 # movl r8 = (VRN_KERNEL << VRN_SHIFT) ;; … … 58 59 br.call.sptk.many b0 = b1 59 60 61 .align 512 62 ap_start: 63 64 65 ap_loop: 66 movl r18=0x4405000;; 67 mov b1 = r18 ;; 68 br.call.sptk.many b0 = b1;; 69 70 .align 1024 71 72 .align 4096 73 .global binfo 74 binfo: 75 76 60 77 .bss #on this line is ".bss", it cannot be seen in my mcedit :-( 61 78 -
boot/arch/ia64/loader/gefi/HelenOS/Makefile
ra2a5529 r59e4864 29 29 LDSCRIPT = ../gnuefi/elf_$(ARCH)_efi.lds 30 30 LDFLAGS += -T $(LDSCRIPT) -shared -Bsymbolic -L../lib -L../gnuefi $(CRTOBJS) 31 LOADLIBES = -lefi -lgnuefi 31 LOADLIBES = -lefi -lgnuefi $(shell $(CC) -print-libgcc-file-name) 32 32 FORMAT = efi-app-$(ARCH) 33 33 … … 46 46 $(OBJDUMP) -d hello.efi > hello.disass 47 47 48 hello.so: hello.o image.o 49 $(LD) $(LDFLAGS) -Map hello.map hello.o -o hello.so $(LOADLIBES) 48 #When selected first lines or second lines, select if image is linked into hello or not - usefull for network boot 49 #hello.so: hello.o image.o 50 hello.so: hello.o 51 # $(LD) $(LDFLAGS) -Map hello.map hello.o image.o -o hello.so $(LOADLIBES) #link image inside hello 52 $(LD) $(LDFLAGS) -Map hello.map hello.o -o hello.so $(LOADLIBES) #dont link image inside hello 50 53 51 54 hello.o: hello.c 52 55 $(CC) $(INCDIR) $(CFLAGS) $(CPPFLAGS) -c hello.c -o hello.o 53 56 54 image.o: ../../image.boot 57 image.o: ../../image.boot mkimage 55 58 $(OBJCOPY) -O binary ../../image.boot image.bin 56 $(OBJCOPY) -I binary -O elf64-ia64-little -B ia64 image.bin image.o 59 ./mkimage 60 $(CC) $(INCDIR) $(CFLAGS) $(CPPFLAGS) -c image.c -o image.o 61 # $(OBJCOPY) -I binary -O elf64-ia64-little -B ia64 image.bin image.o 62 63 mkimage: mkimage.c 64 gcc -o mkimage mkimage.c 57 65 58 66 -
boot/arch/ia64/loader/gefi/HelenOS/hello.c
ra2a5529 r59e4864 2 2 #include <efilib.h> 3 3 4 #include <../../../../../../kernel/arch/ia64/include/bootinfo.h> 5 4 6 #define KERNEL_LOAD_ADDRESS 0x4400000 7 8 //Link image as a data array into hello - usefull with network boot 9 //#define IMAGE_LINKED 10 11 bootinfo_t *bootinfo=(bootinfo_t *)BOOTINFO_ADDRESS; 12 13 14 #ifdef IMAGE_LINKED 15 extern char HOSimage[]; 16 extern int HOSimagesize; 17 #endif 18 5 19 6 20 … … 16 30 return mem; 17 31 } 18 char HEX[256];19 20 char hexs[]="0123456789ABCDEF";21 /*22 void to_hex(unsigned long long num)23 {24 int a;25 for(a=15;a>=0;a--)26 {27 char c=num - (num & 0xfffffffffffffff0LL);28 num/=16;29 c=hexs[c];30 HEX[a]=c;31 }32 33 }34 */35 32 36 33 EFI_STATUS … … 73 70 74 71 BS->HandleProtocol(LoadedImage->DeviceHandle, &FileSystemProtocol, &Vol); 75 Vol->OpenVolume (Vol, &CurDir);76 72 77 73 char FileName[1024]; 78 74 char *OsKernelBuffer; 79 75 int i; 76 int defaultLoad; 77 int imageLoad; 80 78 UINTN Size; 81 79 … … 98 96 while(LoadOptions[i]==L' ') if(LoadOptions[i++]==0) break; 99 97 100 if(LoadOptions[i++]==0) 98 if(LoadOptions[i++]==0){ 101 99 StrCat(FileName,L"\\image.bin"); 100 defaultLoad=1; 101 } 102 102 else{ 103 103 CHAR16 buf[1024]; … … 109 109 buf[j+1]=0; 110 110 StrCat(FileName,buf); 111 } 112 113 //Print(L"%s\n",FileName); 114 115 EFI_STATUS stat; 116 stat=CurDir->Open(CurDir, &FileHandle, FileName, EFI_FILE_MODE_READ, 0); 117 if(EFI_ERROR(stat)){ 118 Print(L"Error Opening Image %s\n",FileName); 119 return 0; 111 defaultLoad=0; 112 } 113 114 imageLoad=1; 115 #ifdef IMAGE_LINKED 116 if(defaultLoad) { 117 Print(L"Using Linked Image\n"); 118 imageLoad=0; 120 119 } 121 Size = 0x00400000; 122 BS->AllocatePool(EfiLoaderData, Size, &OsKernelBuffer); 123 FileHandle->Read(FileHandle, &Size, OsKernelBuffer); 124 FileHandle->Close(FileHandle); 125 126 if(Size<1) return 0; 127 128 129 char * HOS = OsKernelBuffer; 120 #endif 121 122 123 char * HOS; 124 if(imageLoad) 125 { 126 Size = 0x00400000; 127 128 Vol->OpenVolume (Vol, &CurDir); 129 130 EFI_STATUS stat; 131 stat=CurDir->Open(CurDir, &FileHandle, FileName, EFI_FILE_MODE_READ, 0); 132 if(EFI_ERROR(stat)){ 133 Print(L"Error Opening Image %s\n",FileName); 134 return 0; 135 } 136 BS->AllocatePool(EfiLoaderData, Size, &OsKernelBuffer); 137 FileHandle->Read(FileHandle, &Size, OsKernelBuffer); 138 FileHandle->Close(FileHandle); 139 HOS = OsKernelBuffer; 140 if(Size<1) return 0; 141 142 } 143 #ifdef IMAGE_LINKED 144 else { 145 HOS = HOSimage; 146 Size = HOSimagesize; 147 Print(L"Image start %llX\n",(long long)HOS); 148 Print(L"Image size %llX\n",(long long)Size); 149 Print(L"Image &size %llX\n",(long long)&Size); 150 } 151 #endif 130 152 int HOSSize = Size; 153 154 155 rArg rSAL; 156 //Setup AP's wake up address 157 158 LibSalProc(0x01000000,2,0x4400200,0,0,0,0,0,&rSAL); 159 160 161 UINT64 sapic; 162 LibGetSalIpiBlock(&sapic); 163 Print (L"SAPIC:%X\n", sapic); 164 bootinfo->sapic=sapic; 165 166 167 int wakeup_intno; 168 wakeup_intno=0xf0; 169 Print (L"WAKEUP INTNO:%X\n", wakeup_intno); 170 bootinfo->wakeup_intno=wakeup_intno; 171 172 173 131 174 132 175 … … 168 211 ((char *)(0x4400000))[a]=HOS[a]; 169 212 } 213 bootinfo->sapic=(unsigned long *)sapic; 214 bootinfo->wakeup_intno=wakeup_intno; 170 215 171 216 //Run Kernel … … 178 223 179 224 180 while(1){ 181 ((volatile int *)(0x80000000000b8000))[0]++; 182 } 225 //Not reached 183 226 return EFI_SUCCESS; 184 227 } -
boot/arch/ia64/loader/gefi/apps/Makefile
ra2a5529 r59e4864 29 29 LDSCRIPT = ../gnuefi/elf_$(ARCH)_efi.lds 30 30 LDFLAGS += -T $(LDSCRIPT) -shared -Bsymbolic -L../lib -L../gnuefi $(CRTOBJS) 31 LOADLIBES = -lefi -lgnuefi 31 LOADLIBES = -lefi -lgnuefi $(shell $(CC) -print-libgcc-file-name) 32 32 FORMAT = efi-app-$(ARCH) 33 33 -
boot/arch/ia64/loader/main.c
ra2a5529 r59e4864 35 35 #include <balloc.h> 36 36 37 bootinfo_t bootinfo;37 extern bootinfo_t binfo; 38 38 component_t components[COMPONENTS]; 39 39 … … 70 70 71 71 72 bootinfo_t *bootinfo=&binfo; 73 72 74 //for(ii=0;ii<KERNEL_SIZE;ii++) ((char *)(0x100000))[ii] = ((char *)KERNEL_START)[ii+1]; 73 75 … … 93 95 94 96 95 bootinfo .taskmap.count = 0;97 bootinfo->taskmap.count = 0; 96 98 for (i = 0; i < COMPONENTS; i++) { 97 99 98 100 if (i > 0) { 99 bootinfo .taskmap.tasks[bootinfo.taskmap.count].addr = components[i].start;100 bootinfo .taskmap.tasks[bootinfo.taskmap.count].size = components[i].size;101 bootinfo .taskmap.count++;101 bootinfo->taskmap.tasks[bootinfo->taskmap.count].addr = components[i].start; 102 bootinfo->taskmap.tasks[bootinfo->taskmap.count].size = components[i].size; 103 bootinfo->taskmap.count++; 102 104 } 103 105 } 104 106 105 106 jump_to_kernel(&bootinfo); 107 jump_to_kernel(bootinfo); 107 108 108 109 -
boot/arch/ia64/loader/main.h
ra2a5529 r59e4864 30 30 #define BOOT_ia64_MAIN_H_ 31 31 32 #include <ofw.h>33 #include <ofw_tree.h>34 32 #include <types.h> 33 #include <../../../../kernel/arch/ia64/include/bootinfo.h> 35 34 36 35 37 36 #define CONFIG_INIT_TASKS 32 38 37 39 typedef struct {40 void *addr;41 size_t size;42 } init_task_t;43 44 typedef struct {45 count_t count;46 init_task_t tasks[CONFIG_INIT_TASKS];47 } init_t;48 38 49 typedef struct {50 init_t taskmap;51 } bootinfo_t;52 53 extern bootinfo_t bootinfo;54 39 55 40 extern void start(void);
Note:
See TracChangeset
for help on using the changeset viewer.