Board.KolibriOS.org

Официальный форум KolibriOS
Текущее время: Чт окт 19, 2017 2:59 am

Часовой пояс: UTC+03:00




Начать новую тему  Ответить на тему  [ 6 сообщений ] 
Автор Сообщение
 Заголовок сообщения: understanding function calls in assembly files
СообщениеДобавлено: Чт фев 13, 2014 10:57 pm 
Не в сети

Зарегистрирован: Пт окт 18, 2013 9:57 am
Сообщения: 8
Hi everyone, I am trying to understand the code in kolibriOS and how it works to help me write my own hobby OS but sometimes I encounter calls to functions that I can't understand or find the implementation of the function for example I was reading rtl8029.asm and I saw the call PCI_Find_IO I found this function in pci.inc but inside this file I there is this stdcall PciRead32, [device.pci_bus], [device.pci_dev], esi but I couldn't find the implemetation of the function PciRead32.
How can I solve this problem and such problems in the future thank you?


Вернуться к началу
 Заголовок сообщения: Re: understanding function calls in assembly files
СообщениеДобавлено: Чт фев 13, 2014 11:06 pm 
Не в сети
Mentor/Kernel Developer
Аватара пользователя

Зарегистрирован: Пт июн 30, 2006 9:01 am
Сообщения: 1229
These functions are in kernel. They are imported into the driver (MS COFF format, or now recently, PE)
Look at the files import.inc near the drivers, and exports.inc in kernel code.

_________________
"Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius -- and a lot of courage -- to move in the opposite direction." Albert Einstein


Вернуться к началу
 Заголовок сообщения: Re: understanding function calls in assembly files
СообщениеДобавлено: Пт фев 14, 2014 9:53 am 
Не в сети

Зарегистрирован: Пт окт 18, 2013 9:57 am
Сообщения: 8
How are they imported into the file so they are used in it? format MS COFF defines the output format, it doesn't import them right? Also the syntax of imports.inc is hard to undertsand I cannot tell what is this file for, and I cannot find exports.inc in kernel code.


Вернуться к началу
 Заголовок сообщения: Re: understanding function calls in assembly files
СообщениеДобавлено: Пт фев 14, 2014 12:56 pm 
Не в сети

Зарегистрирован: Пн сен 24, 2007 11:11 am
Сообщения: 2814
http://websvn.kolibrios.org/filedetails ... xports.inc - there it is, core/exports.inc
imports.inc is very simple, it's just an array of labels and addresses.


Вернуться к началу
 Заголовок сообщения: Re: understanding function calls in assembly files
СообщениеДобавлено: Сб фев 15, 2014 10:08 am 
Не в сети

Зарегистрирован: Пт окт 18, 2013 9:57 am
Сообщения: 8
Should I search all the files in kernel directory to find this function? I searched in pci32.inc but nothing, my goal is to find the io base address and irq line of the rtl8029 network card so I can write my own driver, so please would you give me a hint on how can I find those functions so I can understand every thing? Is there a way to debug the boot process and track every thing that happens from boot until all drivers are ready, this would help understanding the boot process and how is every thing set up especially the network drivers.


Вернуться к началу
 Заголовок сообщения: Re: understanding function calls in assembly files
СообщениеДобавлено: Сб фев 15, 2014 1:26 pm 
Не в сети
Mentor/Kernel Developer
Аватара пользователя

Зарегистрирован: Пт июн 30, 2006 9:01 am
Сообщения: 1229
Mohsen47 писал(а):
Should I search all the files in kernel directory to find this function? I searched in pci32.inc but nothing, my goal is to find the io base address and irq line of the rtl8029 network card so I can write my own driver, so please would you give me a hint on how can I find those functions so I can understand every thing? Is there a way to debug the boot process and track every thing that happens from boot until all drivers are ready, this would help understanding the boot process and how is every thing set up especially the network drivers.


If you actually look at the files I pointed you to, you'll see that the name of the function in kernel is not always the same as the name that is used in the driver.
In exports.inc, you'll find the line
Код:
pci_read32,            'PciRead32',          \      ; stdcall

The function in kernel is thus called 'pci_read32'.
Now you can use a tool to search inside the contents of the file (windows search even can do this for you...)
You will find 3 files now exports.inc, dll.inc and apic.inc. We know it's not in exports.inc

_________________
"Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius -- and a lot of courage -- to move in the opposite direction." Albert Einstein


Вернуться к началу
Показать сообщения за:  Поле сортировки  
Начать новую тему  Ответить на тему  [ 6 сообщений ] 

Часовой пояс: UTC+03:00


Кто сейчас на конференции

Сейчас этот форум просматривают: Yahoo [Bot] и 1 гость


Вы не можете начинать темы
Вы не можете отвечать на сообщения
Вы не можете редактировать свои сообщения
Вы не можете удалять свои сообщения
Вы не можете добавлять вложения

Найти:
Перейти:  
Создано на основе phpBB® Forum Software © phpBB Limited
Русская поддержка phpBB