{"action":"opened","issue":{"url":"https://api.github.com/repos/0xAX/linux-insides/issues/307","labels_url":"https://api.github.com/repos/0xAX/linux-insides/issues/307/labels{/name}","comments_url":"https://api.github.com/repos/0xAX/linux-insides/issues/307/comments","events_url":"https://api.github.com/repos/0xAX/linux-insides/issues/307/events","html_url":"https://github.com/0xAX/linux-insides/issues/307","id":124048149,"number":307,"title":"阅读中遇到个问题，还望解答。","user":{"login":"Joinhack","id":1291945,"avatar_url":"https://avatars.githubusercontent.com/u/1291945?v=3","gravatar_id":"","url":"https://api.github.com/users/Joinhack","html_url":"https://github.com/Joinhack","followers_url":"https://api.github.com/users/Joinhack/followers","following_url":"https://api.github.com/users/Joinhack/following{/other_user}","gists_url":"https://api.github.com/users/Joinhack/gists{/gist_id}","starred_url":"https://api.github.com/users/Joinhack/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Joinhack/subscriptions","organizations_url":"https://api.github.com/users/Joinhack/orgs","repos_url":"https://api.github.com/users/Joinhack/repos","events_url":"https://api.github.com/users/Joinhack/events{/privacy}","received_events_url":"https://api.github.com/users/Joinhack/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-12-28T10:19:03Z","updated_at":"2015-12-28T10:19:03Z","closed_at":null,"body":"我在阅读https://0xax.gitbooks.io/linux-insides/content/Booting/linux-bootstrap-1.html， 做测试我使用install_gdt中使用的代码如下：\r\n\r\nvoid install_gdt() {\r\n\tstatic const u64 boot_gdt[] __attribute__((aligned(16))) = {\r\n\t\t0\r\n\t};\r\n\tstatic const struct gdt_ptr gdtptr = {\r\n\t\t.len = sizeof(boot_gdt),\r\n\t\t.ptr = (u32)boot_gdt\r\n\t};\r\n\tasm volatile (\"lgdtl %0\" : : \"m\"(gdtptr));\r\n}\r\n连接脚本如下：\r\nSECTIONS\r\n{\r\n\t. = 0;\r\n\t.text16 : {\r\n\t\t*(.text16)\r\n\t}\r\n\tc32_begin = .;\r\n\t.text32 : {\r\n\t\t*(.text32)\r\n\t}\r\n\t. = ALIGN(16);\r\n\t.rodata : { \r\n\t\t*(.rodata*) \r\n\t}\r\n\t.data : {\r\n\t\t*(.data)\r\n\t}\r\n\t.bss : {\r\n\t\t*(.bss)\r\n\t}\r\n\t/DISCARD/ : {\r\n\t\t*(.MIPS.options)\r\n\t\t*(.options)\r\n\t\t*(.pdr)\r\n\t\t*(.reginfo)\r\n\t\t*(.comment)\r\n\t\t*(.note)\r\n\t}\r\n}\r\n\r\n我的问题是 生成的代码 访问的是地址是从0x0开始链接的（这个当然是这么的因为\t. = 0;指定了）， 但是我看linux的kernel 也是这么的 不晓得它是怎么让链接出来的地址能够和内存对应。\r\n\r\nlinux的链接接本https://github.com/torvalds/linux/blob/097f70b3c4d84ffccca15195bdfde3a37c0a7c0f/arch/x86/boot/setup.ld\r\n"}}