who can tell me hao to fix this.

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
quxuan
Posts: 4
Joined: Wed Mar 09, 2016 8:28 am
Libera.chat IRC: quxuan

who can tell me hao to fix this.

Post by quxuan »

102F8EA0-B73B-4DAB-A807-83F2E6FCB38E.jpg
the link script is:

Code: Select all

OUTPUT_ARCH(i386:x86-64)

ENTRY(_start)

KERN_LMA = 0x100000;
KERN_VMA = 0xFFFF800000000000;

PHDRS {
    boot PT_LOAD;
    text PT_LOAD;
    data PT_LOAD;
}

SECTIONS {
    . = KERN_LMA;
    kernel_start = .;

    .boot : AT(ADDR(.boot)) {
        *(.boot)
    } : boot

    . += KERN_VMA;
    . = ALIGN(4096);

    .text : AT(ADDR(.text) - KERN_VMA) {
        text = . - KERN_VMA;
        *(.text)
        *(.rodata*)
        . = ALIGN(4096);
    } : text

    .data : AT(ADDR(.data) - KERN_VMA) {
        data = . - KERN_VMA;
        *(.data)
        . = ALIGN(4096);
    } : data

    .ehframe : AT(ADDR(.ehframe) - KERN_VMA) {
        ehframe = . - KERN_VMA;
        *(.ehframe)
        . = ALIGN(4096);
    } : data

    .bss : AT(ADDR(.bss) - KERN_VMA) {
        bss = . - KERN_VMA;
        *(.bss)
        *(COMMON)
    } : data

    /* end of kernel :) */
    kernel_end = .;
    /DISCARD/ : {
        *(.comment)
    }
    /*. = ASSERT(end <= 0x400000, "linker.ld: Kernel too big!!!");*/
}

User avatar
osdever
Member
Member
Posts: 492
Joined: Fri Apr 03, 2015 9:41 am
Contact:

Re: who can tell me hao to fix this.

Post by osdever »

Sorry if I mistaked, but maybe GRUB can't load 64-bit binaries?
Developing U365.
Source:
only testing: http://gitlab.com/bps-projs/U365/tree/testing

OSDev newbies can copy any code from my repositories, just leave a notice that this code was written by U365 development team, not by you.
quxuan
Posts: 4
Joined: Wed Mar 09, 2016 8:28 am
Libera.chat IRC: quxuan

Re: who can tell me hao to fix this.

Post by quxuan »

catnikita255 wrote:Sorry if I mistaked, but maybe GRUB can't load 64-bit binaries?
I resolve it by chang the link script.
User avatar
osdever
Member
Member
Posts: 492
Joined: Fri Apr 03, 2015 9:41 am
Contact:

Re: who can tell me hao to fix this.

Post by osdever »

What do you did?
Developing U365.
Source:
only testing: http://gitlab.com/bps-projs/U365/tree/testing

OSDev newbies can copy any code from my repositories, just leave a notice that this code was written by U365 development team, not by you.
quxuan
Posts: 4
Joined: Wed Mar 09, 2016 8:28 am
Libera.chat IRC: quxuan

Re: who can tell me hao to fix this.

Post by quxuan »

catnikita255 wrote:What do you did?
only remove
PHDRS {
boot PT_LOAD;
text PT_LOAD;
data PT_LOAD;
}
and :boot :text :data for each section.
Post Reply