;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; RDOS operating system
; Copyright (C) 1988-2000, Leif Ekblad
;
; This program is free software; you can redistribute it and/or modify
; it under the terms of the GNU General Public License as published by
; the Free Software Foundation; either version 2 of the License, or
; (at your option) any later version. The only exception to this rule
; is for commercial usage in embedded systems. For information on
; usage in commercial embedded systems, contact embedded@rdos.net
;
; This program is distributed in the hope that it will be useful,
; but WITHOUT ANY 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
;
; The author of this program may be contacted at leif@rdos.net
;
; PROTSEG.DEF
; GDT selectors and linear address space definitions
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;
; GDT selectors
;

;
; do not change order for this, used in boot loader
;
idt_sel				EQU 8
gdt_sel				EQU 10h
device_code_sel		EQU 18h
flat_sel			EQU 20h

system_data_sel		EQU 28h
kernel_code			EQU 30h
;
shutdown_code_sel		EQU 38h
shutdown_pretask_gate	EQU 40h
shutdown_task_gate		EQU 48h

;
; used in kernel and device-drivers only
;
sys_dir_sel			EQU 50h
sys_page_sel		EQU 58h
process_dir_sel		EQU 60h
process_page_sel	EQU 68h
;
process_sel			EQU 70h
phys_list_sel		EQU 78h
phys_page_sel		EQU 80h
temp_sel			EQU 88h
;
thread_sel			EQU 90h
thread_app_sel		EQU 98h
thread_tss_sel		EQU 0A0h
thread_ss0_sel		EQU 0A8h
;
mem_sel				EQU 0B0h
small_mem_sel		EQU 0B8h
local_mem_sel		EQU 0C0h
local_linear_sel	EQU 0C8h
;
dosb800				EQU 0D0h
bios_data			EQU 0D8h
proc_data_sel		EQU 0E0h
env_sel				EQU 0E8h
;
task_sel			EQU 0F0h
io_bitmap_sel		EQU 0F8h
;
event_def_sel		EQU 100h
event_list_sel		EQU 108h
;
hook_in_sel			EQU 110h
hook_out_sel		EQU 118h
;
osgate_sel			EQU 120h
usergate_sel		EQU 128h
virtgate_sel		EQU 130h
virt_thread_sel		EQU 138h
;
term_code_sel		EQU 14Bh
state_data_sel		EQU 150h
;
exec_sys_sel		EQU 160h
;
kernel_tss			EQU 178h
kernel_stack		EQU 188h
;
virt_tss			EQU 198h
;
flat_code_sel		EQU 1B3h
flat_data_sel		EQU 1BBh
;
virt_idt_sel		EQU 1C0h
default_reflect_sel	EQU 1CBh
locked_stack_sel	EQU 1D3h
kernel32_code		EQU 1D8h
int_data_sel		EQU 1E0h
def_exception_sel	EQU 1E8h
;
vm_linear_sel		EQU 1F0h
vm_int_sel			EQU 1F8h
thread_int_sel		EQU 200h
;
callb_exc16_sel		EQU 213h
callb_exc32_sel		EQU 21Bh
callb_int16_sel		EQU 223h
callb_int32_sel		EQU 22Bh
callb_vm16_sel		EQU 233h
callb_vm32_sel		EQU 23Bh
;
irq_sys_sel			EQU 240h
irq_proc_sel		EQU 248h

__0000				EQU 253h
__0040				EQU 25Bh
__B000				EQU 263h
__B800				EQU 26Bh
__F000				EQU 273h

app_data_sel		EQU 278h

__A000				EQU 283h
__C000				EQU 28Bh

handle_sel			EQU 290h
handle_mem_sel		EQU 298h
handle_data_sel		EQU 2A0h

;
os_begin_sel		EQU 1800h
user_begin_sel		EQU 2800h
mem_begin_sel		EQU 4800h

gdt_size			EQU 8000h

idt_size			EQU 800h
ldt_size			EQU 200h

k_data_size			EQU 2000h
l_stack_size		EQU 2000h
thread_data_size	EQU 0FFFFh

tss_size			EQU 400h
;
thread_seg_offs		EQU 0
thread_387_offs		EQU 80h
thread_tss_offs		EQU 400h
;
thread_size			EQU 800h

stack0_size			EQU 200h


;
; linear address space
;

video_local_linear		EQU 0000A0000h
ems_linear				EQU 0000D0000h
fixed_vm_linear			EQU 0000E0000h
vm_linear				EQU 0000E1000h

local_byte_linear		EQU 000110000h
local_page_linear		EQU 001000000h

flat_size				EQU 0E0000000h

system_mem_start		EQU 0E0000000h

global_byte_linear		EQU 0E0000000h
global_byte_size		EQU 008000000h

global_page_linear		EQU 0E8000000h
global_page_size		EQU 014000000h

handle_linear			EQU 0FC000000h
fixed_process_linear	EQU 0FC010000h

io_focus_linear			EQU 0FC400000h
video_mem_focus_linear	EQU 0FC600000h

io_local_linear			EQU 0FC800000h
video_mem_local_linear	EQU 0FCA00000h

alias_linear			EQU 0FCC00000h

sys_page_linear			EQU 0FD000000h
process_page_linear		EQU 0FD400000h

phys_list_linear		EQU 0FD800000h
phys_page_linear		EQU 0FDC00000h

video_focus_linear		EQU 0FE000000h

thread_block_linear		EQU 0FE020000h
thread_data_linear		EQU 0FE020100h
thread_tss_linear		EQU 0FE020200h
thread_ss0_linear		EQU 0FE020600h
thread_linear			EQU 0FE020800h

app_linear				EQU 0FE021000h

page0_linear			EQU 0FE022000h
system_linear			EQU 0FE023000h
system_linear_size		EQU 000FDD000h

kernel_linear			EQU 0FF000000h
