{"action":"opened","issue":{"url":"https://api.github.com/repos/0xAX/linux-insides/issues/421","repository_url":"https://api.github.com/repos/0xAX/linux-insides","labels_url":"https://api.github.com/repos/0xAX/linux-insides/issues/421/labels{/name}","comments_url":"https://api.github.com/repos/0xAX/linux-insides/issues/421/comments","events_url":"https://api.github.com/repos/0xAX/linux-insides/issues/421/events","html_url":"https://github.com/0xAX/linux-insides/issues/421","id":173873730,"number":421,"title":"what is 64bit linux kernel entry point?","user":{"login":"nsun1","id":16262027,"avatar_url":"https://avatars.githubusercontent.com/u/16262027?v=3","gravatar_id":"","url":"https://api.github.com/users/nsun1","html_url":"https://github.com/nsun1","followers_url":"https://api.github.com/users/nsun1/followers","following_url":"https://api.github.com/users/nsun1/following{/other_user}","gists_url":"https://api.github.com/users/nsun1/gists{/gist_id}","starred_url":"https://api.github.com/users/nsun1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nsun1/subscriptions","organizations_url":"https://api.github.com/users/nsun1/orgs","repos_url":"https://api.github.com/users/nsun1/repos","events_url":"https://api.github.com/users/nsun1/events{/privacy}","received_events_url":"https://api.github.com/users/nsun1/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-08-29T21:11:43Z","updated_at":"2016-08-29T21:11:43Z","closed_at":null,"body":"I have prepared boot_params structures and loaded the pretect mode portion of 64 bit kernel in physical memory @0x1000000, when I  jumped to the kernel,  the machine reset, here is my code:\r\ncan you tell what is wrong here?  thanks a lot!\r\n\r\n/* jump to protected-mode code of kernel */\r\nBOOLEAN JumpLinuxImage(void *entryPoint)\r\n{\r\n#define __BOOT_CS    0x10\r\n#define __BOOT_DS    0x18\r\n    static const UINT64 gdt_table[] __attribute__ ((aligned(16))) = {\r\n        0,\r\n        0,\r\n       /* 0x00c09b000000ffff,      cs: executed/read, accessed */\r\n        0x00a09b000000ffff,     /* cs: ia32e l:1;d:0 */\r\n       /* 0x00c093000000ffff       ds: read/write, accessed */\r\n        0x00a093000000ffff      /* ds * ia32e l:1;d:0 */\r\n    };\r\n    /* both 4G flat, CS: execute and read, DS: read/write */\r\n\r\n    static struct __packed {\r\n        UINT16  length;\r\n        UINT64  table;\r\n    } gdt_desc;\r\n\r\n    gdt_desc.length = sizeof(gdt_table) - 1;\r\n    gdt_desc.table = (UINT64)&gdt_table;\r\n\r\n    /* load gdt with CS = 0x10 and DS = 0x18 */\r\n    __asm__ __volatile__ (\r\n     //\" lgdtl %0;            \"\r\n     \" lgdtq %0;            \"\r\n     \" mov %1,    %%ecx;       \"\r\n     \" mov %%ecx, %%ds;     \"\r\n     \" mov %%ecx, %%es;     \"\r\n     \" mov %%ecx, %%fs;     \"\r\n     \" mov %%ecx, %%gs;     \"\r\n     \" mov %%ecx, %%ss;     \"\r\n     //\" ljmp %2, $(1f);    \"\r\n     \" mov %2,    %%ecx;    \"\r\n     \" mov %%ecx, %%cs;     \"\r\n     \" jmp 1f;      \"\r\n     \" 1:                   \"\r\n     \" xor %%ebp, %%ebp;    \"\r\n     \" xor %%edi, %%edi;    \"\r\n     \" xor %%ebx, %%ebx;    \"\r\n     :: \"m\"(gdt_desc), \"i\"(__BOOT_DS), \"i\"(__BOOT_CS));\r\n\r\n    /* jump to protected-mode code */\r\n    __asm__ __volatile__ (\r\n     \" cli;           \"\r\n     //\" mov %0, %%esi; \"    /* esi holds address of boot_params */\r\n     \" mov %0, %%rsi; \"    /* esi holds address of boot_params */\r\n     //\" jmp *%%edx;    \"\r\n     \" jmpq *%%rdx;    \"\r\n     \" ud2;           \"\r\n     :: \"a\"(bootParams), \"d\"(entryPoint));\r\n\r\n    return TRUE;\r\n}\r\n"}}
{"actor":{"display_login":"nsun1"}}