Messages in this thread | | | Date | Fri, 01 Oct 1999 16:16:28 -0400 (EDT) | From | afei@jhu ... | Subject | question about /usr/src/linux/arch/i386/boot/setup.S |
| |
Linux: 2.2.5-15 Dist: Redhat 6 File: /usr/src/linux/arch/i386/boot/setup.S
Hi, there: I am a beginer on linux kernel hacking. I am reading this setup.S code and was puzzled with the sequence: The kernel loader first switches from real mode into protected mode, and then moves the loader code from 0x100 to 0x1000. However, in the linux kernel hacker's guide, it is said the loader first moves itself from 0x10000 to 0x1000, and then switches into protected mode. http://kernelnotes.org/guides/KHG/HyperNews/get/tour/tour.html What I am missing here. I attached a piece of code from setup.S at the end of email in case you wanna take a look at it.
Fei Liu
starting from setup.S:447............. seg cs cmp realmode_swtch,#0 jz rmodeswtch_normal seg cs callf far * realmode_swtch jmp rmodeswtch_end rmodeswtch_normal: push cs call default_switch rmodeswtch_end:
! we get the code32 start address and modify the below 'jmpi' ! (loader may have changed it) seg cs mov eax,code32_start seg cs mov code32,eax
! Now we move the system to its rightful place ! ...but we check, if we have a big-kernel. ! in this case we *must* not move it ... seg cs test byte ptr loadflags,#LOADED_HIGH jz do_move0 ! we have a normal low loaded zImage ! we have a high loaded big kernel jmp end_move ! ... and we skip moving
do_move0:
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/
| |