diff --git a/Adam/ABlkDev/DskPrt.HC b/Adam/ABlkDev/DskPrt.HC index a67d013..7b4e294 100644 --- a/Adam/ABlkDev/DskPrt.HC +++ b/Adam/ABlkDev/DskPrt.HC @@ -195,5 +195,6 @@ pd_done: QueRem(tmppp); Free(tmppp); } + Fs->user_data=1; return total; } diff --git a/Adam/Device/Comm.HC b/Adam/Device/Comm.HC index abf0c40..98ad0d1 100644 --- a/Adam/Device/Comm.HC +++ b/Adam/Device/Comm.HC @@ -94,16 +94,16 @@ interrupt U0 IRQCommPCI() I64 AddPCIComms(I64 next_port) { - I64 class_code = PCIC_COMM << 16 | PCISC_SERIAL << 8 + SERIAL_16550, + I64 class_code = PCIC_COMM << 8 | PCISC_SERIAL, ioport,bdf,cur_port=next_port, b, d, f, bar; for (b = 0; b < sys_pci_busses; b++) for (d = 0; d < 32; d++) for (f = 0; f < 8; f++) { - if (class_code == PCIReadU32(b, d, f, PCIR_PROG_IF) & 0xFFFFFF) + if (class_code == PCIReadU16(b, d, f, PCIR_SUB_CODE) & 0xFFFF) { - for (bar=PCIR_BASE0; barbase_code,tmppci->sub_code, v,d, tmppci->vendor_str,tmppci->dev_id_str; - tmppci=tmppci->next; for (i=0; i<6; i++) { bar=PCIReadU32(tmppci->bus,tmppci->dev,tmppci->fun,0x10+4*i); @@ -199,6 +198,7 @@ public U0 PCIRep() else if (bar&7==4) "64-bit MMIO: 0x%016x\n",(bar&0xfffffff0)(I64)+PCIReadU32(tmppci->bus,tmppci->dev,tmppci->fun,0x10+4*(i+1))(I64)<<32; else if (bar&7==2) "16-bit MMIO: 0x%04x\n",(bar&0xfff0)(I64); } + tmppci=tmppci->next; } } @@ -278,4 +278,14 @@ public CPCIDev *PCIDevFind(U16 class_code=NULL, U16 sub_code=NULL, return NULL; } +U0 PCILookUpDev(I64 vendor, I64 dev) +{ + CDoc *doc; + U8 *vendor_str, *dev_id_str; + doc=DocRead(PCI_DEV_FILE,DOCF_PLAIN_TEXT|DOCF_NO_CURSOR); + PCILookUpSingle(doc,vendor,dev,vendor_str,dev_id_str); + "Vendor: %s\n",vendor_str; + "Device: %s\n",dev_id_str; + DocDel(doc); +} diff --git a/Adam/Device/MakeDev.HC b/Adam/Device/MakeDev.HC index 1d1bc32..e6a572d 100644 --- a/Adam/Device/MakeDev.HC +++ b/Adam/Device/MakeDev.HC @@ -1,4 +1,5 @@ Cd(__DIR__);; #include "Comm" #include "DevInfo" +#include "SerialMouse" Cd("..");; diff --git a/Adam/DolDoc/DocRecalcLib.HC b/Adam/DolDoc/DocRecalcLib.HC index 7be8f31..b0e5446 100644 --- a/Adam/DolDoc/DocRecalcLib.HC +++ b/Adam/DolDoc/DocRecalcLib.HC @@ -206,7 +206,15 @@ U0 DocUpdateTaskDocs(CTask *task) CDoc *doc; CD3I64 saved_scroll; if (task->border_src==BDS_CUR_DRV && task->cur_dv) - task->border_attr=DrvTextAttrGet(Drv2Let(task->cur_dv)); + { + try { + task->border_attr=DrvTextAttrGet(Drv2Let(task->cur_dv)); + } + catch { + task->border_attr=DrvTextAttrGet(blkdev.boot_drv_let); + Fs->catch_except=TRUE; + } + } if (task->title_src==TTS_TASK_NAME) StrCpy(task->task_title,task->task_name); if ((doc=DocDisplay(task)) && !(doc->flags&DOCF_DONT_SHOW)) diff --git a/Adam/Menu.HC b/Adam/Menu.HC index f804781..c1b62d3 100644 --- a/Adam/Menu.HC +++ b/Adam/Menu.HC @@ -4,7 +4,7 @@ CTask *MenuTask() { CTask *res=sys_focus_task; - while (res && !res->cur_menu) + while (res && TaskValidate(res) && !res->cur_menu) res=res->parent_task; return res; } diff --git a/Adam/Net/Http.HC b/Adam/Net/Http.HC index e0d7438..c47ac8e 100644 --- a/Adam/Net/Http.HC +++ b/Adam/Net/Http.HC @@ -9,7 +9,7 @@ #define HTTP_ECONTENTLENGTH (-106) #define HTTP_MAX_REDIRECTS 5 -#define HTTP_USER_AGENT "Adam/Net/Http ($TX+CX,"TinkerOS V5.10",D="DD_OS_NAME_VERSION"$)" +#define HTTP_USER_AGENT "Adam/Net/Http ($TX+CX,"TinkerOS V5.11",D="DD_OS_NAME_VERSION"$)" /** * @param len_out (required) requires the content length, or -1 if unspecified diff --git a/Adam/Opt/Boot/BootHDIns.HC b/Adam/Opt/Boot/BootHDIns.HC index 9d563aa..549a8f2 100644 --- a/Adam/Opt/Boot/BootHDIns.HC +++ b/Adam/Opt/Boot/BootHDIns.HC @@ -20,26 +20,6 @@ U0 MakeAll() throw; } -U0 MakeAllDef() -{// Try to automatically recompile both compiler and kernel - U8 *def_cfg; - I64 cur_drv_hint=-1; - if (HashFind("CUR_DRV_HINT",adam_task->hash_table,HTT_DEFINE_STR)) - { - cur_drv_hint=ExePrint("CUR_DRV_HINT;\n")(I64); - if (cur_drv_hint>=0) - { - if (AHCIMode) def_cfg=MStrPrint("\nB\nScale2Mem(2048,0x40000)\n%c\n%d\n\n\n\n",blkdev.boot_drv_let,cur_drv_hint); - else def_cfg=MStrPrint("\nB\nScale2Mem(2048,0x40000)\n%c\np%d\n\n\n\n",blkdev.boot_drv_let,cur_drv_hint); - In(def_cfg); - MakeAll; - Free(def_cfg); - return; - } - } - "Cannot make default config, from this kernel, use MakeAll and set options manually!\n"; -} - public U0 BootHDIns(U8 drv_let=0) { //$LK,"MakeAll",A="MN:MakeAll"$ and install new boot-loader. @@ -90,3 +70,29 @@ public U0 BootHDIns(U8 drv_let=0) Beep; } } + +U0 MakeAllDef(Bool install=FALSE) +{// Try to automatically recompile both compiler and kernel + U8 *def_cfg; + I64 cur_drv_hint=-1; + if (HashFind("CUR_DRV_HINT",adam_task->hash_table,HTT_DEFINE_STR)) + { + cur_drv_hint=ExePrint("CUR_DRV_HINT;\n")(I64); + if (cur_drv_hint>=0) + { + if (AHCIMode) def_cfg=MStrPrint("\nB\nScale2Mem(2048,0x40000)\n%c\n%d\n\n\n\n",blkdev.boot_drv_let,cur_drv_hint); + else def_cfg=MStrPrint("\nB\nScale2Mem(2048,0x40000)\n%c\np%d\n\n\n\n",blkdev.boot_drv_let,cur_drv_hint); + In(def_cfg); + if (install) BootHDIns(blkdev.boot_drv_let); + else MakeAll; + Free(def_cfg); + return; + } + } + "Cannot make default config, from this kernel, use MakeAll and set options manually!\n"; +} + +U0 MakeAllIns() +{ + MakeAllDef(TRUE); +} diff --git a/Adam/Opt/Utils/SysRep.HC b/Adam/Opt/Utils/SysRep.HC index ac7dd55..6d37b18 100644 --- a/Adam/Opt/Utils/SysRep.HC +++ b/Adam/Opt/Utils/SysRep.HC @@ -804,7 +804,7 @@ start: break; case SMBIOSt_PROCESSOR: CSMBIOSProcessorInfo *p_info = header; - CRAXRBCRCXRDX regs; + CRAXRBXRCXRDX regs; CPUId(1, ®s); "$$TR-C,\"Processor\"$$\n"; "$$FD,CYAN$$"; @@ -1026,8 +1026,11 @@ start: "%d $MA-X+PU,"MT/s",LM="\"megatransfers per second\";View;"$$$FG$$\n", mem_info->configured_speed; else "Unknown$$FG$$\n"; + if (!survey) + { "Serial Number:$$BLACK$$%s$$FG$$\n" , SMBIOSStr(header, mem_info->serial_number); + } "Part Number:$$BLACK$$%s$$FG$$\n" , SMBIOSStr(header, mem_info->part_number); "Asset Tag:$$BLACK$$%s$$FG$$\n" @@ -1135,11 +1138,14 @@ start: "%d$$FG$$\n", bat_info->max_battery_data_error; else "Unknown$$FG$$\n"; + if (!survey) + { "Serial Number:$$BLACK$$"; if (bat_info->serial_number) "%s$$FG$$\n", SMBIOSStr(header, bat_info->serial_number); else "%d$$FG$$\n", bat_info->sbds_serial_number; + } "$$ID,-3$$"; break; case SMBIOSt_OEM_STRINGS: diff --git a/Adam/Opt/Utils/SysSurvey.HC b/Adam/Opt/Utils/SysSurvey.HC index 60090ad..fcd6fb3 100644 --- a/Adam/Opt/Utils/SysSurvey.HC +++ b/Adam/Opt/Utils/SysSurvey.HC @@ -135,6 +135,8 @@ U0 RunSysSurvey() "Survey and System Results:\n\n"; + "OS: TinkerOS V%5.3f\t%D %T\n\n",sys_os_version,sys_compile_time,sys_compile_time; + "Current graphics mode: %d x %d (%d by %d framebuffer)\n\n",GR_WIDTH,GR_HEIGHT,FB_WIDTH,FB_HEIGHT; "Current disk mode: "; if (AHCIMode) "AHCI\n\n"; else "IDE/Legacy\n\n"; diff --git a/Adam/WinMgr.HC b/Adam/WinMgr.HC index d94f842..11933cd 100644 --- a/Adam/WinMgr.HC +++ b/Adam/WinMgr.HC @@ -74,7 +74,7 @@ I64 WinQueIPMsgs(Bool que) F64 time=tS; I64 msg_code=0,arg1,arg2,single_arg1,single_arg2; CTask *task_focus=sys_focus_task; - if (task_focus && !winmgr.grab_scroll) + if (task_focus && TaskValidate(task_focus) && !winmgr.grab_scroll) { arg1=ms.pos.x-task_focus->pix_left-task_focus->scroll_x; arg2=ms.pos.y-task_focus->pix_top-task_focus->scroll_y; diff --git a/Compiler/PrsVar.HC b/Compiler/PrsVar.HC index d47e1ad..8451036 100644 --- a/Compiler/PrsVar.HC +++ b/Compiler/PrsVar.HC @@ -219,9 +219,17 @@ U0 PrsVarInit2(CCmpCtrl *cc,U8 **_dst,CHashClass *tmpc, PrsVarInit2(cc,_dst,tmpc,tmpad1,data_addr_rip,_base,data_heap,pass); if (tmpad1->cnt>1 && cc->token==',') Lex(cc); + if (cc->token=='}') + { + Lex(cc); + break; + } + } + if (icnt-1) + { + LexWarn(cc,"Not all array entires specified, undefined values will contain undefined data "); + tmpad1->cnt=i+1; } - if (cc->token=='}') - Lex(cc); } } } diff --git a/Demo/AcctExample/TOS/TOSDistro.HC b/Demo/AcctExample/TOS/TOSDistro.HC index 79c798c..4fec5bd 100644 --- a/Demo/AcctExample/TOS/TOSDistro.HC +++ b/Demo/AcctExample/TOS/TOSDistro.HC @@ -131,7 +131,7 @@ U0 MakeStdDistro() StdDistroPrep; RedSeaISO(TOS_ISO_NAME,TOS_DISTRO_DIR,TOS_DISTRO_DIR BOOT_DIR_KERNEL_BIN_C); DefinePrint("DD_TEMPLEOSCD_SIZE", - "Download $TX,"TinkerOS V5.10",D="DD_OS_NAME_VERSION"$ - Standard Distro (%0.1fMB)", + "Download $TX,"TinkerOS V5.11",D="DD_OS_NAME_VERSION"$ - Standard Distro (%0.1fMB)", 0.1*(10*Size(TOS_ISO_NAME,"+s")/1024/1024)); Drv('C'); } @@ -162,7 +162,7 @@ U0 MakeLiteDistro() LiteDistroPrep; RedSeaISO(TOS_ISO_NAME,TOS_DISTRO_DIR,TOS_DISTRO_DIR BOOT_DIR_KERNEL_BIN_C); DefinePrint("DD_TEMPLEOSCD_SIZE", - "Download $TX,"TinkerOS V5.10",D="DD_OS_NAME_VERSION"$ - Standard Distro (%0.1fMB)", + "Download $TX,"TinkerOS V5.11",D="DD_OS_NAME_VERSION"$ - Standard Distro (%0.1fMB)", 0.1*(10*Size(TOS_ISO_NAME,"+s")/1024/1024)); Drv('C'); } @@ -188,7 +188,7 @@ U0 MakeDbgDistro() DbgDistroPrep; RedSeaISO(TOS_ISO_NAME,TOS_DISTRO_DIR,TOS_DISTRO_DIR BOOT_DIR_KERNEL_BIN_C); DefinePrint("DD_TEMPLEOS_DBG_SIZE", - "Download $TX,"TinkerOS V5.10",D="DD_OS_NAME_VERSION"$ - Debug Distro (%0.1fMB)", + "Download $TX,"TinkerOS V5.11",D="DD_OS_NAME_VERSION"$ - Debug Distro (%0.1fMB)", 0.1*(10*Size(TOS_ISO_NAME,"+s")/1024/1024)); Drv('C'); } @@ -212,7 +212,7 @@ U0 MakeStaffDistro() StaffDistroPrep; RedSeaISO(TOS_ISO_NAME,TOS_DISTRO_DIR,TOS_DISTRO_DIR BOOT_DIR_KERNEL_BIN_C); DefinePrint("DD_TEMPLEOS_STAFF_SIZE", - "Download $TX,"TinkerOS V5.10",D="DD_OS_NAME_VERSION"$ - T.S. Company Internal Distro (%0.1fMB)", + "Download $TX,"TinkerOS V5.11",D="DD_OS_NAME_VERSION"$ - T.S. Company Internal Distro (%0.1fMB)", 0.1*(10*Size(TOS_ISO_NAME,"+s")/1024/1024)); Drv('C'); } @@ -246,7 +246,7 @@ U0 UpdateISODocDefines() try { DefinePrint("DD_TEMPLEOSCD_SIZE", - "Download $TX,"TinkerOS V5.10",D="DD_OS_NAME_VERSION"$ - Standard Distro (%0.1fMB)", + "Download $TX,"TinkerOS V5.11",D="DD_OS_NAME_VERSION"$ - Standard Distro (%0.1fMB)", 0.1*(10*Size("D:/Downloads/TOS_Distro.ISO","+s")/1024/1024)); DefinePrint("DD_TEMPLEOSCD_K_SIZE", "%dKB",Size("D:/Downloads/TOS_Distro.ISO","+s")/1024); diff --git a/Doc/Baremetal/Baremetal.DD b/Doc/Baremetal/Baremetal.DD new file mode 100644 index 0000000..9dab0fc --- /dev/null +++ b/Doc/Baremetal/Baremetal.DD @@ -0,0 +1,9 @@ +$WW,1$$FG,5$$TX+CX,"Baremetal Installs"$$FG$ + +$TR,"Dell Latitude D630 Laptop"$ +$ID,2$$LK,"System Survey Results",A="FI:/Doc/Baremetal/Machines/DellD630.DD.Z"$ +$TX,"Baremetal Install of TempleOS/TinkerOS Quad-Boot Video",HTML="https://www.youtube.com/watch?v=NHDG4gu1daE"$ +$ID,-2$ + + +$FG$ diff --git a/Doc/Baremetal/Machines/DellD630.DD b/Doc/Baremetal/Machines/DellD630.DD new file mode 100644 index 0000000..342f9ab --- /dev/null +++ b/Doc/Baremetal/Machines/DellD630.DD @@ -0,0 +1,259 @@ +$WW+H,1$Survey and System Results: + +Current graphics mode: 800 x 600 (800 by 600 framebuffer) + +Current disk mode: IDE/Legacy + +Current boot drive: F + +Laptop: Yes + +Dock with useful ports available: Yes + +Is AHCI mode supported in BIOS: Yes + +Is Legacy/IDE mode supported in BIOS: Yes + +Does PS/2 emulation of a USB keyboard work: Yes + +Does PS/2 emulation of a USB mouse work: Yes + +Does your system have a PS/2 mouse or combo port: No + +Does your system have a serial port: Yes + +Does your system have a parallel port: No + +Can you install and run TempleOS bare metal: Yes + +Can you install and run TinkerOS bare metal: Yes + +Did the automatic installer work: Yes + +Did you manually partition and format the drive: No + +Did you manually have to enter IO port numbers: No + +Extra notes: + +Dock has parallel port and PS/2 mouse/keyboard ports. + +Results from SysRepSurvey: + +SMBIOS version 2.4 (62 entries) +$TR-C,"BIOS"$ +$FD,3$$ID,3$Vendor:$FG,0$Dell Inc.$FG$ +Version:$FG,0$A17$FG$ +Release Date:$FG,0$01/04/2010 (mm/dd/yyyy)$FG$ +Release Version:$FG,0$1.7$FG$ +Start Address:$FG,0$0xF0000$FG$ +Image Size:$FG,0$65536 bytes$FG$ +ROM Size:$FG,0$2048 KiB$FG$ +$TR,"Flags"$$ID,17$ +$FG,1$+$FG,2$ISA +$FG,1$+$FG,2$PCI +$FG,1$+$FG,2$PC Card +$FG,1$+$FG,2$Plug and Play +$FG,1$+$FG,2$Flashable BIOS +$FG,1$+$FG,2$BIOS shadowing +$FG,1$+$FG,2$CD Boot +$FG,1$+$FG,2$Selectable boot +$FG,1$+$FG,2$INT 0x13 3.5"/720 KB Floppy Support +$FG,1$+$FG,2$INT 0x05 Screen Printing +$FG,1$+$FG,2$INT 0x09 8042 Keyboard +$FG,1$+$FG,2$INT 0x14 Serial +$FG,1$+$FG,2$INT 0x17 Printer +$FG,1$+$FG,2$INT 0x10 CGA/Mono Video +$FG,1$+$FG,2$ACPI +$FG,1$+$FG,2$USB Legacy +$FG,1$+$FG,2$Smart Battery +$FG,1$+$FG,2$BIOS Boot +$FG,1$+$FG,2$Network Boot +$FG,1$+$FG,2$Targeted Content Distribution$ID,-17$$FG$ +$ID,-3$$TR-C,"System"$ +$FD,3$$ID,3$Manufacturer:$FG,0$Dell Inc.$FG$ +Product Name:$FG,0$Latitude D630 $FG$ +Version:$FG,0$None$FG$ +$ID,-3$$TR-C,"Baseboard"$ +$FD,3$$ID,3$Manufacturer:$FG,0$Dell Inc.$FG$ +Product:$FG,0$0WM416$FG$ +Version:$FG,0$ $FG$ +$ID,-3$$TR-C,"Processor"$ +$FD,3$$ID,3$Socket Name:$FG,0$Microprocessor$FG$ +Processor Type:$FG,0$Central Processor$FG$ +Status:$FG,0$Socket Populated, CPU Enabled$FG$ +Core Count:$FG,0$2$FG$ +Cores Enabled:$FG,0$2$FG$ +Manufacturer:$FG,0$Intel$FG$ +Name:$FG,0$None$FG$ +Family:$FG,0$6$FG$ +Model:$FG,0$240$FG$ +Stepping:$FG,0$13$FG$ +Current Speed:$FG,0$2.0 GHz$FG$ +Max Speed:$FG,0$2.0 GHz$FG$ +Socket:$FG,0$None$FG$ +Voltage:$FG,0$3.3V$FG$ +External Clock:$FG,0$200 MHz$FG$ +$TR,"Processor Flags"$$ID,17$ +$FG,1$+$FG,2$64 Bit$ID,-17$$FG$ +$TR,"CPUID 0x1 Flags"$$ID,17$ +$FG,1$+$FG,2$x87 FPU +$FG,1$+$FG,2$Virtual 8086 Mode Enhancements +$FG,1$+$FG,2$Debugging Extensions +$FG,1$+$FG,2$Page Size Extensions +$FG,1$+$FG,2$Time Stamp Counter +$FG,1$+$FG,2$MSRs +$FG,1$+$FG,2$Page Address Extension +$FG,1$+$FG,2$Machine Check Exceptions +$FG,1$+$FG,2$CMPXCHG8B +$FG,1$+$FG,2$APIC +$FG,1$+$FG,2$SYSENTER/SYSEXIT +$FG,1$+$FG,2$Memory Type Range Registers +$FG,1$+$FG,2$Page Glbl Bit +$FG,1$+$FG,2$Machine Check Architecture +$FG,1$+$FG,2$CMOV Instructions +$FG,1$+$FG,2$Page Attribute Table +$FG,1$+$FG,2$36 Bit Page Size Extension +$FG,1$+$FG,2$CLFLUSH +$FG,1$+$FG,2$Dbg Store +$FG,1$+$FG,2$ACPI +$FG,1$+$FG,2$MMX +$FG,1$+$FG,2$FXSAVE/FXRSTOR +$FG,1$+$FG,2$SSE +$FG,1$+$FG,2$SSE2 +$FG,1$+$FG,2$Self Snoop +$FG,1$+$FG,2$HTT +$FG,1$+$FG,2$Thermal Monitor +$FG,1$+$FG,2$Pending Break Enable +$FG,1$+$FG,2$SSE3 +$FG,1$+$FG,2$64 bit DS AREA +$FG,1$+$FG,2$MONITOR/MWAIT +$FG,1$+$FG,2$CPL Qualified Dbg Store +$FG,1$+$FG,2$Virtual Machine Extensions +$FG,1$+$FG,2$Thermal Monitor 2 +$FG,1$+$FG,2$SSSE3 +$FG,1$+$FG,2$CMPXCHG16B +$FG,1$+$FG,2$xTPR Update Control +$FG,1$+$FG,2$Perfmon and Dbg Capability$ID,-17$$FG$ +$TR,"L1 Cache Info"$ +$FD,3$$ID,3$Name:$FG,0$None$FG$ +Status:$FG,0$Enabled$FG$ +Mode:$FG,0$Write-Back$FG$ +Type:$FG,0$Data$FG$ +Location:$FG,0$CPU Internal$FG$ +Socketed:$FG,0$No$FG$ +Max Cache Size:$FG,0$32 KB$FG$ +Installed Size:$FG,0$32 KB$FG$ +Supported SRAM Types:$FG,0$Unknown$FG$ +Installed SRAM Type:$FG,0$Unknown$FG$ +Cache Speed:$FG,0$Unknown$FG$ +ECC type:$FG,0$None$FG$ +Associativity:$FG,0$4-way Set-Associative$FG$ +$ID,-3$$TR,"L2 Cache Info"$ +$FD,3$$ID,3$Name:$FG,0$None$FG$ +Status:$FG,0$Enabled$FG$ +Mode:$FG,0$Varies with Memory Address$FG$ +Type:$FG,0$Unified$FG$ +Location:$FG,0$CPU Internal$FG$ +Socketed:$FG,0$No$FG$ +Max Cache Size:$FG,0$2048 KB$FG$ +Installed Size:$FG,0$2048 KB$FG$ +Supported SRAM Types:$FG,0$Pipeline Burst$FG$ +Installed SRAM Type:$FG,0$Pipeline Burst$FG$ +Cache Speed:$FG,0$15 nS$FG$ +ECC type:$FG,0$None$FG$ +Associativity:$FG,0$Other$FG$ +$ID,-3$$ID,-3$$TR,"Port Connector"$ +$FD,3$$ID,3$Port Type:$FG,0$Serial Port 16550A Compatible$FG$ +External Name:$FG,0$None$FG$ +Internal Name:$FG,0$SERIAL1$FG$ +External Type:$FG,0$DB-9 Pin Male$FG$ +Internal Type:$FG,0$None$FG$ +$ID,-3$$TR,"Port Connector"$ +$FD,3$$ID,3$Port Type:$FG,0$USB$FG$ +External Name:$FG,0$None$FG$ +Internal Name:$FG,0$USB$FG$ +External Type:$FG,0$Access Bus (USB)$FG$ +Internal Type:$FG,0$None$FG$ +$ID,-3$$TR,"Port Connector"$ +$FD,3$$ID,3$Port Type:$FG,0$Video Port$FG$ +External Name:$FG,0$None$FG$ +Internal Name:$FG,0$MONITOR$FG$ +External Type:$FG,0$DB-15 Pin Female$FG$ +Internal Type:$FG,0$None$FG$ +$ID,-3$$TR,"Port Connector"$ +$FD,3$$ID,3$Port Type:$FG,0$FireWire (IEEE 1394)$FG$ +External Name:$FG,0$None$FG$ +Internal Name:$FG,0$FireWire$FG$ +External Type:$FG,0$1394$FG$ +Internal Type:$FG,0$None$FG$ +$ID,-3$$TR,"Port Connector"$ +$FD,3$$ID,3$Port Type:$FG,0$Modem Port$FG$ +External Name:$FG,0$None$FG$ +Internal Name:$FG,0$Modem$FG$ +External Type:$FG,0$RJ-11$FG$ +Internal Type:$FG,0$None$FG$ +$ID,-3$$TR,"Port Connector"$ +$FD,3$$ID,3$Port Type:$FG,0$Network Port$FG$ +External Name:$FG,0$None$FG$ +Internal Name:$FG,0$Ethernet$FG$ +External Type:$FG,0$RJ-45$FG$ +Internal Type:$FG,0$None$FG$ +$ID,-3$$TR,"Slot"$ +$FD,3$$ID,3$Name:$FG,0$PCMCIA 0$FG$ +Type:$FG,0$PC Card (PCMCIA)$FG$ +Data Bus Width:$FG,0$32 Bit$FG$ +Current Usage:$FG,0$Available$FG$ +Slot Length:$FG,0$Other$FG$ +Segment Group:$FG,0$17232$FG$ +Bus:$FG,0$77$FG$ +Device:$FG,0$8$FG$ +Function:$FG,0$3$FG$ +$TR,"Flags"$$ID,17$ +$FG,1$+$FG,2$5.0 V +$FG,1$+$FG,2$3.3 V +$FG,1$+$FG,2$PC Card 16 +$FG,1$+$FG,2$CardBus +$FG,1$+$FG,2$Zoom Video +$FG,1$+$FG,2$Modem Ring Resume$ID,-17$$FG$ +$ID,-3$$TR,"Memory Array"$ +$FD,3$$ID,3$Location:$FG,0$Motherboard$FG$ +Use:$FG,0$System Memory$FG$ +Error Correction:$FG,0$None$FG$ +Max Capacity:$FG,0$4096 MB$FG$ +Mem Device Count:$FG,0$2$FG$ +$TR,"Memory Devices"$ +$ID,3$$TR,"Memory Device"$ +$FD,3$$ID,3$Device Location:$FG,0$DIMM_A$FG$ +Bank Location:$FG,0$None$FG$ +Manufacturer:$FG,0$AD00000000000000$FG$ +Size:$FG,0$1024 MB$FG$ +Total Width:$FG,0$64 bits$FG$ +Data Width:$FG,0$64 bits$FG$ +Max Speed:$FG,0$667 $MA-X+PU,"MT/s",LM="\"megatransfers per second\";View;"$$FG$ +Configured Speed:$FG,0$65 $MA-X+PU,"MT/s",LM="\"megatransfers per second\";View;"$$FG$ +Serial Number:$FG,0$04008085$FG$ +Part Number:$FG,0$HYMP112S64CP6-Y5 $FG$ +Asset Tag:$FG,0$410813$FG$ +Form Factor:$FG,0$TSOP$FG$ +Type:$FG,0$DDR2$FG$ +$TR,"Type Flags"$$ID,17$ +$FG,1$+$FG,2$Synchronous$ID,-17$$FG$ +$ID,-3$$TR,"Memory Device"$ +$FD,3$$ID,3$Device Location:$FG,0$DIMM_B$FG$ +Bank Location:$FG,0$None$FG$ +Manufacturer:$FG,0$AD00000000000000$FG$ +Size:$FG,0$1024 MB$FG$ +Total Width:$FG,0$64 bits$FG$ +Data Width:$FG,0$64 bits$FG$ +Max Speed:$FG,0$667 $MA-X+PU,"MT/s",LM="\"megatransfers per second\";View;"$$FG$ +Configured Speed:$FG,0$66 $MA-X+PU,"MT/s",LM="\"megatransfers per second\";View;"$$FG$ +Serial Number:$FG,0$04004079$FG$ +Part Number:$FG,0$HYMP112S64CP6-Y5 $FG$ +Asset Tag:$FG,0$410813$FG$ +Form Factor:$FG,0$TSOP$FG$ +Type:$FG,0$DDR2$FG$ +$TR,"Type Flags"$$ID,17$ +$FG,1$+$FG,2$Synchronous$ID,-17$$FG$ +$ID,-3$$FD,1$$ID,-3$$ID,-3$$TR,"Temperature Probe"$ +$FD,1$ \ No newline at end of file diff --git a/Doc/Start.DD b/Doc/Start.DD index 2a86484..a9105cc 100644 --- a/Doc/Start.DD +++ b/Doc/Start.DD @@ -1,4 +1,4 @@ -$WW+H,1$$FG,5$$TX+CX,"TinkerOS V5.10",D="DD_OS_NAME_VERSION"$$FG$ +$WW+H,1$$FG,5$$TX+CX,"TinkerOS V5.11",D="DD_OS_NAME_VERSION"$$FG$ $TX+CX,"Public Domain Operating System"$ diff --git a/Doc/Web.DD b/Doc/Web.DD index c38dc74..36a0c0f 100644 --- a/Doc/Web.DD +++ b/Doc/Web.DD @@ -1,4 +1,4 @@ -$WW+H,1$$FG,5$$TX+CX,"TinkerOS V5.10",D="DD_OS_NAME_VERSION"$$FG$ +$WW+H,1$$FG,5$$TX+CX,"TinkerOS V5.11",D="DD_OS_NAME_VERSION"$$FG$ $TX+CX,"Public Domain Operating System"$ diff --git a/Kernel/BlkDev/DskDirB.HC b/Kernel/BlkDev/DskDirB.HC index 4f36f28..1b46489 100644 --- a/Kernel/BlkDev/DskDirB.HC +++ b/Kernel/BlkDev/DskDirB.HC @@ -190,7 +190,14 @@ I64 Dir(U8 *files_find_mask="*",Bool full=FALSE) Bool IsFile(U8* filename) { - I64 old_silent=Silent, res=Dir(filename); + I64 old_silent=Silent, res; + try { + res=Dir(filename); + } + catch { + res=0; + Fs->catch_except=TRUE; + } Silent(old_silent); return res>0; } diff --git a/Kernel/BlkDev/DskStrA.HC b/Kernel/BlkDev/DskStrA.HC index 45b7948..a2cb6fa 100644 --- a/Kernel/BlkDev/DskStrA.HC +++ b/Kernel/BlkDev/DskStrA.HC @@ -324,8 +324,16 @@ U8 *DirCur(CTask *task=NULL,CTask *mem_task=NULL) if (!task->cur_dir) return NULL; st=MAlloc(StrLen(task->cur_dir)+3,mem_task); - *st=Drv2Let(task->cur_dv); st[1]=':'; + try { + *st=Drv2Let(task->cur_dv); + } + catch { + *st=blkdev.boot_drv_let; + st[2]=0; + Fs->catch_except=TRUE; + Cd(st); + } StrCpy(st+2,task->cur_dir); return st; } diff --git a/Kernel/KExts.HC b/Kernel/KExts.HC index b9e721a..832f46c 100644 --- a/Kernel/KExts.HC +++ b/Kernel/KExts.HC @@ -10,6 +10,7 @@ import U0 ClassRep(U8 *_d,U8 *class_name=lastclass, import U8 *DocSave(CDoc *doc,I64 *_size=NULL); import Bool DocUnlock(CDoc *doc); import Bool Ed(U8 *link_st,I64 edf_dof_flags=0); +import U0 PCILookUpDev(I64 vendor, I64 dev); extern U0 AdamErr(U8 *fmt,...); extern U0 AdamLog(U8 *fmt,...); extern I64 BIOSTotalMem(); diff --git a/Kernel/KGlbls.HC b/Kernel/KGlbls.HC index 2fa4051..b95184a 100644 --- a/Kernel/KGlbls.HC +++ b/Kernel/KGlbls.HC @@ -22,7 +22,7 @@ U8 *rev_bits_table, //Table with U8 bits revd *set_bits_table; //Table with count of set bits in a U8 CDate local_time_offset; F64 *pow10_I64, - sys_os_version=5.100; + sys_os_version=5.110; CAutoCompleteDictGlbls acd; CAutoCompleteGlbls ac; diff --git a/Kernel/KMain.HC b/Kernel/KMain.HC index 94cf05f..8c50ade 100644 --- a/Kernel/KMain.HC +++ b/Kernel/KMain.HC @@ -1,7 +1,7 @@ U0 SysGlblsInit() { I64 i,j; - CRAXRBCRCXRDX ee; + CRAXRBXRCXRDX ee; CPUId(0x1,&ee); sys_cache_line_width=ee.rbx.u8[1]*8; CPUId(0x40000000,&ee); diff --git a/Kernel/KernelA.HH b/Kernel/KernelA.HH index 7124f6e..42a5d74 100644 --- a/Kernel/KernelA.HH +++ b/Kernel/KernelA.HH @@ -685,6 +685,12 @@ public class CCntsGlbls #define SF_ARG7 0x40 #define SF_ARG8 0x48 +class CRAXRBXRCXRDX +{ + I64 rax,rbx,rcx,rdx; +}; + +// Copy kept just for compiling TempleOS kernel class CRAXRBCRCXRDX { I64 rax,rbx,rcx,rdx; diff --git a/Kernel/KernelB.HH b/Kernel/KernelB.HH index 5c57c66..44efd37 100644 --- a/Kernel/KernelB.HH +++ b/Kernel/KernelB.HH @@ -265,7 +265,7 @@ public _intern IC_SET_RBP U0 SetRBP(U8 *d); //Set RBP register value. public _intern IC_SET_RFLAGS U0 SetRFlags(I64 d); //Set RFlags register value. public _intern IC_SET_RSP U0 SetRSP(U8 *d); //Set RSP register value. public _extern _CPUID U0 CPUId( - U32 rax,CRAXRBCRCXRDX *res); //Do CPUID inst. + U32 rax,CRAXRBXRCXRDX *res); //Do CPUID inst. public _extern _LXCHG_I64 I64 LXchgI64(I64 *dst,I64 d); //Locked eXchange I64s. public _extern _LXCHG_U16 U16 LXchgU16(U16 *dst,U16 d); //Locked eXchange U16s. public _extern _LXCHG_U32 U32 LXchgU32(U32 *dst,U32 d); //Locked eXchange U32s. diff --git a/Kernel/KernelC.HH b/Kernel/KernelC.HH index 9ef843d..b67c1e3 100644 --- a/Kernel/KernelC.HH +++ b/Kernel/KernelC.HH @@ -598,6 +598,8 @@ public extern I64 ScanChar(); public extern Bool ScanKey(I64 *_ch=NULL,I64 *_scan_code=NULL,Bool echo=FALSE); public extern Bool YorN(I64 enter_default=0); public extern CKbdStateGlbls kbd; +public extern U0 MsPktInject(U8 *pkt); +public extern U0 KbdPktInject(U8 *pkt); #help_index "Math" public extern I64 CeilI64(I64 num,I64 to); diff --git a/Kernel/MultiProc.HC b/Kernel/MultiProc.HC index da1baad..55c035d 100644 --- a/Kernel/MultiProc.HC +++ b/Kernel/MultiProc.HC @@ -305,7 +305,7 @@ U0 Core0StartMP() CAP16BitInit *mp=MP_VECT_ADDR; CCPU *c; I64 i,my_mp_cnt; - CRAXRBCRCXRDX ee; + CRAXRBXRCXRDX ee; CPUId(0x1,&ee); if (!Bt(&ee.rdx,9)) { @@ -374,7 +374,7 @@ U0 Core0StartMP() U0 Core0Init() {//Called by adam during start-up - CRAXRBCRCXRDX ee; + CRAXRBXRCXRDX ee; CPUId(0x1,&ee); mp_cnt_initial=mp_cnt=1; mp_cnt_lock=0; @@ -401,10 +401,17 @@ interrupt U0 IntMPCrash() //Which calls this routine. *(dev.uncached_alias+LAPIC_EOI)(U32 *)=0; mp_cnt=1; - Raw(ON); - text.raw_flags|=RWF_SHOW_DOLLAR; - "MP Crash CPU%02X Task:%08X\n" - "RIP:%P\n" - ,dbg.mp_crash->cpu_num,dbg.mp_crash->task,dbg.mp_crash->rip; - Panic(dbg.mp_crash->msg,dbg.mp_crash->msg_num); + // For now ignore an MP crash during boot and + // try to continue with a single core since + // you probably can't debug it in an early + // boot stage anyway + if (Bt(&sys_run_level,RLf_DOC)) + { + Raw(ON); + text.raw_flags|=RWF_SHOW_DOLLAR; + "MP Crash CPU%02X Task:%08X\n" + "RIP:%P\n" + ,dbg.mp_crash->cpu_num,dbg.mp_crash->task,dbg.mp_crash->rip; + Panic(dbg.mp_crash->msg,dbg.mp_crash->msg_num); + } } diff --git a/Kernel/PCIEACPI.HC b/Kernel/PCIEACPI.HC index 1b39b9c..4042e71 100644 --- a/Kernel/PCIEACPI.HC +++ b/Kernel/PCIEACPI.HC @@ -843,6 +843,7 @@ U0 EnumPcieDeviceIds(mcfg_entry *arr, I64 n) header_type = PcieCfgRead(cfg_space, PCI_HEADER_TYPE, 1); irq_pin=PcieCfgRead(cfg_space,PCI_INTERRUPT_PIN,1); irq_line=PcieCfgRead(cfg_space,PCI_INTERRUPT_LINE,1); + PCILookUpDev(vendor_id,device_id); "Bus %d Device %d Func %d Header Type %02x Vendor ID %04x Device ID %04x\n" ,Bus,Device,Function,header_type,vendor_id,device_id; "Class %02x Sub-Class %02x IRQ line: %d IRQ pin %02x\n" diff --git a/Kernel/SerialDev/Keyboard.HC b/Kernel/SerialDev/Keyboard.HC index 432543f..9c78b67 100644 --- a/Kernel/SerialDev/Keyboard.HC +++ b/Kernel/SerialDev/Keyboard.HC @@ -598,15 +598,21 @@ U0 KbdInit() OutU8(0x21,InU8(0x21)&~2); } -U0 KbdHndlr() +U0 KbdHndlr(U8 *pkt=NULL) { static U8 last_raw_byte=0; U8 raw_byte; - FifoU8Rem(kbd.fifo2,&raw_byte); + if (pkt) + raw_byte = pkt[0]; + else + FifoU8Rem(kbd.fifo2,&raw_byte); KbdBuildSC(raw_byte,FALSE,&last_raw_byte,&kbd.scan_code); if (raw_byte==0xE0) { - FifoU8Rem(kbd.fifo2,&raw_byte); + if (pkt) + raw_byte = pkt[1]; + else + FifoU8Rem(kbd.fifo2,&raw_byte); KbdBuildSC(raw_byte,FALSE,&last_raw_byte,&kbd.scan_code); } if (Btr(&kbd.scan_code,SCf_NEW_KEY)) @@ -668,3 +674,12 @@ I64 KbdMsEvtTime() else return kbd.new_key_timestamp; } + +public U0 KbdPktInject(U8 *pkt) +{// Inject a 1 or 2 byte keyboard packet from an external non-PS/2 source + PUSHFD + CLI + kbd.timestamp=GetTSC; + KbdHndlr(pkt); + POPFD +} diff --git a/Kernel/SerialDev/Message.HC b/Kernel/SerialDev/Message.HC index 7975690..839cb1f 100644 --- a/Kernel/SerialDev/Message.HC +++ b/Kernel/SerialDev/Message.HC @@ -51,6 +51,7 @@ I64 ScanMsg(I64 *_arg1=NULL,I64 *_arg2=NULL,I64 mask=~1,CTask *task=NULL) if (!task) task=Fs; old_flags=GetRFlags; tmpc1=&task->srv_ctrl.next_waiting; + if (!TaskValidate(task)) return NULL; while (TRUE) { CLI diff --git a/Kernel/SerialDev/Mouse.HC b/Kernel/SerialDev/Mouse.HC index b3a1592..5d10283 100644 --- a/Kernel/SerialDev/Mouse.HC +++ b/Kernel/SerialDev/Mouse.HC @@ -317,7 +317,7 @@ public U0 MsHardHndlr(U8 *pkt=NULL) } else { - for (i=0; i<4; i++) + for (i=0; icatch_except=TRUE; + } + Sleep(100); + timeout+=100; + } + Silent(old_silent); + Free(st); + + if (timeout>DRV_WAIT_TIMEOUT_MS) + { + "Failed to write to drive %C, install cannot continue!\n",drv_let; + return; + } + if (templeos) { if (!DrvMounted('M')) @@ -353,7 +381,7 @@ U0 VMInstall(Bool just_std_ide=TRUE, InstallOptions *cfg) CATARep *head=NULL,*ata_drv=NULL,*atapi_drv=NULL; CATARep hd,cd; CTask *task; - I64 i, atapi_port = -1, ata_port = -1, first_hd=-1; + I64 i, timeout=0, atapi_port = -1, ata_port = -1, first_hd=-1; CAHCIPort *port; "\nReady to do install, it's normal for this to freeze for a moment or two.\n"; PressAKey; @@ -401,6 +429,17 @@ U0 VMInstall(Bool just_std_ide=TRUE, InstallOptions *cfg) } if ((AHCIMode && VMPrtDskAHCI(task,ata_drv->num,cfg->num)) || VMPrtDsk(task,ata_drv,cfg->num)) { + while (!task->user_data && timeout < DRV_PART_TIMEOUT_MS) + { + Sleep(50); + timeout+=50; + } + if (timeout > DRV_PART_TIMEOUT_MS) + { + "Failed to partition drive in a timely manner!\n"; + "Try partitioning manually with an external tool!\n"; + goto install_end; + } for (i=0; inum; i++) { VMInstallDrv(task,'C'+i,ata_drv,atapi_drv,cfg->res[i],cfg->extras); @@ -408,6 +447,7 @@ U0 VMInstall(Bool just_std_ide=TRUE, InstallOptions *cfg) } BootMHDIns('C'); } + install_end: if (!AHCIMode) { LinkedLstDel(head);