![]() |
|
[Assembly] BIOS 16 bit to 32 bit - Printable Version +- Hack Forums (https://hackforums.net) +-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444) +--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151) +---- Forum: Coders Lounge (https://hackforums.net/forumdisplay.php?fid=5) +---- Thread: [Assembly] BIOS 16 bit to 32 bit (/showthread.php?tid=2459280) |
BIOS 16 bit to 32 bit - bytekill - May 2, 2012 Hi. I'm working on a small operating system, my problem is that my OS only works whit 16 bit code and not registers that are 32 bit (like eax, ebx...). I made up a pretty good boot loader in 16 bit that loads my kernel. I want my kernel to change from "Real mode" to "Protected mode". So I search for it and found this code: Code mov ax, cr0 ; Moves the valuekernel.asm:59: error: invalid combination of opcode and operands kernel.asm:61: error: invalid combination of opcode and operands thanks in advance. * - MUT4NT - May 3, 2012 so: mov ax, [cr0] or ax, 1 mov [cr0], ax in real-address mode, it work with immediate values, you are confused. and yes,it is possible work with 32-bit registers in real-address mode but all depends the situation * - DexHacker - May 20, 2012 I would advise you to switch to Fasm and before people jump on my back, there are reasons. First fasm assembler was made to write a OS, so has many cool things to help you. Second it very easy to port to your OS (let than half hour, once you have the right function)' To port nasm you would need to port gcc. If your going to switch to C code after booting, then stick with nasm. * - Hostwinds - Jun 13, 2012 Bytekill, Check out http://forum.osdev.org/ there are many good OS devs there as well as a wealth of knowledge in their wiki. Goodluck! |