⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 segment.c

📁 一款类linux的操作系统源码
💻 C
字号:
/*  *  Roadrunner/pk *    Copyright (C) 1989-2001  Cornfed Systems, Inc. * *  The Roadrunner/pk operating system is free software; you can *  redistribute and/or modify it under the terms of the GNU General *  Public License, version 2, as published by the Free Software *  Foundation. * *  This program is distributed in the hope that it will be useful, *  but WITHOUT WARRANTY; without even the implied warranty of *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the *  GNU General Public License for more details. * *  You should have received a copy of the GNU General Public *  License along with this program; if not, write to the Free *  Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, *  MA 02111-1307 USA * *  More information about the Roadrunner/pk operating system of *  which this file is a part is available on the World-Wide Web *  at: http://www.cornfed.com. * */#include <stdio.h>#include <string.h>#include <sys/config.h>#include <sys/segment.h>#include <sys/proc.h>#include <sys/selector.h>struct tss tsstab[PROCS];/*voidktssinit(tss_t tss, u_long kstk, size_t kstksize){    //2002年10月5日修改    tss->d0 = 0;    tss->d1 = 0;    tss->d2 = 0;    tss->d3 = 0;    tss->d4 = 0;    tss->d5 = 0;    tss->d6 = 0;    tss->d7 = 0;        tss->a0 = 0;    tss->a1 = 0;    tss->a2 = 0;    tss->a3 = 0;    tss->a4 = 0;    tss->a5 = 0;    tss->a6 = 0;    tss->pc = (u_long) proc_start;        tss->usp = 0;    tss->a7  = kstk + kstksize;    tss->ssp = kstk + kstksize;}*/voidtssinit(tss_t tss, u_long stk, size_t stksize){    //2002年10月5日修改    tss->ssp = stk + stksize - 4;}#if _DEBUG/*voiddumptss(tss_t tss){    kprintf("ss0 %04x  esp0 %08x\n", (u_int) tss->ss0, (u_int) tss->esp0);    kprintf("cr3 %08x  eip %08x  eflags %08x\n", (u_int) tss->cr3,	    (u_int) tss->eip, (u_int) tss->eflags);    kprintf("eax %08x  ebx %08x  ecx %08x  edx %08x\n",	    (u_int) tss->eax, (u_int) tss->ebx, (u_int) tss->ecx,	    (u_int) tss->edx);    kprintf("esi %08x  edi %08x  esp %08x  ebp %08x\n",	    (u_int) tss->esi, (u_int) tss->edi, (u_int) tss->esp,	    (u_int) tss->ebp);    kprintf("cs %04x  ss %04x  ds %04x  es %04x  fs %04x  gs %04x\n",	    (u_int) tss->cs, (u_int) tss->ss, (u_int) tss->ds,	    (u_int) tss->es, (u_int) tss->fs, (u_int) tss->gs);}*/#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -