All about the OSDev Wiki. Discussions about the organization and general structure of articles and how to use the wiki. Request changes here if you don't know how to use the wiki.
Alboin
Member
Posts: 1466 Joined: Thu Jan 04, 2007 3:29 pm
Location: Noricum and Pannonia
Post
by Alboin » Sat Jun 07, 2008 7:40 pm
In the wiki, there is code such as:
However, has anyone noticed that with -O2 optimizations (gcc-4.1.2), it yields:
Code: Select all
error: invalid 'asm': invalid expression as operand
Should we make note of this on the wiki? Fix?
C8H10N4O2 | #446691 | Trust the nodes.
Brynet-Inc
Member
Posts: 2426 Joined: Tue Oct 17, 2006 9:29 pm
Libera.chat IRC: brynet
Location: Canada
Contact:
Post
by Brynet-Inc » Sat Jun 07, 2008 8:19 pm
My solution?
-asm ("lidt (%0)": :"p" (&IDTR));
+asm ("lidt (%0)": :"r" (&IDTR));
Just an idea, seems to work with optimizations..
Twitter: @canadianbryan . Award by smcerm, I stole it. Original was larger.
thepowersgang
Member
Posts: 734 Joined: Tue Dec 25, 2007 6:03 am
Libera.chat IRC: thePowersGang
Location: Perth, Western Australia
Contact:
Post
by thepowersgang » Sat Jun 21, 2008 12:01 am
I normally use __asm__ __volatile__ (...) for inline asm. It may be that -O2 removes the use of asm(...)
lukem95
Member
Posts: 536 Joined: Fri Aug 03, 2007 6:03 am
Location: Cambridge, UK
Post
by lukem95 » Sat Jun 21, 2008 9:00 am
it depends on your compiler i think, DJGPP uses __asm__ __volatile__ ...
~ Lukem95 [
Cake ]
Release:
0.08b
suthers
Member
Posts: 672 Joined: Tue Feb 20, 2007 3:00 pm
Location: London UK
Contact:
Post
by suthers » Tue Jun 24, 2008 5:17 pm
lukem95 wrote: it depends on your compiler i think, DJGPP uses __asm__ __volatile__ ...
So does gcc...
Jules
Brynet-Inc
Member
Posts: 2426 Joined: Tue Oct 17, 2006 9:29 pm
Libera.chat IRC: brynet
Location: Canada
Contact:
Post
by Brynet-Inc » Tue Jun 24, 2008 10:21 pm
DJGPP == GCC for DOS.
Twitter: @canadianbryan . Award by smcerm, I stole it. Original was larger.
suthers
Member
Posts: 672 Joined: Tue Feb 20, 2007 3:00 pm
Location: London UK
Contact:
Post
by suthers » Wed Jun 25, 2008 5:29 am
Brynet-Inc wrote: DJGPP == GCC for DOS.
Sorry didn't know that (never used DJGPP...)
Jules