dukester
Full Member
  
Posts: 140
On Faceflow I'm dukester
|
 |
« on: August 13, 2010, 08:16:15 PM » |
|
I started playing around with RTL8139.Mod NIC driver. I compiled it to where it would choke first, to give me an idea of where I would need to change the code, etc. The first choke-point was IMPORT: Machine Plugins KernelLog I can't find Machine.Mod anywhere in the zip files at http://bluebottle.ethz.ch/download.html. Does anybody know where this Module lives? I did find the other two, and I'll be loading them up into NO, just to see what blows up  TIA...
|
|
|
Logged
|
duke
|
|
|
dukester
Full Member
  
Posts: 140
On Faceflow I'm dukester
|
 |
« Reply #1 on: August 13, 2010, 08:33:57 PM » |
|
OK! I found it... it's in Kernel.Zip - Machine.Obx
Will Machine.Obx run in NO, or do I have to re-compile it? If the latter, where does the source code live? It doesn't appear to be in the KernelSrc.Zip file.
|
|
|
Logged
|
duke
|
|
|
dukester
Full Member
  
Posts: 140
On Faceflow I'm dukester
|
 |
« Reply #2 on: August 15, 2010, 05:08:43 PM » |
|
Update:
OP2 returns error #152: Symbols files of Imported Module not found.
I assume that means that IMPORT is looking for an Obj file and not a Mod file?
I suspect that I have to re-compile the missing modules with OP2. So I still need to find Machine.Mod. Can't find it! Anybody know where it is hiding?
|
|
|
Logged
|
duke
|
|
|
staubesv
|
 |
« Reply #3 on: August 16, 2010, 02:39:33 PM » |
|
The name of the source code file is I386.Machine.Mod and it is found in KernelSrc.zip. Note that the Kernel package contains the A2 operating system itself - these modules won't therefore run under NO. In case of Machine, RTL8139 uses it to install its interrupt handler (Use Kernel.InstallIP and Kernel.RemoveIP in NO), for mapping physical memory (use Kernel.MapPhysical in NO) and for atomic increment. I haven't found the atomic increment in NO. Either remove it from RTL8139.Mod since it is only used for statistics and therefore can be ommited - or: Copy the procedure AtomicInc from I386.Machine.Mod into a new module and see whether OP2 can compile it. Hint: I would recommend you to not change modules of the NO runtime system itself (e.g. Kernel.Mod, Oberon.Mod, ...) since this would require you to re-build and re-install the boot image. Not that this would be so hard, but it makes more sense to focus on the actual problem instead of running into new ones  Plugins.Mod is not available in NO since NO comes with a different framework for NIC drivers. Have a look at an existing NO NIC driver to find out have the drivers register themselves at the NO network stack... KernelLog.Mod -> Out.Mod
|
|
« Last Edit: August 16, 2010, 02:43:10 PM by staubesv »
|
Logged
|
|
|
|
dukester
Full Member
  
Posts: 140
On Faceflow I'm dukester
|
 |
« Reply #4 on: August 16, 2010, 03:37:10 PM » |
|
The name of the source code file is I386.Machine.Mod and it is found in KernelSrc.zip. Note that the Kernel package contains the A2 operating system itself - these modules won't therefore run under NO. In case of Machine, RTL8139 uses it to install its interrupt handler (Use Kernel.InstallIP and Kernel.RemoveIP in NO), for mapping physical memory (use Kernel.MapPhysical in NO) and for atomic increment. Let me get this correct... You are suggesting not to recompile I386.Machine.Mod, as it is A2 specific! Instead, in RTL8139.Mod I should replace all occurences of Machine.InstallIP with Kernel.InstallIP, etc etc ? I haven't found the atomic increment in NO. Either remove it from RTL8139.Mod since it is only used for statistics and therefore can be ommited - or: Copy the procedure AtomicInc from I386.Machine.Mod into a new module and see whether OP2 can compile it. OK.. Hint: I would recommend you to not change modules of the NO runtime system itself (e.g. Kernel.Mod, Oberon.Mod, ...) since this would require you to re-build and re-install the boot image. Not that this would be so hard, but it makes more sense to focus on the actual problem instead of running into new ones  Agreed! I have enough on my NO plate at the moment  Plugins.Mod is not available in NO since NO comes with a different framework for NIC drivers. Have a look at an existing NO NIC driver to find out have the drivers register themselves at the NO network stack... OK! I might need to get back to you on this one.. KernelLog.Mod -> Out.Mod OK
|
|
|
Logged
|
duke
|
|
|
staubesv
|
 |
« Reply #5 on: August 16, 2010, 04:27:40 PM » |
|
Let me get this correct... You are suggesting not to recompile I386.Machine.Mod, as it is A2 specific! Instead, in RTL8139.Mod I should replace all occurences of Machine.InstallIP with Kernel.InstallIP, etc etc ? Hmm... actually, simple renaming won't do the job. The RTL8319 driver uses the A2 kernel API which is simply not available in Oberon (which comes with its own kernel API). Of course, NO and A2 are both operating systems and offer similar functionaliy, e.g. registration of interrupt routines - but the APIs are not compatible. Maybe it would be better to start from an NO NIC driver, remove all code that is device-specific and then re-code it based on the code found in RTL8139.Mod.
|
|
|
Logged
|
|
|
|
dukester
Full Member
  
Posts: 140
On Faceflow I'm dukester
|
 |
