Skip to content

Commit

Permalink
Remove processor name string saving
Browse files Browse the repository at this point in the history
  • Loading branch information
ghaerr committed Oct 31, 2024
1 parent 3878888 commit 9d10ba6
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 14 deletions.
25 changes: 13 additions & 12 deletions elks/arch/i86/boot/cputype.S
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// obsolete and inaccurate, but required for arch_cpu = 6 and 7 (286, 386+)
// XT vs AT BIOS system capabilities (sys_caps) auto-detection by kernel
//
// Note: enables, then disables interrupts when called

/*
! Probe for the CPU
Expand All @@ -9,7 +9,7 @@
!
*/
getcpu:
mov $SETUPSEG,%ax // setup.S code segment
mov $SETUPSEG,%ax // setup code segment
mov %ax,%ds
pushf // check for 8088/8086/V20/V30/80188/80186
xor %ax,%ax
Expand Down Expand Up @@ -45,12 +45,12 @@ getcpu:
and $0x70,%bh // 32-bit CPU if we changed NT or IOPL
je not_32bit
mov $7,%cl // 80386+
lea p80386,%si
#lea p80386,%si
jmp cpu_store

not_32bit: // Unknown CPU
mov $255,%cl
lea px86,%si
#lea px86,%si
jmp cpu_store

is8086:
Expand All @@ -63,38 +63,37 @@ is8086:
mov $0xffff,%cx
nop
rep
// seg es
lodsb
or %cx,%cx
jz isv30
call queue
jz is8088
mov $1,%cl
lea p8086,%si
#lea p8086,%si
jmp cpu_store
is8088: xor %cl,%cl
lea p8088,%si
#lea p8088,%si
jmp cpu_store
is80186:call queue
jz is80188
mov $5,%cl
lea p80186,%si
#lea p80186,%si
jmp cpu_store
is80188:mov $4,%cl
lea p80188,%si
#lea p80188,%si
jmp cpu_store
isv30:
call queue
jz isv20
mov $3,%cl
lea pv30,%si
#lea pv30,%si
jmp cpu_store
isv20: mov $2,%cl
lea pv20,%si
#lea pv20,%si
jmp cpu_store

is80286:mov $6,%cl
lea p80286,%si
#lea p80286,%si
// jmp cpu_store

cpu_store:
Expand Down Expand Up @@ -183,6 +182,7 @@ queue_end:
or %dx,%dx
ret

#if UNUSED
//
// The processor name must not be longer than 15 characters!
//
Expand All @@ -202,3 +202,4 @@ v_id: .byte 0,0,0,0
v_id2: .byte 0,0,0,0
v_id3: .byte 0,0,0,0
.byte 0
#endif
2 changes: 1 addition & 1 deletion elks/arch/i86/boot/setup.S
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
! 10: mono/color, video memory size, 2 bytes
! 14: screen_lines, 1 byte
! 15: VGA present, 1 byte
! 0x20: cpu_type byte Processor type UNUSED
! 0x20: cpu_type byte Processor type
! 0 = 8088
! 1 = 8086
! 2 = NEC V20
Expand Down
2 changes: 1 addition & 1 deletion elks/arch/i86/kernel/system.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ unsigned int INITPROC setup_arch(void)
byte_t arch_cpu = SETUP_CPU_TYPE;
if (arch_cpu > 5) /* 80286+ IBM PC/AT capabilities or Unknown CPU */
sys_caps = CAP_ALL;
printk("arch %d sys_caps %02x\n", arch_cpu, sys_caps);
debug("arch %d sys_caps %02x\n", arch_cpu, sys_caps);
#endif

return endbss; /* used as start address in near heap init */
Expand Down

0 comments on commit 9d10ba6

Please sign in to comment.