Skip to content
This repository has been archived by the owner on Aug 11, 2024. It is now read-only.

Commit

Permalink
TinkerOS 5.11
Browse files Browse the repository at this point in the history
  • Loading branch information
tinkeros committed Apr 27, 2023
1 parent 2d728f0 commit 5cccd80
Show file tree
Hide file tree
Showing 31 changed files with 470 additions and 62 deletions.
1 change: 1 addition & 0 deletions Adam/ABlkDev/DskPrt.HC
Original file line number Diff line number Diff line change
Expand Up @@ -195,5 +195,6 @@ pd_done:
QueRem(tmppp);
Free(tmppp);
}
Fs->user_data=1;
return total;
}
6 changes: 3 additions & 3 deletions Adam/Device/Comm.HC
Original file line number Diff line number Diff line change
Expand Up @@ -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; bar<PCIR_BASE5; bar+=4)
for (bar=PCIR_BASE0; bar<=PCIR_BASE5; bar+=4)
{
bdf = b << 16 | d << 8 | f;
ioport = PCIReadU32(bdf.u8[2], bdf.u8[1], bdf.u8[0], bar);
Expand Down
12 changes: 11 additions & 1 deletion Adam/Device/DevInfo.HC
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,6 @@ public U0 PCIRep()
tmppci->base_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);
Expand All @@ -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;
}
}

Expand Down Expand Up @@ -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);
}

1 change: 1 addition & 0 deletions Adam/Device/MakeDev.HC
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
Cd(__DIR__);;
#include "Comm"
#include "DevInfo"
#include "SerialMouse"
Cd("..");;
10 changes: 9 additions & 1 deletion Adam/DolDoc/DocRecalcLib.HC
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
2 changes: 1 addition & 1 deletion Adam/Menu.HC
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion Adam/Net/Http.HC
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
46 changes: 26 additions & 20 deletions Adam/Opt/Boot/BootHDIns.HC
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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);
}
8 changes: 7 additions & 1 deletion Adam/Opt/Utils/SysRep.HC
Original file line number Diff line number Diff line change
Expand Up @@ -804,7 +804,7 @@ start:
break;
case SMBIOSt_PROCESSOR:
CSMBIOSProcessorInfo *p_info = header;
CRAXRBCRCXRDX regs;
CRAXRBXRCXRDX regs;
CPUId(1, &regs);
"$$TR-C,\"Processor\"$$\n";
"$$FD,CYAN$$";
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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:
Expand Down
2 changes: 2 additions & 0 deletions Adam/Opt/Utils/SysSurvey.HC
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
2 changes: 1 addition & 1 deletion Adam/WinMgr.HC
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
12 changes: 10 additions & 2 deletions Compiler/PrsVar.HC
Original file line number Diff line number Diff line change
Expand Up @@ -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 (i<tmpad1->cnt-1)
{
LexWarn(cc,"Not all array entires specified, undefined values will contain undefined data ");
tmpad1->cnt=i+1;
}
if (cc->token=='}')
Lex(cc);
}
}
}
Expand Down
10 changes: 5 additions & 5 deletions Demo/AcctExample/TOS/TOSDistro.HC
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}
Expand Down Expand Up @@ -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');
}
Expand All @@ -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');
}
Expand All @@ -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');
}
Expand Down Expand Up @@ -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);
Expand Down
9 changes: 9 additions & 0 deletions Doc/Baremetal/Baremetal.DD
Original file line number Diff line number Diff line change
@@ -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$
Loading

0 comments on commit 5cccd80

Please sign in to comment.