📄 x0.s
字号:
/* Project: HARTIK 3.0 */
/* Description: Hard Real TIme Kernel for 386 & higher machines */
/* Author: Gerardo Lamastra */
/* Date: 9/5/96 */
/* Revision: 2.0 */
/* The first things to do when an X application starts : */
/* Set up segment registers & stack; then execute startup code */
/* When the application returns the gate-jmp make us return to */
/* RM through X interface! */
/* Use X standard GDT selectors */
#include "sel.h"
#ifndef __LINUX__
.extern __startup
.extern __stkbase
.extern __stktop
#else
.extern _startup
.extern _stkbase
.extern _stktop
#define __stkbase _stkbase
#define __stktop _stktop
#define __startup _startup
#endif
.data
base:
.space 8129,0
tos:
.text
.globl start
.globl _start
_start:
start: movw $(PM_APPLDATA_SEL),%ax
movw %ax,%ds
movw %ax,%es
movw %ax,%ss
movw $(X_FLATDATA_SEL),%ax
movw %ax,%fs
movl $tos,%esp
#ifdef __DEBUG__
/* A Brown o should appear... */
pushw %gs
movw $(X_VIDEO_SEL),%ax
movw %ax,%gs
movl $158,%edi
movb $'1',%gs:0(%edi)
incl %edi
movb $6,%gs:0(%edi)
popw %gs
#endif
movl $base,__stkbase
movl $tos,__stktop
cld
call __startup
.byte 0x0EA /* Direct gate jmp */
.long 0
.word X_RM_BACK_GATE
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -