Changeset 16

Show
Ignore:
Timestamp:
03/12/08 21:07:23 (6 months ago)
Author:
mwhitworth
Message:

Fix linker problem.

Location:
Whitix/trunk
Files:
7 modified

Legend:

Unmodified
Added
Removed
  • Whitix/trunk/Makefile

    r7 r16  
    1414export ARCH 
    1515 
     16# All directories that are to be built or cleaned. 
     17SUBDIRS = arch/$(ARCH) devices fs kernel lib memory video user 
     18 
    1619all: cd  
    1720        mkdir -p CdRoot CdRoot/Applications CdRoot/Devices CdRoot/Mount CdRoot/System CdRoot/System/Include CdRoot/System/Runtime 
    18         make -C user 
    1921        make -C user install 
    2022        mkisofs -o cd.iso -b Boot/isoboot -no-emul-boot -c Boot/boot.cat -boot-load-size 4 -boot-info-table -iso-level 3 -l CdRoot 
     
    3941        mkisofs -o cd.iso -b Boot/isoboot -no-emul-boot -c Boot/boot.cat -boot-load-size 4 -boot-info-table -iso-level 3 -l CdRoot 
    4042 
    41 kern: 
    42         make -C arch/$(ARCH) 
    43         make -C devices 
    44         make -C fs 
    45         make -C kernel 
    46         make -C lib 
    47         make -C video 
    48         make -C memory 
     43kern: subdirs 
    4944        ld -M -T link.ld arch/$(ARCH)/boot/*.o arch/$(ARCH)/lib/*.o arch/$(ARCH)/kernel/*.o arch/$(ARCH)/mm/*.o devices/*.o devices/storage/*.o devices/storage/ata/*.o kernel/*.o video/*.o fs/*.o fs/isofs/*.o fs/vfs/*.o fs/fat/*.o fs/ext3/*.o lib/*.o memory/*.o -o kern > kernel.txt 
    5045 
    51 .PHONY: clean 
     46subdirs: 
     47        for dir in $(SUBDIRS); do \ 
     48                $(MAKE) -C $$dir; \ 
     49        done; 
     50 
     51$(SUBDIRS): 
     52        $(MAKE) -C $@ 
     53 
     54.PHONY: subdirs $(SUBDIRS) 
     55 
    5256clean: 
    5357        make -C arch/$(ARCH) clean 
     
    7074        @echo "clean - remove all intermediate files" 
    7175        @echo "See the readme file for more help" 
     76 
     77# Phony targets. 
     78.PHONY: clean help cd 
  • Whitix/trunk/include/sys.h

    r9 r16  
    5757/* Memory calls */ 
    5858void* SysMoreCore(int len); 
    59 int SysMemoryMap(DWORD address,DWORD length,int protection,int fd,DWORD offset,int flags); 
     59int SysMemoryMap(DWORD address, DWORD length, int protection, int fd, DWORD offset, int flags); 
    6060int SysMemoryUnmap(DWORD address,DWORD length); 
    6161 
  • Whitix/trunk/kernel/main.c

    r9 r16  
    1616 * 
    1717 */ 
     18 
     19/* TODO: Fix cli(); hlt(); */ 
    1820 
    1921#include <console.h> 
  • Whitix/trunk/memory/mmap.c

    r11 r16  
    599599        }else if (!vNode) 
    600600        { 
    601                 int err=NameToVNode(&vNode,DEVICES_PATH "Zero",0); 
    602                 if (err) 
     601                /* Map to the zero file, so we can use the existing infrastructure. */ 
     602                if (NameToVNode(&vNode,DEVICES_PATH "Zero",0)) 
    603603                        return 0; 
    604604        } 
     
    762762                if (!(vNode=MMapGetVNode(fd))) 
    763763                        return 0; 
    764  
     764                         
    765765        return MMapDo(current,vNode,PAGE_ALIGN(address),PAGE_ALIGN_UP(length),protection,offset,flags); 
    766766} 
  • Whitix/trunk/user/libc/Makefile

    r7 r16  
    2626        make -C init clean 
    2727        make -C setjmp clean 
    28         rm *.so 
     28        rm *.so -f 
  • Whitix/trunk/user/linker/load_lib.c

    r9 r16  
    115115                                elfProt|=2; 
    116116 
    117                         if (loadAddr || !picLib) 
     117                        if (*loadAddr || !picLib) 
    118118                                mmapFlags|=_SYS_MMAP_FIXED; 
    119119 
     
    153153                                /* Zero out the bss. */ 
    154154                                if (PAGE_OFFSET(elfBss) > 0) 
    155                                 { 
    156                                         DWORD partSize=PAGE_OFFSET(pHeaders[i].memSize-pHeaders[i].fileSize); 
    157                                         link_memset((void*)(pHeaders[i].vAddr+pHeaders[i].fileSize), 0, partSize); 
    158                                 } 
     155                                        link_memset((void*)(pHeaders[i].vAddr+pHeaders[i].fileSize), 0, PAGE_OFFSET(pHeaders[i].memSize-pHeaders[i].fileSize)); 
    159156                        } 
    160157                } 
     
    251248        } 
    252249 
    253         DlCreateResolveEntry(name, pHeaders, fileHeader.phEntries, loadAddr, dynamicAddr, dynEntries); 
     250        entry=DlCreateResolveEntry(name, pHeaders, fileHeader.phEntries, loadAddr, dynamicAddr, dynEntries); 
    254251 
    255252        /* Initialize the global offset table (GOT) */