« Reply #6 on: August 16, 2010, 05:04:19 PM » |
|
Let me get this correct... You are suggesting not to recompile I386.Machine.Mod, as it is A2 specific! Instead, in RTL8139.Mod I should replace all occurences of Machine.InstallIP with Kernel.InstallIP, etc etc ? Hmm... actually, simple renaming won't do the job. The RTL8319 driver uses the A2 kernel API which is simply not available in Oberon (which comes with its own kernel API). Of course, NO and A2 are both operating systems and offer similar functionaliy, e.g. registration of interrupt routines - but the APIs are not compatible. Maybe it would be better to start from an NO NIC driver, remove all code that is device-specific and then re-code it based on the code found in RTL8139.Mod. Zut! You're _no fun at all_ on a Monday morning!  I liked your first answer better! What about the error code 152 thing?
|
|
|
Logged
|
duke
|
|
|
staubesv
|
 |
« Reply #7 on: August 16, 2010, 07:58:24 PM » |
|
Error code 152: I don't use OP2 but most likely it means that OP2 does not find the corresponding object files (*.Obx). For every imported module listed, there most be and IMPORTNAME.Obx file (symbol file is contained in object file).
|
|
|
Logged
|
|
|
|
dukester
Full Member
  
Posts: 140
On Faceflow I'm dukester
|
 |
« Reply #8 on: August 16, 2010, 09:14:16 PM » |
|
Error code 152: I don't use OP2 but most likely it means that OP2 does not find the corresponding object files (*.Obx). For every imported module listed, there most be and IMPORTNAME.Obx file (symbol file is contained in object file).
I didn't know whether a .Mod file or an .Obj was what was being IMPORTed. So if the object file is present, why would OP2 still complain?
|
|
|
Logged
|
duke
|
|
|
staubesv
|
 |
« Reply #9 on: August 17, 2010, 09:59:38 AM » |
|
OP2 will look for the object files (*.Obj). If the object files are present and not corrupted, it should not complain. Could you please post/attach the code you're trying to compile?
|
|
|
Logged
|
|
|
|
dukester
Full Member
  
Posts: 140
On Faceflow I'm dukester
|
 |
« Reply #10 on: August 17, 2010, 02:32:12 PM » |
|
Here's the code:
MODULE RTL8139; (** AUTHOR "TF"; PURPOSE "Realtek RTL8139 ethernet driver"; *)
(* references : RTL 8139C(L) Preliminary, REALTEK Semiconductor Corp., Rev 1.1 1999/11/4 RTL 8139(a/B) Programming guide (V0.1) 1999/1/15
This driver is not optimized for speed. It has been tested on Chipset8139 and Chipset8139C. Please report success / failure with other 8139 compatible chipsets. *)
IMPORT SYSTEM, Kernel, Machine, PCI, Objects, Modules, Plugins, Network, KernelLog, Files; ^ ^ ^ What I was trying to do is to copy KernelLog.Mod, Plugins.Mod over to my NO partition, and recompile with OP2. I only tried this with "Plugins" so far. When I recompiled using Compiler.Compile\s * (after marking the viewer), I still received an error code 152 for "Plugins". However Plugins.Obj was there in SYS:
Let me double check the relevant filenames present in SYS: There may also be a file called PlugIns.Mod, and I am confusing the 2. One file shipped with NO; the other came from A2. I'll get back to you.
|
|
|
Logged
|
duke
|
|
|
dukester
Full Member
  
Posts: 140
On Faceflow I'm dukester
|
 |
« Reply #11 on: August 17, 2010, 05:26:17 PM » |
|
My Bad!
I have PlugIns.Mod and PlugIns.Obj that ship with ETHNO. ^ RTL8139.Mod IMPORTs Plugins ^ which I have not yet tried to recompiled. I thought that it was already included in NO.
|
|
|
Logged
|
duke
|
|
|
staubesv
|
 |
« Reply #12 on: August 18, 2010, 09:00:59 AM » |
|
You should try to use the NO APIs instead of moving A2 APIs to NO. Use Out.Mod instead of KernelLog.Mod in NO. You won't need A2 Plugins.Mod because the NO TCP/IP stack doesn't use this plugin mechanism.
-> Don't use the A2 modules KernelLog.Mod and Plugins.Mod at all!
That's why I suggested a different approach in an older post: Take a NO network driver, remove hardware-specific code and fill-it in again (but for Realtek) based on RTL8139.Mod. This way, the RTL driver will fit into the NO network device driver framework.
Also be aware that module names are case-sensitive, e.g. PlugIns and Plugins are two different modules.
|
|
|
Logged
|
|
|
|
dukester
Full Member
  
Posts: 140
On Faceflow I'm dukester
|
 |
« Reply #13 on: August 18, 2010, 02:51:26 PM » |
|
You should try to use the NO APIs instead of moving A2 APIs to NO. Use Out.Mod instead of KernelLog.Mod in NO. You won't need A2 Plugins.Mod because the NO TCP/IP stack doesn't use this plugin mechanism.
-> Don't use the A2 modules KernelLog.Mod and Plugins.Mod at all!
That's why I suggested a different approach in an older post: Take a NO network driver, remove hardware-specific code and fill-it in again (but for Realtek) based on RTL8139.Mod. This way, the RTL driver will fit into the NO network device driver framework. I will do as you suggest... Also be aware that module names are case-sensitive, e.g. PlugIns and Plugins are two different modules. Yes! I was aware of that one. That's why I went back and double-checked the name of the module that RTL8139.Mod was importing, and compared it to what I had in SYS: So I'm learning the ways of the Pascal family of languages.  Thank you!
|
|
|
Logged
|
duke
|
|
|
|