locore.s (4600) | locore.s (5603) |
---|---|
1/*- 2 * Copyright (c) 1990 The Regents of the University of California. 3 * All rights reserved. 4 * 5 * This code is derived from software contributed to Berkeley by 6 * William Jolitz. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 20 unchanged lines hidden (view full) --- 29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 30 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 31 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 32 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 33 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 34 * SUCH DAMAGE. 35 * 36 * from: @(#)locore.s 7.3 (Berkeley) 5/13/91 | 1/*- 2 * Copyright (c) 1990 The Regents of the University of California. 3 * All rights reserved. 4 * 5 * This code is derived from software contributed to Berkeley by 6 * William Jolitz. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 20 unchanged lines hidden (view full) --- 29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 30 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 31 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 32 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 33 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 34 * SUCH DAMAGE. 35 * 36 * from: @(#)locore.s 7.3 (Berkeley) 5/13/91 |
37 * $Id: locore.s,v 1.44 1994/11/06 22:18:45 phk Exp $ | 37 * $Id: locore.s,v 1.45 1994/11/18 05:27:34 phk Exp $ |
38 */ 39 40/* 41 * locore.s: FreeBSD machine support for the Intel 386 42 * originally from: locore.s, by William F. Jolitz 43 * 44 * Substantially rewritten by David Greenman, Rod Grimes, 45 * Bruce Evans, Wolfgang Solfrank, and many others. --- 125 unchanged lines hidden (view full) --- 171 .org 0x500 /* space for BIOS variables */ 172 1731: 174 /* Set up a real frame, some day we will be doing returns */ 175 pushl %ebp 176 movl %esp, %ebp 177 178 /* Don't trust what the BIOS gives for eflags. */ | 38 */ 39 40/* 41 * locore.s: FreeBSD machine support for the Intel 386 42 * originally from: locore.s, by William F. Jolitz 43 * 44 * Substantially rewritten by David Greenman, Rod Grimes, 45 * Bruce Evans, Wolfgang Solfrank, and many others. --- 125 unchanged lines hidden (view full) --- 171 .org 0x500 /* space for BIOS variables */ 172 1731: 174 /* Set up a real frame, some day we will be doing returns */ 175 pushl %ebp 176 movl %esp, %ebp 177 178 /* Don't trust what the BIOS gives for eflags. */ |
179 pushl $PSL_MBO | 179 pushl $PSL_KERNEL |
180 popfl 181 182 /* Don't trust what the BIOS gives for %fs and %gs. */ 183 mov %ds, %ax 184 mov %ax, %fs 185 mov %ax, %gs 186 187 /* --- 571 unchanged lines hidden (view full) --- 759 call _init386 /* wire 386 chip for unix operation */ 760 popl %esi 761 762 .globl __ucodesel,__udatasel 763 764 pushl $0 /* unused */ 765 pushl __udatasel /* ss */ 766 pushl $0 /* esp - filled in by execve() */ | 180 popfl 181 182 /* Don't trust what the BIOS gives for %fs and %gs. */ 183 mov %ds, %ax 184 mov %ax, %fs 185 mov %ax, %gs 186 187 /* --- 571 unchanged lines hidden (view full) --- 759 call _init386 /* wire 386 chip for unix operation */ 760 popl %esi 761 762 .globl __ucodesel,__udatasel 763 764 pushl $0 /* unused */ 765 pushl __udatasel /* ss */ 766 pushl $0 /* esp - filled in by execve() */ |
767 pushl $PSL_USERSET /* eflags (ring 0, int enab) */ | 767 pushl $PSL_USER /* eflags (IOPL 0, int enab) */ |
768 pushl __ucodesel /* cs */ 769 pushl $0 /* eip - filled in by execve() */ 770 subl $(12*4),%esp /* space for rest of registers */ 771 772 pushl %esp /* call main with frame pointer */ 773 call _main /* autoconfiguration, mountroot etc */ 774 775 addl $(13*4),%esp /* back to a frame we can return with */ 776 777 /* 778 * now we've run main() and determined what cpu-type we are, we can | 768 pushl __ucodesel /* cs */ 769 pushl $0 /* eip - filled in by execve() */ 770 subl $(12*4),%esp /* space for rest of registers */ 771 772 pushl %esp /* call main with frame pointer */ 773 call _main /* autoconfiguration, mountroot etc */ 774 775 addl $(13*4),%esp /* back to a frame we can return with */ 776 777 /* 778 * now we've run main() and determined what cpu-type we are, we can |
779 * enable WP mode on i486 cpus and above. | 779 * enable write protection and alignment checking on i486 cpus and 780 * above. |
780 */ 781#if defined(I486_CPU) || defined(I586_CPU) 782 cmpl $CPUCLASS_386,_cpu_class 783 je 1f 784 movl %cr0,%eax /* get control word */ | 781 */ 782#if defined(I486_CPU) || defined(I586_CPU) 783 cmpl $CPUCLASS_386,_cpu_class 784 je 1f 785 movl %cr0,%eax /* get control word */ |
785 orl $CR0_WP,%eax /* enable write protect for all modes */ | 786 orl $CR0_WP|CR0_AM,%eax /* enable i486 features */ |
786 movl %eax,%cr0 /* and do it */ 787#endif 788 /* 789 * on return from main(), we are process 1 790 * set up address space and stack so that we can 'return' to user mode 791 */ 7921: 793 movl __ucodesel,%eax --- 23 unchanged lines hidden --- | 787 movl %eax,%cr0 /* and do it */ 788#endif 789 /* 790 * on return from main(), we are process 1 791 * set up address space and stack so that we can 'return' to user mode 792 */ 7931: 794 movl __ucodesel,%eax --- 23 unchanged lines hidden --- |