my data segment is defined as follows:
Code: Select all
segdesc_t:[
((@text(@env("_KERNEL_SIZE"))) & %1111111111111111),
$ffff & KERNEL_BASE,
KERNEL_BASE >> 16,
%10010010,
(%1000000 | ((@text(@env("_KERNEL_SIZE"))) >> 16)),
KERNEL_BASE >> 24
]
Code: Select all
#print("kernel size ", @text(@env("_KERNEL_SIZE")))
#print("anded size ", ((@text(@env("_KERNEL_SIZE"))) & %1111111111111111))
#print("shifted size ", ((@text(@env("_KERNEL_SIZE"))) >> 16))
Code: Select all
kernel size 66048
anded size 512
shifted size 1
in my kernel, i try to access a variable at 0x10300 and get
Code: Select all
00057770481e[CPU0 ] read_virtual_dword_32(): segment limit violation
Code: Select all
00057770481e[CPU0 ] segment: 3
00057770481e[CPU0 ] offset: 0x10300, limit 0x10200
whats wrong about how i write my segment descriptor?