ALT Linux Community general discussions
 help / color / mirror / Atom feed
* [Comm] подскажите пожалуйста аналоги фунцций ioperm() iopl() для не x86 архитектуры.
  @ 2006-09-14  7:06 ` gosha
  2006-09-14  7:29   ` Хихин Руслан
  2006-09-14  7:47 ` [Comm] аналог утилиты debug(msdos) под linux, gdb & Ларошфуко gosha
  1 sibling, 1 reply; 5+ messages in thread
From: gosha @ 2006-09-14  7:06 UTC (permalink / raw)
  To: community

подскажите пожалуйста аналоги фунцций ioperm() iopl() для не x86 архитектуры.

как я понял данные ф- ии существуют только в x86 архитекурутре
http://www.linuxdoc.ru/manpages/man2/ioperm.2.html

Т.е. проверил -под i686 ф-ии работают ok.
/*********************************************************************************************/
#include <stdio.h>
#include <string.h>
#include <time.h>
#include <sys/io.h>

static unsigned long pcibus_conf_reg = 0xbfc40040;
/*********************************************************************************************/
int main(int argc, char *argv[])
    {char *p;
     int i, a;
     const char *_ENOTSUP = {" - unsupported command."};
     iopl(3);
     if (ioperm(pcibus_conf_reg, 4, 1)) {perror("- iopermission error"); exit(1);}
     for(i=1; i < argc; i++)     
        {if(strchr(argv[i],'-')!=NULL){ continue;}
         if(strstr(argv[i],"en")!=NULL) {*((unsigned long*)elins64cmp_bus_err_reg)= 0x800; printf(" - pci addres cohereccy mode on.\r\n");continue;}
         if(strstr(argv[i],"dis")!=NULL){*((unsigned long*)elins64cmp_bus_err_reg)= 0x000; printf(" - pci data cohereccy mode on.\r\n");continue;}
         puts(_ENOTSUP);
        }
     return 1;
 }
/*********************************************************************************************/
Пересобрал ту же тестовую маленькую прогу на MIPS - не компилируется
   -  iopl()  undefined reference
   - ioperm() undefined referenc.

-- 
С Уважением,
       gosha.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Comm] подскажите пожалуйста аналоги фунцций ioperm() iopl() для не x86 архитектуры.
  2006-09-14  7:06 ` [Comm] подскажите пожалуйста аналоги фунцций ioperm() iopl() для не x86 архитектуры gosha
@ 2006-09-14  7:29   ` Хихин Руслан
  0 siblings, 0 replies; 5+ messages in thread
From: Хихин Руслан @ 2006-09-14  7:29 UTC (permalink / raw)
  To: community

[-- Attachment #1: Type: text/plain, Size: 2062 bytes --]

Здравствуйте gosha
  В сообщении от 14 сентября 2006 11:06 gosha написал(a):
 > подскажите пожалуйста аналоги фунцций ioperm() iopl() для не x86
 > архитектуры.
 >
 >
 >
 > как я понял данные ф- ии существуют только в x86 архитекурутре
 >
 > http://www.linuxdoc.ru/manpages/man2/ioperm.2.html
 >
 >
 >
 > Т.е. проверил -под i686 ф-ии работают ok.
 >
 > /*******************************************************************
 >**************************/
 >
 > #include <stdio.h>
 >
 > #include <string.h>
 >
 > #include <time.h>
 >
 > #include <sys/io.h>
 >
 >
 >
 > static unsigned long pcibus_conf_reg = 0xbfc40040;
 >
 > /*******************************************************************
 >**************************/
 >
 > int main(int argc, char *argv[])
 >
 >     {char *p;
 >
 >      int i, a;
 >
 >      const char *_ENOTSUP = {" - unsupported command."};
 >
 >      iopl(3);
 >
 >      if (ioperm(pcibus_conf_reg, 4, 1)) {perror("- iopermission
 > error"); exit(1);}
 >
 >      for(i=1; i < argc; i++)
 >
 >         {if(strchr(argv[i],'-')!=NULL){ continue;}
 >
 >          if(strstr(argv[i],"en")!=NULL) {*((unsigned
 > long*)elins64cmp_bus_err_reg)= 0x800; printf(" - pci addres
 > cohereccy mode on.\r\n");continue;}
 >
 >          if(strstr(argv[i],"dis")!=NULL){*((unsigned
 > long*)elins64cmp_bus_err_reg)= 0x000; printf(" - pci data cohereccy
 > mode on.\r\n");continue;}
 >
 >          puts(_ENOTSUP);
 >
 >         }
 >
 >      return 1;
 >
 >  }
 >
 > /*******************************************************************
 >**************************/
 >
 > Пересобрал ту же тестовую маленькую прогу на MIPS - не компилируется
 >
 >    -  iopl()  undefined reference
 >
 >    - ioperm() undefined referenc.
А там порты-то  есть к которым вы достучаться пытаетесь?
-- 
  А ещё говорят так  (fortune):
 
Уж лучше быть в безвестности 
Учителем словесности, 
Чем, обретя известность, 
Уродовать словесность!
		-- Ефим Самоварщиков
________________________________________________________________________
С уважением Хихин Руслан (hihin@rambler.ru)

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Comm] аналог утилиты debug(msdos) под linux,  gdb & Ларошфуко
    2006-09-14  7:06 ` [Comm] подскажите пожалуйста аналоги фунцций ioperm() iopl() для не x86 архитектуры gosha
