I've made some major advances in building C/C++ based device-drivers for RDOS. I use OpenWatcom, and a special clib in order to support device-drivers. Device-drivers use a 32-bit compact memory model, meaning that all code is in the same segment (function pointers are near), while data pointers are far by default. I also use the -zdp option that assumes that DS is loaded with DGROUP, so that data-references to static data won't require segment register loads.
Using these settings, it is possible to compile Intel's ACPICA code without modifications. I've also provided the OS required functions.
Anyway, I can now run both the table initialization code, and the module intialization code on two different machines (an AMD Geode and a 4-core AMD Athlon). Soon I should be able to get basic MP information from ACPI, and the APIC IRQ routing table.
The best thing is that I've debugged all of the ACPI-code at the source level over a TCP/IP connection with the Windows version of OpenWatcom´s debugger.
Next I will probably write some more complex drivers, like CDROM support, USB-disc support and similar in C/C++.
ACPICA almost working now
Re: ACPICA almost working now
The ACPI driver now works on a AMD geode and a 4-core AMD Athlon. All the initialization stages works, and the computer now cannot be turned-off with the power-button.
Additionally, I've started to build lists of devices, their mappings to hardware, and their IRQs. This will be the real bonus. PCI IRQs of some devices will now be possible to obtain on an APIC-configured system.
I also anticipate to solve the issue of searching for PCI devices, as ACPI can enumerate all PCI-devices, this should now be a simple issue to solve.
And I should be able to read-out the CPU temperature.
Additionally, I've started to build lists of devices, their mappings to hardware, and their IRQs. This will be the real bonus. PCI IRQs of some devices will now be possible to obtain on an APIC-configured system.
I also anticipate to solve the issue of searching for PCI devices, as ACPI can enumerate all PCI-devices, this should now be a simple issue to solve.
And I should be able to read-out the CPU temperature.
Re: ACPICA almost working now
So now you make [ALT]+[CTRL]+[Power-button] to shut down the systemrdos wrote:The ACPI driver now works on a AMD geode and a 4-core AMD Athlon. All the initialization stages works, and the computer now cannot be turned-off with the power-button.
I was searching for some info but it was to vendor specific for me. I do like you getting it done. Gives me hope!!!!rdos wrote:And I should be able to read-out the CPU temperature.
Computer says NOOOO
Re: ACPICA almost working now
Yeah. Nobody should be able to shut it down without me giving some directions.Holus wrote:So now you make [ALT]+[CTRL]+[Power-button] to shut down the systemrdos wrote:The ACPI driver now works on a AMD geode and a 4-core AMD Athlon. All the initialization stages works, and the computer now cannot be turned-off with the power-button.
ACPI provides a defined interface for this which is not chipset specific. The downside is that ACPI is extremely complex, and that free implementations like ACPICA requires a lot from the OS. It especially requires a C-compiler that can produce functional code for your OS, and some library functions.Holus wrote:I was searching for some info but it was to vendor specific for me. I do like you getting it done. Gives me hope!!!!rdos wrote:And I should be able to read-out the CPU temperature.
Re: ACPICA almost working now
Output ACPI device-list from my AMD Geode computer on the "acpi" command on the console:
Here is the ACPI tables for my 4-core AMD (a little more complex):
The portable Sony-Vaio with a Intel Core Duo does not boot with the ACPI-driver, rather "hangs up" in AcpiLoadTables, so I don't know how it looks like.
Code: Select all
\_SB_ (ZZY2, MIN_, SLEN, S2BF, SCMP, I2BM, PABM, PBBM, PCBM, PDBM, _INI, GPIO, GLEE)
\_SB_.PWRB (_HID, _STA)
\_SB_.SLPB (_HID, _PRW, _STA)
\_SB_.MEM_ (_HID, _CRS)
\_SB_.AC__ (_HID, _PCL, _PSR, _STA)
\_SB_.PCI0 (_HID, _ADR, _PRW, _STA, CRES, _CRS, _PRT, _INI)
\_SB_.PCI0.USB0 (_ADR, _STA, PRW5, PRW6, _PRW)
\_SB_.PCI0.USB1 (_ADR, _STA, _PRW)
\_SB_.PCI0.USB2 (_ADR, _STA)
\_SB_.PCI0.USB3 (_ADR, _STA)
\_SB_.PCI0.PIDE (_ADR, _STA)
\_SB_.PCI0.PIDE.PRI_ (_ADR, _STA)
\_SB_.PCI0.PIDE.PRI_.MST_ (_ADR, _STA)
\_SB_.PCI0.PIDE.PRI_.SLV_ (_ADR, _STA)
\_SB_.PCI0.PCI1 (_ADR, _PRW)
\_SB_.PCI0.PCI2 (_ADR, _PRW)
\_SB_.PCI0.PCI3 (_ADR, _PRW)
\_SB_.PCI0.PCI4 (_ADR, _PRW)
\_SB_.PCI0.CYRX (_ADR, _INI, PRCN, PIRX, LPIO, ZZZ0, ZZZ1, ZZZ2, ZZZ3, ZZZ4, ZZZ5, ZZZ6, COM1, P3F8, P3F9, P3FA, P3FB, P3FC, P3FD, P3FE, P3FF, COM2, P2F8, P2F9, P2FA, P2FB, P2FC, P2FD, P2FE, P2FF, COM3, P3E8, P3E9, P3EA, P3EB, P3EC, P3ED, P3EE, P3EF, COM4, P2E8, P2E9, P2EA, P2EB, P2EC, P2ED, P2EE, P2EF, ICOM, KBCT, P060, P064)
\_SB_.PCI0.CYRX.LNKA (_HID, _UID, _STA, _PRS, _DIS, _CRS, _SRS)
\_SB_.PCI0.CYRX.LNKB (_HID, _UID, _STA, _PRS, _DIS, _CRS, _SRS)
\_SB_.PCI0.CYRX.LNKC (_HID, _UID, _STA, _PRS, _DIS, _CRS, _SRS)
\_SB_.PCI0.CYRX.LNKD (_HID, _UID, _STA, _PRS, _DIS, _CRS, _SRS)
\_SB_.PCI0.CYRX.SYSR (_HID, _UID, _CRS)
\_SB_.PCI0.CYRX.PIC_ (_HID, _CRS)
\_SB_.PCI0.CYRX.DMA1 (_HID, _CRS)
\_SB_.PCI0.CYRX.TMR_ (_HID, _CRS)
\_SB_.PCI0.CYRX.RTC_ (_HID, _CRS)
\_SB_.PCI0.CYRX.SPKR (_HID, _CRS)
\_SB_.PCI0.CYRX.COPR (_HID, _CRS)
\_SB_.PCI0.CYRX.FDC0 (_HID, _STA, _DIS, _CRS, _PRS, _SRS)
\_SB_.PCI0.CYRX.UAR1 (_HID, _UID, _STA, _DIS, _CRS, _PRS, _SRS)
\_SB_.PCI0.CYRX.UAR2 (_HID, _UID, _STA, _DIS, _CRS, _PRS, _SRS)
\_SB_.PCI0.CYRX.IRDA (_HID, _STA, _DIS, _CRS, _PRS, _SRS)
\_SB_.PCI0.CYRX.LPT1 (_HID, _STA, _DIS, _CRS, _PRS, _SRS)
\_SB_.PCI0.CYRX.ECP1 (_HID, _STA, _DIS, _CRS, _PRS, _SRS)
\_SB_.PCI0.CYRX.PS2M (_HID, _STA, _CRS, _PRW)
\_SB_.PCI0.CYRX.PS2K (_HID, _CID, _STA, _CRS, _PRW)
\_SB_.PCI0.CYRX.PSMR (_HID, _UID, _STA, _CRS)
\_SB_.PCI0.CYRX.UARA (_HID, _UID, _PRW, _STA, _DIS, UCRS, _CRS, _PRS, _SRS, _S1D, _S3D, _S4D, _PS0, _PS3, _PSC)
\_SB_.PCI0.CYRX.UARB (_HID, _UID, _PRW, _STA, _DIS, UCRS, _CRS, _PRS, _SRS, _S1D, _S3D, _S4D, _PS0, _PS3, _PSC)
\_TZ_
Code: Select all
\_SB_ (SMOD, SXTM, SMEM)
\_SB_.PWRB (_HID, _STA)
\_SB_.PCI0 (_HID, _ADR, _INI, BAR1, MMIO, _S3D, _STA, _CRS, PICM, APIC, _PRT, KBCT, P060, P064, _PRW)
\_SB_.PCI0.SYSR (_HID, _UID, _CRS)
\_SB_.PCI0.SMB0 (_ADR, HETT)
\_SB_.PCI0.USB0 (_ADR, _PRW, _S3D)
\_SB_.PCI0.USB1 (_ADR, _PRW, _S3D)
\_SB_.PCI0.USB2 (_ADR, _PRW, _S3D)
\_SB_.PCI0.USB3 (_ADR, _PRW, _S3D)
\_SB_.PCI0.USB4 (_ADR, _PRW, _S3D)
\_SB_.PCI0.USB5 (_ADR, _PRW, _S3D)
\_SB_.PCI0.USB6 (_ADR, _PRW, _S3D)
\_SB_.PCI0.SBAZ (_ADR, PCI_, DNSP, DNSO, ENSR, _PRW)
\_SB_.PCI0.SATA (_ADR, _INI, SACS, STB5, SPTM)
\_SB_.PCI0.SATA.PRID (_ADR, _GTM, _STM, PRIS, _PS0, _PS3, _PSC)
\_SB_.PCI0.SATA.PRID.P_D0 (_ADR, _STA, S12P, _PS0, _PS3, _PSC)
\_SB_.PCI0.SATA.PRID.P_D1 (_ADR, _STA, S12P, _PS0, _PS3, _PSC)
\_SB_.PCI0.SATA.SECD (_ADR, _GTM, _STM, SECS, _PS0, _PS3, _PSC)
\_SB_.PCI0.SATA.SECD.S_D0 (_ADR, _STA, S12P, _PS0, _PS3, _PSC)
\_SB_.PCI0.SATA.SECD.S_D1 (_ADR, _STA, S12P, _PS0, _PS3, _PSC)
\_SB_.PCI0.PEX0 (_ADR, _STA, _PRW, PIC0, API0, _PRT)
\_SB_.PCI0.PEX1 (_ADR, _STA, _PRW, PIC1, API1, _PRT)
\_SB_.PCI0.PEX2 (_ADR, _STA, _PRW, PIC2, API2, _PRT)
\_SB_.PCI0.PEX3 (_ADR, _STA, _PRW, PIC3, API3, _PRT)
\_SB_.PCI0.LPC0 (_ADR, PIRQ, PIID, PIDA, IPRS, PIRA, PIRB, PIRC, PIRD, PIRE, PIRF, PIRG, PIRH, PIRS, HDAD, GEC_, USB1, USB2, USB3, USB4, USB5, USB6, USB7, IDE_, SATA, GPP0, GPP1, GPP2, GPP3, DSPI)
\_SB_.PCI0.LPC0.PMIO (_HID, _UID, _CRS)
\_SB_.PCI0.LPC0.LNKA (_HID, _UID, _STA, _PRS, _DIS, _CRS, _SRS)
\_SB_.PCI0.LPC0.LNKB (_HID, _UID, _STA, _PRS, _DIS, _CRS, _SRS)
\_SB_.PCI0.LPC0.LNKC (_HID, _UID, _STA, _PRS, _DIS, _CRS, _SRS)
\_SB_.PCI0.LPC0.LNKD (_HID, _UID, _STA, _PRS, _DIS, _CRS, _SRS)
\_SB_.PCI0.LPC0.LNKE (_HID, _UID, _STA, _PRS, _DIS, _CRS, _SRS)
\_SB_.PCI0.LPC0.LNKF (_HID, _UID, _STA, _PRS, _DIS, _CRS, _SRS)
\_SB_.PCI0.LPC0.LNK0 (_HID, _UID, _STA, _PRS, _DIS, _CRS, _SRS)
\_SB_.PCI0.LPC0.LNK1 (_HID, _UID, _STA, _PRS, _DIS, _CRS, _SRS)
\_SB_.PCI0.LPC0.PIC_ (_HID, _CRS)
\_SB_.PCI0.LPC0.DMA1 (_HID, _CRS)
\_SB_.PCI0.LPC0.TMR_ (_HID, ATT5, ATT6, _CRS)
\_SB_.PCI0.LPC0.HPET (_HID, ATT3, ATT4, _STA, _CRS)
\_SB_.PCI0.LPC0.RTC_ (_HID, ATT0, ATT1, ATT2, ATT3, _CRS)
\_SB_.PCI0.LPC0.SPKR (_HID, _CRS)
\_SB_.PCI0.LPC0.COPR (_HID, _CRS)
\_SB_.PCI0.P2P_ (_ADR, _S3D, _PRW, PICM, APIC, _PRT)
\_SB_.PCI0.IDE_ (_ADR, UDMT, PIOT, PITR, MDMT, MDTR, IDE_, PPIT, SPIT, PMDT, SMDT, PPIC, SPIC, PPIM, SPIM, PUDC, SUDC, PUDM, SUDM, GETT, GTM_, STM_, GTF_)
\_SB_.PCI0.IDE_.PRID (_ADR, _GTM, _STM)
\_SB_.PCI0.IDE_.PRID.P_D0 (_ADR, _GTF)
\_SB_.PCI0.IDE_.PRID.P_D1 (_ADR, _GTF)
\_SB_.PCI0.IDE_.SECD (_ADR, _GTM, _STM)
\_SB_.PCI0.IDE_.SECD.S_D0 (_ADR, _GTF)
\_SB_.PCI0.IDE_.SECD.S_D1 (_ADR, _GTF)
\_SB_.PCI0.PCE2 (_ADR, _PRW, PICM, APIC, _PRT)
\_SB_.PCI0.PCE3 (_ADR, _PRW, PICM, APIC, _PRT)
\_SB_.PCI0.PCE4 (_ADR, _PRW, PICM, APIC, _PRT)
\_SB_.PCI0.PCE5 (_ADR, _PRW, PICM, APIC, _PRT)
\_SB_.PCI0.PCE6 (_ADR, _PRW, PICM, APIC, _PRT)
\_SB_.PCI0.PCE7 (_ADR, _PRW, PICM, APIC, _PRT)
\_SB_.PCI0.PCE9 (_ADR, _PRW, PICM, APIC, _PRT)
\_SB_.PCI0.PCEA (_ADR, _PRW, PICM, APIC, _PRT)
\_SB_.PCI0.PCEB (_ADR, _PRW, PICM, APIC, _PRT)
\_SB_.PCI0.PCEC (_ADR, _PRW, PICM, APIC, _PRT)
\_SB_.PCI0.FDC0 (_HID, _STA, _DIS, _CRS, _PRS, _SRS)
\_SB_.PCI0.UAR1 (_HID, _UID, _STA, _DIS, _CRS, _PRS, _SRS)
\_SB_.PCI0.PS2M (_HID, _STA, _CRS, _PRW)
\_SB_.PCI0.PS2K (_HID, _STA, _CRS, _PRW)
\_SB_.PCI0.PSMR (_HID, _UID, _STA, _CRS)
\_SB_.PCI0.AGP_ (_ADR, PICM, APIC, _PRT)
\_SB_.PCI0.EXPL (_HID, _UID, _CRS)
\_SB_.MEM_ (_HID, _CRS)
\_TZ_
\AOD_ (DBG_, OBID, OBIT, OBDT, BM01, XINI, EM01, BM05, EM05, HM06, HM07, QLST, AODT, ASCD, ASTS, ASBF, GFXO, GMOD, ID01, ID02, SOID, WROW, GROW, CPTB, CBTP, ABS_, EXBF, ACMS, P72_, P73_, BSF_, GCMS, SCMS, STNV, CPUD, GFXD, SBCD, GETC, SETC, CINI, GCCX, CCLK, SCCX, WTCX, RMPC, UP62, VINI, SETV, GETV, RWBY, GF01, OVFL, OCFL, TSBF, GVBF, AM01, AM02, AM03, AM04, AM05, AM06, AM07, AM08, OBSV, APTS, AWAK, CMDV, AM09, OBUF, AM10, CMDL, AM11, R301, R302, R303, R304, VEND, R401, R404, R501, WQBA, _HID, _UID, _WDG, WMAA, GVB1, GVB2)
\AWY_ (_HID, _STA)