Was: SMP (on intel) set address of code
Was: SMP (on intel) set address of code
for my -how-to-do-a-kernel-within-days-without-experience- unreal mode bootable emulator that is using CHS tuple and polling even for the timers and mouse input, i guess it will not ruin the experience even more if i just kicking the cores in with a pair of russian steel toe boots.
its not an issue if bad/disabled cores are coming online, spinning the emulation environment not needs any features, so it will work even with an extremely damaged cpu if the basic comparison and register accessing opcodes are working.
i just need a method to find out the CPU number (maybe CPUID will do it) so i can know what memory location should i crawl.
its not an issue if bad/disabled cores are coming online, spinning the emulation environment not needs any features, so it will work even with an extremely damaged cpu if the basic comparison and register accessing opcodes are working.
i just need a method to find out the CPU number (maybe CPUID will do it) so i can know what memory location should i crawl.
Operating system for SUBLEQ cpu architecture:
http://users.atw.hu/gerigeri/DawnOS/download.html
http://users.atw.hu/gerigeri/DawnOS/download.html
Re: SMP (on intel) set address of code
Hi,
Cheers,
Brendan
If this is your goal; the single most productive thing you can (that would benefit yourself and the entire world the most) is to give up programming anything completely.Geri wrote:for my -how-to-do-a-kernel-within-days-without-experience- unreal mode bootable emulator that is using CHS tuple and polling even for the timers and mouse input, i guess it will not ruin the experience even more if i just kicking the cores in with a pair of russian steel toe boots.
Cheers,
Brendan
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
Re: SMP (on intel) set address of code
human lifespan is limited, and x86 is not my friend.
Operating system for SUBLEQ cpu architecture:
http://users.atw.hu/gerigeri/DawnOS/download.html
http://users.atw.hu/gerigeri/DawnOS/download.html
Re: SMP (on intel) set address of code
Hi,
Cheers,
Brendan
In the long run; learning how to do something right and then doing it right the first time (or at least trying to do it right the first time) is faster and easier. The alternative is being too ignorant to bother and then (when faced with the inevitable "worthless piece of crud" results) having to throw it all in the trash and start again with zero useful code and zero useful knowledge and zero useful experience (except for learning that doing things right the first time saves you years of pointless effort).Geri wrote:human lifespan is limited, and x86 is not my friend.
Cheers,
Brendan
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
Re: SMP (on intel) set address of code
There is something to be said though for starting out the "wrong" way and incrementally improving things. That approach will teach you things you would have missed by trying to do everything perfectly from the start, and because you've acknowledged that you're going to be improving things over time, you won't be stuck with your head up your arse on some design that makes no sense in the real world.
That is, of course, different from taking shortcuts with no intention of fixing them later. But even that can be a reasonable approach if you're not aiming for a production OS and your main goal lies elsewhere.
That is, of course, different from taking shortcuts with no intention of fixing them later. But even that can be a reasonable approach if you're not aiming for a production OS and your main goal lies elsewhere.
Re: SMP (on intel) set address of code
if you are a game developer, your passion is to be a game developer, your identity is a game developer, your job is a game developer, then you should learn how to write a game properly: how to render the graphics, find proper ways to load your models and textures, research how you can render efficiently, how you create the content efficiently, how you reach the most users, how to do the actual game itself, how to sell to the users itself.Brendan wrote:In the long run; learning how to do something right and then doing it right the first time (or at least trying to do it right the first time) is faster and easier. The alternative is being too ignorant to bother and then (when faced with the inevitable "worthless piece of crud" results) having to throw it all in the trash and start again with zero useful code and zero useful knowledge and zero useful experience (except for learning that doing things right the first time saves you years of pointless effort).
if you are common to programming, but you are not a game developer, you will never have to create a game again, gamedev are not your passion, you just need it for some purpose when it does not matter what the quality of the game is, becouse the game itself is not the product, becouse something else is the product, but you need to have a game too, then you may just probably write a few for cycle with middle scool math skills to render the scene out, putting as little efforts as possible (or you use some external game engine where you just click the content together).
for example if you want to build a christmas light flashing performance around your house this year, you will not put years into researching possible methods of fourier transformations, you will not build your own relays to switch on and off the lights with half year of work, you will not attend to a special art scool to learn how to create good impressions with switching on and off lights - you just check the solutions quickly, you probably solder some cheap relay together to a chinese tape recorder with rithmic light flashing effect, and you just put the lights quickly around your roofs and trees.
and maybe your product is to sell a book about the evil santa claus to the people who gathering to look at your lights.
Operating system for SUBLEQ cpu architecture:
http://users.atw.hu/gerigeri/DawnOS/download.html
http://users.atw.hu/gerigeri/DawnOS/download.html
Re: SMP (on intel) set address of code
Hi,
When someone is deliberately trying to minimise the amount of useful knowledge/experience they gain; all they're doing is wasting their time and wasting our time. Worse, they tend to influence other beginners while they're here (who influence other beginners, who...), and there's a very real risk of "plague of ignorance". It's much better to annihilate the root cause before the disease spreads.
Cheers,
Brendan
As far as I'm concerned, it's about trying to maximise the amount of useful knowledge/experience that you gain; so that you reach "enough knowledge/experience" in the least iterations.Rusky wrote:There is something to be said though for starting out the "wrong" way and incrementally improving things. That approach will teach you things you would have missed by trying to do everything perfectly from the start, and because you've acknowledged that you're going to be improving things over time, you won't be stuck with your head up your arse on some design that makes no sense in the real world.
That is, of course, different from taking shortcuts with no intention of fixing them later. But even that can be a reasonable approach if you're not aiming for a production OS and your main goal lies elsewhere.
When someone is deliberately trying to minimise the amount of useful knowledge/experience they gain; all they're doing is wasting their time and wasting our time. Worse, they tend to influence other beginners while they're here (who influence other beginners, who...), and there's a very real risk of "plague of ignorance". It's much better to annihilate the root cause before the disease spreads.
I'm not interested in retarded excuses. Whether your end product is an OS or not; you are talking about low level code that everything else will be depend on. If that low level code is sewerage everything else will be built on top of sewerage. The only thing you can successfully build on top of sewerage is more sewerage.Geri wrote:if you are a game developer, your passion is to be a game developer, your identity is a game developer, your job is a game developer, then you should learn how to write a game properly: how to render the graphics, find proper ways to load your models and textures, research how you can render efficiently, how you create the content efficiently, how you reach the most users, how to do the actual game itself, how to sell to the users itself.
if you are common to programming, but you are not a game developer, you will never have to create a game again, gamedev are not your passion, you just need it for some purpose when it does not matter what the quality of the game is, becouse the game itself is not the product, becouse something else is the product, but you need to have a game too, then you may just probably write a few for cycle with middle scool math skills to render the scene out, putting as little efforts as possible (or you use some external game engine where you just click the content together).
for example if you want to build a christmas light flashing performance around your house this year, you will not put years into researching possible methods of fourier transformations, you will not build your own relays to switch on and off the lights with half year of work, you will not attend to a special art scool to learn how to create good impressions with switching on and off lights - you just check the solutions quickly, you probably solder some cheap relay together to a chinese tape recorder with rithmic light flashing effect, and you just put the lights quickly around your roofs and trees.
and maybe your product is to sell a book about the evil santa claus to the people who gathering to look at your lights.
Cheers,
Brendan
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
Re: Was: SMP (on intel) set address of code
edit: fixed the bug in this snippet, and modifyed the code so maybe someone will find it usefull
ok well lets see
this supposed to start up all of the cores (if we believe the lies on internet)
no timers yet to wait precisely (i tried multiple values, less and more)
this is a binary code meant to be executed on the waking up cores.
(nops are there becouse of security reasons, since the code is in c, not sure how the compiler aligns or places function initialization, so i jump into the bounch of nops) so the address is divisible with 16 4096 always.
this just writes letters from memory address 1024
it works when its generally called
but when its supposed to wake up as the payload of the SMP cores, nothing happens
qemu with params -smp cpus=2,cores=2
something happens, becouse qemu slows down after the call of wake up signals
but the code is not writing the letters, so it not works
(see Brendan, thats why i dont play with x86, and thats why the platform is dieing, becouse its too complicated, and the errors are undeterministic)
ok well lets see
Code: Select all
void smpinitasm(unsigned int eipuj){ // 000C46XXH
asm(
"MOV ESI, 0xFEE00300\n"
"MOV EAX, 0x000C4500\n"
"MOV [ESI], EAX\n"
"MOV EBX, 99999999\n"
"varakozik:\n"
"SUB EBX, 1\n"
"CMP EBX, 0\n"
"jne varakozik\n"
"MOV DWORD EAX, [bp+8]\n"
"MOV [ESI], EAX\n"
"MOV EBX, 199999999\n"
"varakozik2:\n"
"SUB EBX, 1\n"
"CMP EBX, 0\n"
"jne varakozik2\n"
"MOV [ESI], EAX\n"
"MOV EBX, 199999999\n"
"varakozik3:\n"
"SUB EBX, 1\n"
"CMP EBX, 0\n"
"jne varakozik3\n"
);
}
void smpinit(unsigned long eipuj){ // 000C46XXH
eipuj=0x000C4600|(eipuj/4096);
smpinitasm(eipuj);
}
no timers yet to wait precisely (i tried multiple values, less and more)
Code: Select all
// *************
// smp
// *************
void smp_blob(){
asm(
...... 4096 nops ..
"nop\n"
"nop\n"
"nop\n"
"nop\n"
"nop\n"
"nop\n"
"nop\n"
"nop\n"
"nop\n"
"nop\n"
"nop\n"
"nop\n"
"nop\n"
"nop\n"
"nop\n"
"nop\n"
"nop\n"
"nop\n"
"nop\n"
"nop\n"
"nop\n"
"nop\n"
"nop\n"
"nop\n"
"nop\n"
"nop\n"
"nop\n"
"nop\n"
"nop\n"
"nop\n"
"nop\n"
"nop\n"
"nop\n"
"nop\n"
"nop\n"
"nop\n"
"mov dword eax,72\n"
"mov dword ebx,1024\n"
"mov dword [ebx],eax\n"
"add ebx,1\n"
"mov dword [ebx],eax\n"
"add ebx,1\n"
"mov dword [ebx],eax\n"
"add ebx,1\n"
"mov dword [ebx],eax\n"
"add ebx,1\n"
"mov dword [ebx],eax\n"
"add ebx,1\n"
"mov dword [ebx],eax\n"
"add ebx,1\n"
"mov dword [ebx],eax\n"
"add ebx,1\n"
"mov dword [ebx],eax\n"
"add ebx,1\n"
"mov dword [ebx],eax\n"
(nops are there becouse of security reasons, since the code is in c, not sure how the compiler aligns or places function initialization, so i jump into the bounch of nops) so the address is divisible with 16 4096 always.
this just writes letters from memory address 1024
it works when its generally called
but when its supposed to wake up as the payload of the SMP cores, nothing happens
qemu with params -smp cpus=2,cores=2
something happens, becouse qemu slows down after the call of wake up signals
but the code is not writing the letters, so it not works
(see Brendan, thats why i dont play with x86, and thats why the platform is dieing, becouse its too complicated, and the errors are undeterministic)
Last edited by Geri on Wed Apr 12, 2017 7:01 pm, edited 1 time in total.
Operating system for SUBLEQ cpu architecture:
http://users.atw.hu/gerigeri/DawnOS/download.html
http://users.atw.hu/gerigeri/DawnOS/download.html
Re: Was: SMP (on intel) set address of code
Hi,
Cheers,
Brendan
Probably because you overlooked something simple, like segmentation.Geri wrote:but when its supposed to wake up as the payload of the SMP cores, nothing happens
qemu with params -smp cpus=2,cores=2
something happens, becouse qemu slows down after the call of wake up signals
but the code is not writing the letters, so it not works
It's not that 80x86 is too complicated - hundreds of people have not had much problem with SMP startup. You would have similar problems with any platform (even if someone created a CPU specifically for SUBLEQ).Geri wrote:(see Brendan, thats why i dont play with x86, and thats why the platform is dieing, becouse its too complicated, and the errors are undeterministic)
Cheers,
Brendan
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
Re: Was: SMP (on intel) set address of code
oops, i find a problem
it has to be aligned to 4096 byte boundary, and not 16. given eip is multiplied by 4096
(and no, my subleq specifications does not have mp init methods, just table for they status and they eips.)
it has to be aligned to 4096 byte boundary, and not 16. given eip is multiplied by 4096
(and no, my subleq specifications does not have mp init methods, just table for they status and they eips.)
Operating system for SUBLEQ cpu architecture:
http://users.atw.hu/gerigeri/DawnOS/download.html
http://users.atw.hu/gerigeri/DawnOS/download.html