mirror of
https://github.com/Zeal-Operating-System/ZealOS.git
synced 2025-04-18 05:38:36 +01:00
syntax highlighting for numbers
pci_busses -> pci_buses
This commit is contained in:
parent
84ce3bb40f
commit
e56c9b95d6
10 changed files with 1216 additions and 1176 deletions
src
Binary file not shown.
Binary file not shown.
|
@ -1,11 +1,11 @@
|
|||
$WW,1$$FG,5$$TX+CX,"Credits"$$FG$
|
||||
|
||||
I, $FG,2$Terry A. Davis$FG$, wrote all of ZenithOS over the past $TX,"16.5",D="DD_TEMPLEOS_AGE"$ years (full-time). It can run on some bare metal 64-bit PC's from about 2005-2010 with no layering, libraries, tools, modules or anything from other sources. Otherwise, you run it in a virtual machine, like $FG,2$VMware$FG$, $FG,2$QEMU$FG$ or $FG,2$VirtualBox$FG$. It is independent and stands alone. It has no networking, so it certainly doesn't call home. 100% of the src code is including on all distro's, from the kernel to the compiler to the boot loaders! It is public domain, not GPL.
|
||||
I, $FG,2$Terry A. Davis$FG$, wrote all of TempleOS over the past 15.4 years (full-time). It can run on some bare metal 64-bit PC's from about 2005-2010 with no layering, libraries, tools, modules or anything from other sources. Otherwise, you run it in a virtual machine, like $FG,2$VMware$FG$, $FG,2$QEMU$FG$ or $FG,2$VirtualBox$FG$. It is independent and stands alone. It has no networking, so it certainly doesn't call home. 100% of the src code is including on all distro's, from the kernel to the compiler to the boot loaders! It is public domain, not GPL.
|
||||
|
||||
*) $LK,"::/Kernel/FontStd.CC"$, is taken from $FG,4$$TX,"FreeDOS",HTML="http://www.freedos.org"$$FG$. It's public domain.
|
||||
|
||||
*) $LK,"ATA Reg and Cmd Definitions",A="MN:ATA_NOP"$ are originally from Linux. Later, I got the spec.
|
||||
|
||||
|
||||
*) The heap algorithm, $LK,"::/Kernel/Memory/MAllocFree.CC"$, is adapted from one I saw at Ticketmaster when I worked on their VAX operating system.
|
||||
|
||||
*) The LZW compression algorithm, $LK,"::/Kernel/Compress.CC"$, came from a magazine and I implemented it when I worked for Ticketmaster.
|
||||
|
|
BIN
src/Kernel.BIN.C
BIN
src/Kernel.BIN.C
Binary file not shown.
File diff suppressed because it is too large
Load diff
|
@ -462,7 +462,7 @@ class CKernel
|
|||
CMemE820 mem_E820[MEM_E820_ENTRIES_NUM];
|
||||
U64 mem_physical_space;
|
||||
CSysLimitBase sys_gdt_ptr;
|
||||
U16 sys_pci_busses;
|
||||
U16 sys_pci_buses;
|
||||
;$$=($$+15)&-16;
|
||||
CGDT sys_gdt;
|
||||
};
|
||||
|
@ -1186,7 +1186,7 @@ public class CDocBin
|
|||
#define DOC_COLOR_MACRO LTBLUE
|
||||
#define DOC_COLOR_ANCHOR DKGRAY
|
||||
#define DOC_COLOR_TREE PURPLE
|
||||
#define DOC_COLOR_PROMPT GREEN
|
||||
#define DOC_COLOR_PROMPT GREEN
|
||||
#define DOC_COLOR_COMMENT GREEN
|
||||
#define DOC_COLOR_BIN LTGREEN
|
||||
#define DOC_COLOR_STR BROWN
|
||||
|
@ -1198,7 +1198,8 @@ public class CDocBin
|
|||
#define DOC_COLOR_FUN PURPLE
|
||||
#define DOC_COLOR_KEYWORD BLUE
|
||||
#define DOC_COLOR_REG LTRED
|
||||
|
||||
#define DOC_COLOR_NUMBER YELLOW
|
||||
|
||||
public class CDocSettings
|
||||
{
|
||||
U32 final_u32_attr;
|
||||
|
@ -3063,7 +3064,7 @@ public I64 class CBGR48
|
|||
#define KBDC_LED 0xED
|
||||
#define KBDC_DISABLE_MS 0xA7
|
||||
#define KBDC_ENABLE_MS 0xA8
|
||||
#define KBDC_ENABLE_KBD 0xAE
|
||||
#define KBDC_ENABLE_KBD 0xAE
|
||||
#define KBDC_TYPEMATIC 0xF3
|
||||
#define KBDC_SCAN_CODES 0xF0
|
||||
|
||||
|
|
|
@ -239,7 +239,7 @@ _extern SYS_SEMAS CSema sys_semas[SEMA_SEMAS_NUM];
|
|||
public _intern IC_GS CCPU *Gs(); //GS points to current $LK,"CCPU",A="MN:CCPU"$.
|
||||
|
||||
#help_index "PCI"
|
||||
public _extern SYS_PCI_BUSES U16 sys_pci_busses; //Number of PCI buses.
|
||||
public _extern SYS_PCI_BUSES U16 sys_pci_buses; //Number of PCI buses.
|
||||
|
||||
#help_index "Processor"
|
||||
public _intern IC_CARRY I64 Carry(); //See $LK,"::/Demo/Carry.CC"$
|
||||
|
|
Binary file not shown.
|
@ -126,7 +126,7 @@ U0 PCILookUpDevs()
|
|||
if (dev.pci_head.next != &dev.pci_head)
|
||||
return;
|
||||
doc = DocRead(PCI_DEV_FILE, DOCF_PLAIN_TEXT | DOCF_NO_CURSOR);
|
||||
for (b = 0; b < sys_pci_busses; b++)
|
||||
for (b = 0; b < sys_pci_buses; b++)
|
||||
for (d = 0; d < 32; d++)
|
||||
for (f = 0; f < 8; f++)
|
||||
{
|
||||
|
@ -160,7 +160,7 @@ U0 PCILookUpDevs()
|
|||
PCILookUpSingle(doc, w1, w2, &tmppci->vendor_str, &tmppci->dev_id_str);
|
||||
QueueInsert(tmppci, dev.pci_head.last);
|
||||
timeout = 32 * 8 * 2;
|
||||
} else if (sys_pci_busses == 256 && --timeout <= 0)
|
||||
} else if (sys_pci_buses == 256 && --timeout <= 0)
|
||||
goto lud_done;
|
||||
}
|
||||
lud_done:
|
||||
|
@ -170,7 +170,7 @@ lud_done:
|
|||
public CPCIDev *PCIDevFind(U16 class_code=NULL, U16 sub_code=NULL,
|
||||
U16 vendor_id=NULL, U16 device_id=NULL,
|
||||
U8 _bus=0xFF, U8 _dev=0xFF, U8 _fun=0xFF)
|
||||
{//return first device with matching class & subcode, vendor & device id, or a specific device.
|
||||
{//return first device with matching class & subcode, vendor & device id, or a specific device.
|
||||
PCILookUpDevs;
|
||||
CPCIDev *p = dev.pci_head.next;
|
||||
while (p != &dev.pci_head)
|
||||
|
@ -189,7 +189,7 @@ public CPCIDev *PCIDevFind(U16 class_code=NULL, U16 sub_code=NULL,
|
|||
public U0 PCIRep()
|
||||
{//Report description of PCI devices.
|
||||
CPCIDev *tmppci;
|
||||
"PCI Busses:%d\n",sys_pci_busses;
|
||||
"PCI Buses:%d\n",sys_pci_buses;
|
||||
if (!FileFind(PCI_DEV_FILE)) {
|
||||
"You don't have the PCI device file.\n";
|
||||
return;
|
||||
|
|
|
@ -10,7 +10,7 @@ U32 *DocHighlight(CDocEntry *doc_e,U8 *src,I64 len,I64 _tmp_u32_attr)
|
|||
U32 *res=MAlloc((len+1)*sizeof(U32)),*dst=res;
|
||||
U8 *ptr;
|
||||
CDocSettings *s=&doc_e->settings;
|
||||
I64 ch,ch1,last_ch,tmp_u32_attr,mask_tmp_u32_attr=_tmp_u32_attr&0xFFFFF000,
|
||||
I64 count,ch,ch1,ch2,last_ch,tmp_u32_attr,mask_tmp_u32_attr=_tmp_u32_attr&0xFFFFF000,
|
||||
comment_depth,brace_depth=s->brace_depth,paren_depth=s->paren_depth;
|
||||
CHash *tmph;
|
||||
switch [s->state] {
|
||||
|
@ -69,6 +69,44 @@ hl_normal:
|
|||
*dst++=ch1+tmp_u32_attr;
|
||||
if (!--len) goto hl_normal_done;
|
||||
}
|
||||
|
||||
ptr = src;
|
||||
if (*ptr++ == '0')
|
||||
{
|
||||
ch2 = *ptr--;
|
||||
if (ch2 == 'x' || ch2 == 'b')
|
||||
{
|
||||
count = 0;
|
||||
while (len && (Bt(char_bmp_hex_numeric, *src) || *src == ch2 && count < 2))
|
||||
{
|
||||
count++;
|
||||
src++;
|
||||
len--;
|
||||
}
|
||||
ch = *src;
|
||||
*src = '\0';
|
||||
tmp_u32_attr = DOC_COLOR_NUMBER << 8 | mask_tmp_u32_attr;
|
||||
while (ch1 = *ptr++)
|
||||
*dst++ = ch1 + tmp_u32_attr;
|
||||
*src = ch;
|
||||
if (!len) goto hl_normal_done;
|
||||
}
|
||||
}
|
||||
|
||||
ptr = src;
|
||||
while (len && Bt(char_bmp_dec_numeric, *src))
|
||||
{
|
||||
src++;
|
||||
len--;
|
||||
}
|
||||
ch = *src;
|
||||
*src = '\0';
|
||||
tmp_u32_attr = DOC_COLOR_NUMBER << 8 | mask_tmp_u32_attr;
|
||||
while (ch1 = *ptr++)
|
||||
*dst++ = ch1 + tmp_u32_attr;
|
||||
*src = ch;
|
||||
if (!len) goto hl_normal_done;
|
||||
|
||||
ptr=src;
|
||||
while (len && Bt(char_bmp_alpha_numeric,*src)) {
|
||||
src++;
|
||||
|
|
Loading…
Reference in a new issue