Chameleon

Chameleon Commit Details

Date:2016-05-08 18:35:25 (3 years 2 months ago)
Author:zenith432
Commit:2807
Parents: 2806
Message:Some bugfixes
Changes:
M/branches/zenith432/i386/boot2/boot.c
M/trunk/i386/config/confdata.c
M/trunk/i386/libsaio/console.c
M/branches/zenith432/i386/libsaio/fake_efi.c
M/trunk/i386/boot2/boot.c
M/branches/zenith432/i386/libsa/zalloc.c
M/trunk/i386/libsaio/fake_efi.c
M/trunk/i386/libsa/zalloc.c
M/branches/zenith432/i386/config/confdata.c
M/branches/zenith432/i386/libsaio/console.c

File differences

trunk/i386/libsaio/console.c
266266
267267
268268
269
269270
270271
271272
......
280281
281282
282283
284
283285
286
284287
285288
286289
287
288290
289291
290292
......
301303
302304
303305
306
304307
305308
306309
......
317320
318321
319322
323
320324
325
321326
322327
323
324328
325329
326330
vprf(fmt, ap);
}
}
va_end(ap);
{
// Kabyl: BooterLog
}
pi.str = cursor;
pi.last_str = 0;
va_start(ap, fmt);
prf(fmt, ap, sputc, &pi);
va_end(ap);
cursor += strlen((char *)cursor);
}
va_end(ap);
return(0);
}
{
vprf(fmt, ap);
}
va_end(ap);
// Kabyl: BooterLog
struct putc_info pi;
pi.str = cursor;
pi.last_str = 0;
va_start(ap, fmt);
prf(fmt, ap, sputc, &pi);
va_end(ap);
cursor += strlen((char *)cursor);
va_end(ap);
return(0);
}
trunk/i386/libsaio/fake_efi.c
8787
8888
8989
90
91
92
9093
9194
9295
......
772775
773776
774777
775
778
779
780
781
782
783
776784
777785
778786
787
779788
780789
781790
EFI_UINT32 getCPUTick(void)
{
uint32_t out;
/*
* Note: shl $32, %edx leaves 0 in %edx, and or to %eax does nothing - zenith432
*/
__asm__ volatile (
"rdtsc\n"
"shl $32,%%edx\n"
// shr$0x8,%rcx
rdx = (cpuTick >> 0x10);// mov%rax,%rdx
// shr$0x10,%rdx
rdi = rsi;// mov%rsi,%rdi
/*
* Note: In x86 assembly, rXX is upper part of eXX register.
* In C they're different variables.
* The code is identical with or without RANDOMSEED. - zenith432
*/
rdi = rsi = esi;// mov%rsi,%rdi
rdi = (rdi ^ cpuTick);// xor%rax,%rdi
rdi = (rdi ^ rcx);// xor%rcx,%rdi
rdi = (rdi ^ rdx);// xor%rdx,%rdi
edi = (EFI_UINT32) rdi;
seedBuffer[index] = (rdi & 0xff);// mov%dil,(%r15,%r12,1)
#endif
trunk/i386/boot2/boot.c
495495
496496
497497
498
499498
499
500
500501
502
501503
502504
503505
// own things, and then calls common_boot.
void boot(int biosdev)
{
initialize_runtime();
// Enable A20 gate before accessing memory above 1Mb.
// Note: malloc_init(), called via initialize_runtime() writes
// memory >= 1Mb, so A20 must be enabled before calling it. - zenith432
enableA20();
initialize_runtime();
common_boot(biosdev);
}
trunk/i386/config/confdata.c
8181
8282
8383
84
8485
8586
8687
va_start(ap, fmt);
if (conf_message_callback)
conf_message_callback(fmt, ap);
va_end(ap);
}
const char *conf_get_configname(void)
trunk/i386/libsa/zalloc.c
7575
7676
7777
78
78
7979
8080
8181
zalloc_base = start ? start : (char *)ZALLOC_ADDR;
totalNodes = nodes ? nodes : ZALLOC_NODES;
zalloced = (zmem *) zalloc_base;
zavailable = (zmem *) zalloc_base + sizeof(zmem) * totalNodes;
zavailable = (zmem *) (zalloc_base + sizeof(zmem) * totalNodes);
zavailable[0].start = (char *)zavailable + sizeof(zmem) * totalNodes;
if (size == 0)
branches/zenith432/i386/libsaio/console.c
266266
267267
268268
269
269270
270271
271272
......
280281
281282
282283
284
283285
286
284287
285288
286289
287
288290
289291
290292
......
301303
302304
303305
306
304307
305308
306309
......
317320
318321
319322
323
320324
325
321326
322327
323
324328
325329
326330
vprf(fmt, ap);
}
}
va_end(ap);
{
// Kabyl: BooterLog
}
pi.str = cursor;
pi.last_str = 0;
va_start(ap, fmt);
prf(fmt, ap, sputc, &pi);
va_end(ap);
cursor += strlen((char *)cursor);
}
va_end(ap);
return(0);
}
{
vprf(fmt, ap);
}
va_end(ap);
// Kabyl: BooterLog
struct putc_info pi;
pi.str = cursor;
pi.last_str = 0;
va_start(ap, fmt);
prf(fmt, ap, sputc, &pi);
va_end(ap);
cursor += strlen((char *)cursor);
va_end(ap);
return(0);
}
branches/zenith432/i386/libsaio/fake_efi.c
8787
8888
8989
90
91
92
9093
9194
9295
......
768771
769772
770773
771
774
772775
773
776
774777
775
776
777
778
778
779
780
781
782
783
784
785
786
787
779788
780
789
781790
782791
783792
EFI_UINT32 getCPUTick(void)
{
uint32_t out;
/*
* Note: shl $32, %edx leaves 0 in %edx, and or to %eax does nothing - zenith432
*/
__asm__ volatile (
"rdtsc\n"
"shl $32,%%edx\n"
seedBuffer[index] = (edi & 0xff);
#else
ecx = (cpuTick >> 8);// mov%rax,%rcx
rcx = (cpuTick >> 8);// mov%rax,%rcx
// shr$0x8,%rcx
edx = (cpuTick >> 0x10);// mov%rax,%rdx
rdx = (cpuTick >> 0x10);// mov%rax,%rdx
// shr$0x10,%rdx
edi = esi;// mov%rsi,%rdi
edi = (edi ^ cpuTick);// xor%rax,%rdi
edi = (edi ^ ecx);// xor%rcx,%rdi
edi = (edi ^ edx);// xor%rdx,%rdi
/*
* Note: In x86 assembly, rXX is upper part of eXX register.
* In C they're different variables.
* The code is identical with or without RANDOMSEED. - zenith432
*/
rdi = rsi = esi;// mov%rsi,%rdi
rdi = (rdi ^ cpuTick);// xor%rax,%rdi
rdi = (rdi ^ rcx);// xor%rcx,%rdi
rdi = (rdi ^ rdx);// xor%rdx,%rdi
edi = (EFI_UINT32) rdi;
seedBuffer[index] = (edi & 0xff);// mov%dil,(%r15,%r12,1)
seedBuffer[index] = (rdi & 0xff);// mov%dil,(%r15,%r12,1)
#endif
edi = (edi & 0x2f);// and$0x2f,%edi
edi = (edi + esi);// add%esi,%edi
branches/zenith432/i386/boot2/boot.c
495495
496496
497497
498
499498
499
500
500501
502
501503
502504
503505
// own things, and then calls common_boot.
void boot(int biosdev)
{
initialize_runtime();
// Enable A20 gate before accessing memory above 1Mb.
// Note: malloc_init(), called via initialize_runtime() writes
// memory >= 1Mb, so A20 must be enabled before calling it. - zenith432
enableA20();
initialize_runtime();
common_boot(biosdev);
}
branches/zenith432/i386/config/confdata.c
8181
8282
8383
84
8485
8586
8687
va_start(ap, fmt);
if (conf_message_callback)
conf_message_callback(fmt, ap);
va_end(ap);
}
const char *conf_get_configname(void)
branches/zenith432/i386/libsa/zalloc.c
7575
7676
7777
78
78
7979
8080
8181
zalloc_base = start ? start : (char *)ZALLOC_ADDR;
totalNodes = nodes ? nodes : ZALLOC_NODES;
zalloced = (zmem *) zalloc_base;
zavailable = (zmem *) zalloc_base + sizeof(zmem) * totalNodes;
zavailable = (zmem *) (zalloc_base + sizeof(zmem) * totalNodes);
zavailable[0].start = (char *)zavailable + sizeof(zmem) * totalNodes;
if (size == 0)

Archive Download the corresponding diff file

Revision: 2807