@ 2006-09-14  7:47 ` gosha
  2006-09-14  7:55   ` Eugene Ostapets
  1 sibling, 1 reply; 5+ messages in thread
From: gosha @ 2006-09-14  7:47 UTC (permalink / raw)
  To: community

>
> Здравствуйте gosha
>
>   В сообщении от 14 сентября 2006 09:08 gosha написал(a):
>  > Подскажите пожалуйста аналог утилиты debug(msdos)  под linux.
>
> gdb ?
> --
>   А ещё говорят так  (fortune):
>
> Когда женщина влюбляется впервые, она любит своего любовника; в
> дальнейшем она  любит только любовь.
> 		-- Ларошфуко

Ничего не понял. Какое отношение имеет gdb к Ларошфуко ?

Как gdb дать permission на всеь диапазон портов и памяти?

----------------
(gdb)set mem 0xbfc40040 0xbfc40044 rw 32 nocache
(gdb)set variable *(0xbfc40040)=0x00000000
(gdb)cannot acess memory at adress 0xbfc40040
---------------- 

-- 
С Уважением,
       gosha.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Comm] аналог утилиты debug(msdos) под linux, gdb & Ларошфуко
  2006-09-14  7:47 ` [Comm] аналог утилиты debug(msdos) под linux, gdb & Ларошфуко gosha
@ 2006-09-14  7:55   ` Eugene Ostapets
  2006-09-14 20:21     ` Yura Kalinichenko
  0 siblings, 1 reply; 5+ messages in thread
From: Eugene Ostapets @ 2006-09-14  7:55 UTC (permalink / raw)
  To: ALT Linux Community

14.09.06, gosha<embedded nm.ru> написал(а):
> Как gdb дать permission на всеь диапазон портов и памяти?
Учитывая что в более других операционках чем DOS, память у любой
задачи ВИРТУАЛЬНАЯ, то выдать такой доступ не может никто:) И опять
таки прямой доступ к портам возможен только из ядра, а все остальное
доступается через API...
-- 
С уважением,
Евгений Остапец
uin: 23747217
jid: eugene_ostapets@jabber.ru

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Comm] аналог утилиты debug(msdos) под linux, gdb & Ларошфуко
  2006-09-14  7:55   ` Eugene Ostapets
@ 2006-09-14 20:21     ` Yura Kalinichenko
  0 siblings, 0 replies; 5+ messages in thread
From: Yura Kalinichenko @ 2006-09-14 20:21 UTC (permalink / raw)
  To: ALT Linux Community

В Чтв, 14/09/2006 в 10:55 +0300, Eugene Ostapets пишет:
> 14.09.06, gosha<embedded nm.ru> написал(а):
> > Как gdb дать permission на всеь диапазон портов и памяти?
> Учитывая что в более других операционках чем DOS, память у любой
> задачи ВИРТУАЛЬНАЯ, то выдать такой доступ не может никто:)
>  И опять
> таки прямой доступ к портам возможен только из ядра, а все остальное
> доступается через API...

Ну к портам вообще-то не только через ядро:

man inb
man ioperm
man iopl

Хотя это и не наш метод, но для отладки иногда полезно.

-- 
Yura Kalinichenko




^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2006-09-14 20:21 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-09-14  7:06 ` [Comm] подскажите пожалуйста аналоги фунцций ioperm() iopl() для не x86 архитектуры gosha
2006-09-14  7:29   ` Хихин Руслан
2006-09-14  7:47 ` [Comm] аналог утилиты debug(msdos) под linux, gdb & Ларошфуко gosha
2006-09-14  7:55   ` Eugene Ostapets
2006-09-14 20:21     ` Yura Kalinichenko

ALT Linux Community general discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lore.altlinux.org/community/0 community/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 community community/ http://lore.altlinux.org/community \
		mandrake-russian@linuxteam.iplabs.ru community@lists.altlinux.org community@lists.altlinux.ru community@lists.altlinux.com
	public-inbox-index community

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://lore.altlinux.org/org.altlinux.lists.community


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git