Page 1 of 1

GAS Syntax & TSS

Posted: Fri Mar 21, 2008 1:32 pm
by Jeko
I want to init a tss using GAS assembly.
This is my code:

Code: Select all

arch_tss:
	.fill 104
tss_end:

; // Kernel TSS descriptor 0x28
.word ((tss_end - arch_tss - 1) & 0xFFFF)               ; // Limit 15:0
.word (arch_tss & 0xFFFF)                                    ; // Base 15:0
.byte ((arch_tss >> 16) & 0xFF)                            ; // Base 23:16
.byte 0x89
.byte ( ((tss_end - arch_tss - 1) >> 16) & 0xF )      ; // Limit
.byte ((arch_tss >> 24) & 0xFF)                            ; // Base 31:24
But there are some errors:
boot/start.S: Assembler messages:
boot/start.S:286: Error: invalid sections for operation on `arch_tss' and `L0'
boot/start.S:287: Error: invalid sections for operation on `arch_tss' and `L0'
boot/start.S:290: Error: invalid sections for operation on `arch_tss' and `L0'

I noticed that errors are in lines where I use only arch_tss without tss_end - arch_tss - 1, but I need to use only arch_tss!
How can I resolve these errors?

Posted: Fri Mar 21, 2008 1:43 pm
by cyr1x
Why not use just a struct?
This is easier to understand and more readable.

Posted: Fri Mar 21, 2008 1:52 pm
by Jeko
cyr1x wrote:Why not use just a struct?
This is easier to understand and more readable.
Sorry, how?

Posted: Sun Mar 23, 2008 4:08 pm
by binutils

Posted: Mon Mar 24, 2008 3:17 am
by Jeko
binutils wrote:http://www.osdev.org/phpBB2/viewtopic.php?p=117870#117870

look libosdk-0.2.0/i386/tss.s

HTH
thank you very much!