GAS Syntax & TSS

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
User avatar
Jeko
Member
Member
Posts: 500
Joined: Fri Mar 17, 2006 12:00 am
Location: Napoli, Italy

GAS Syntax & TSS

Post 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?
cyr1x
Member
Member
Posts: 207
Joined: Tue Aug 21, 2007 1:41 am
Location: Germany

Post by cyr1x »

Why not use just a struct?
This is easier to understand and more readable.
User avatar
Jeko
Member
Member
Posts: 500
Joined: Fri Mar 17, 2006 12:00 am
Location: Napoli, Italy

Post by Jeko »

cyr1x wrote:Why not use just a struct?
This is easier to understand and more readable.
Sorry, how?
User avatar
binutils
Member
Member
Posts: 214
Joined: Thu Apr 05, 2007 6:07 am

Post by binutils »

User avatar
Jeko
Member
Member
Posts: 500
Joined: Fri Mar 17, 2006 12:00 am
Location: Napoli, Italy

Post 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!
Post Reply