Andrew Brooks | 3 May 2012 17:47
Picon
Favicon

IO ports from /proc/ioports

Hi


I've just tried to get dosemu working (on ubuntu 12.04) with hardware that requires IO ports.

It wasn't working so I checked /proc/ioports and found the first line completely overlaps the range I need (0x0320...)
0000-0cf7 : PCI Bus 0000:00
The other lines in the file are as normal (although indented) covering allocations more specifically.

I hacked dosemu to ignore the offending line and now have IO port access.

Is there a clean way to solve this in the source (emu-i386/ports.c) ?

Andrew

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Dosemu-devel mailing list
Dosemu-devel@...
https://lists.sourceforge.net/lists/listinfo/dosemu-devel
Stas Sergeev | 3 May 2012 19:32
Picon
Favicon

Re: IO ports from /proc/ioports

03.05.2012 19:47, Andrew Brooks wrote:
> I've just tried to get dosemu working (on ubuntu 12.04) with hardware 
> that requires IO ports.
>
> It wasn't working so I checked /proc/ioports and found the first line 
> completely overlaps the range I need (0x0320...)
> 0000-0cf7 : PCI Bus 0000:00
> The other lines in the file are as normal (although indented) covering 
> allocations more specifically.
>
> I hacked dosemu to ignore the offending line and now have IO port access.
>
> Is there a clean way to solve this in the source (emu-i386/ports.c) ?
There is: to teach dosemu about the indentation in
/proc/ioports, that covers the allocations more specifically. :)
You code? :)
I think the simplest logic would be to just ignore the
previous line if the subsequent line is "more indented".

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
Bart Oldeman | 3 May 2012 22:21
Picon

Re: IO ports from /proc/ioports

On 3 May 2012 11:47, Andrew Brooks wrote:
> I've just tried to get dosemu working (on ubuntu 12.04) with hardware that
> requires IO ports.
>
> It wasn't working so I checked /proc/ioports and found the first line
> completely overlaps the range I need (0x0320...)
> 0000-0cf7 : PCI Bus 0000:00
> The other lines in the file are as normal (although indented) covering
> allocations more specifically.
>
> I hacked dosemu to ignore the offending line and now have IO port access.
>
> Is there a clean way to solve this in the source (emu-i386/ports.c) ?

I'm working on a patch. The code is buggy in any case; it will take me
a bit longer. The code doesn't need to look for indent spaces; it
could also look if the range on the current line is a subrange of the
previous line, and if so, ignore the previous line.

You can also force it using "$_ports = device /dev/null 0x320"

Bart

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/

Gmane