It is mentioned in the document that nasm has 16-bit segment scalability when outputting elf target files (elf only has 32-bit and 64-bit formats as we all know ). I do not know whether the official statement is true or false. I have tried either of the following situations:
In 1-16-bit real-time mode, the kernel on the floppy disk is converted into a kernel by using int 13 H. load the elf file to the H address, find the elf entry address, and then jump in. The code execution is incorrect, input "u/10 entry" (the entry is calculated slowly during debugging). The command at the entrance is strange, similar to the command at the kernel. asm is different. I suspect that commands in the elf file cannot be executed in 16-bit real-world mode. Paste kernel. asm below:
Kernel. asmglobal _ start [section. data] db 0 [section. text] _ start: mov ah, 00001010 bmov al, 'y' mov bx, 2 * 8mov gs, bxmov [gs: 0], axjmp $
Scenario 2 -- modify the preceding kernel. asm: use [bits 16] to modify the. text Segment. Then, we first enter the 32-bit protection mode, and then LOAD the elf File LOAD segments at h to their respective locations (by program h
Specifies the vaddr In the eader). When jmp reaches the elf entry, the command execution will still fail. However, remove [bits 16] and re-compile it.
I will not explain the above two errors. I will look back later.