From owner-freebsd-hackers Fri Jul 20 20:54:44 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from hotmail.com (f25.pav2.hotmail.com [64.4.37.25]) by hub.freebsd.org (Postfix) with ESMTP id CADC737B408 for ; Fri, 20 Jul 2001 20:54:33 -0700 (PDT) (envelope-from weiguang_shi@hotmail.com) Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Fri, 20 Jul 2001 20:54:33 -0700 Received: from 129.128.29.150 by pv2fd.pav2.hotmail.msn.com with HTTP; Sat, 21 Jul 2001 03:54:32 GMT X-Originating-IP: [129.128.29.150] From: "Weiguang SHI" To: freebsd-hackers@freebsd.org Subject: jmp after setting PE? Date: Fri, 20 Jul 2001 21:54:32 -0600 Mime-Version: 1.0 Content-Type: text/plain; format=flowed Message-ID: X-OriginalArrivalTime: 21 Jul 2001 03:54:33.0113 (UTC) FILETIME=[D9E02090:01C11198] Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Hi, Please forgive me if this seems too easy. "http://people.freebsd.org/~jhb/386htm/s10_03.htm" says: Immediately after setting the PE flag, the initialization code must flush the processor's instruction prefetch queue by executing a JMP instruction. The 80386 fetches and decodes instructions and addresses before they are used; however, after a change into protected mode, the prefetched instruction information (which pertains to real-address mode) is no longer valid. A JMP forces the processor to discard the invalid information. "/home/src/sys/i386/i386" says: 329 /* Now enable paging */ 330 movl R(_IdlePTD), %eax 331 movl %eax,%cr3 /* load ptd addr into mm 332 movl %cr0,%eax /* get control word */ 333 orl $CR0_PE|CR0_PG,%eax /* enable paging */ 334 movl %eax,%cr0 /* and let's page NOW! * 335 336 #ifdef BDE_DEBUGGER 337 /* 338 * Complete the adjustments for paging so that we can keep tracing throu 339 * initi386() after the low (physical) addresses for the gdt and idt bec 340 * invalid. 341 */ 342 call bdb_commit_paging 343 #endif 344 345 pushl $begin /* jump to high virtuali 346 ret My question is "where is the "jmp" instruction which is supposed to immediately follow the instruction setting PE? Or do I miss anything? Thanks Weiguang PS. I am looking at 4.3 stable. _________________________________________________________________ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message