Help in building an 16 bit os

霸气de小男生 提交于 2019-12-04 14:10:06

If you're trying to make gcc generate 16-bit code, you need to use .code16gcc rather than .code16, in order to get the stack manipulation right for function parameters: see "Writing 16-bit Code" in the gas documentation.

(Also, depending on which gcc version you're using, you may need to compile your kernel.c with either the -fno-unit-at-a-time or -fno-toplevel-reorder option, to ensure that the asm() directive really is encountered by the assembler before any compiled code - otherwise the compiler may shuffle things around.)

I find another compiler to solve the problem: bcc

This is a C-compiler for 8086 cpus which is important for the development of boot loaders or BIOS related 8086 code.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!