Elsewhere there are things that we all miss, yet it takes just one to notice...

Start menu dissappeared on Linux Mint 18.1

So, as I boot up ready to get some important emails out tonight, I found my start menu had disappeared. The bottom panel was there but no menu.

I did find that I could add start menus from the panel options, something you can’t do in Windows, but still with the three that were available, one didn’t work. And I couldn’t put it back to where it should go, in the bottom left of the panel.

I found some help: Linux Mint forums

All I needed to do was to open a terminal window, CTRL + ALT + T and enter the following:

mate-panel --reset

mintmenu --reset

And all is well again.

Thinking about it though, it might be time to reinstall Linux possibly to Ubuntu Mate. I’ll think about it at the weekend.

Just minor updates

It’s been nuts today and yesterday because the missus had an emergency. Hospital and all.

Apart from more research into various areas of coding and getting my own project back up and running, I’ve been researching. Yep, it’s been chaotic which means no programming zone. I’ve learnt a few things which is always a good thing.

Hopefully over the next couple of weeks I should have reached the 100% completion mark on my project and ready for a thorough test run. The server runs solidly, the player runs solidly but needs finishing. It’s only really now the mobile app and the media manager software that needs finishing. The cryptographic communication works just great which is something I’m happy with. Various parts of this project I will eventually release the source too, but for now it’s under wraps.

The next step is to get some bash scripts done to automate some of the management things I keep doing manually at the moment. Especially when it comes to making backups. One little script could do the lot.

Until next time.

Random update Dec 11th 2017

Well, the update of the ancient Android Studio project worked perfectly and it builds much faster and optimises better. Well made up with that. Even with a few problems with the network in work (someone had switched the router off and not told me), I finally got everything back up and running.

Tonight I have had running umpteen programs including Chrome and Android Studio (twice), as well as a 2 Gb Android emulator with ram to spare. Chuffed with this 12 Gb in my laptop now.

I’ve started an openGL ES project to test out some stuff. I will keep coming back to it because I want to not just play around with shaders, but also bench marking C++ and assembler. I know I’ll be doing this test with both ARM and x86_64. If I can run some math over bitmaps in assembler the old school way then I should be able to produce some decent effects. Especially some of the stuff I used to write on the Amiga in assembler.

Plans, plans… Fingers crossed I can stick to a night time routine and start getting some stuff done to showcase. At the moment I get home from work and get my weights and exercises done. Then I have my tea and watch an hour worth of TV. And then I try and chill out on my laptop. This chill out time trying to get some coding done can be difficult at times with the background noise of conversations that completely throw me off. I might look into getting some noise cancelling headphones.

Converting an ancient Android Studio project

Well, it’s unlikely this is going to be appreciated, but these last three days I took it up on myself, as a big challenge to convert a very old project in Android Studio and get it working with the latest gradle and CMake things. The project involves the inclusion of the ffmpeg API.

I actually tried this out in work a couple of weeks ago and failed. This time though, I created a new project from the start. The first day was getting all the source files included and getting the directories working in Android Studio. A little bit of googling and I got it.

The next two days were the big headache days. And I’m still unsure whether it is done, but at least it runs on my phone and my tablet.

Two days worth of googling with little to no help and a lot of trial and error, I managed to get the bloody thing to build. This project I had worked on in work for the last year or so. And Android Studio had gone through it’s multitude of changes and upgrades I couldn’t keep up at the time.

Anyway… It’s bed time. I’m up for work in the morning at 6am. Goosed…

Linux Thunar file manager

With all the faffing about lately with assembler at home, I remembered how easy things were when I had my Amiga 1200. On the Amiga, I used to use Directory Opus which allowed me to customise such things as compiling assembler and C files.

Image result for amiga directory opus

All those empty boxes could be custom build commands, archiving, running my own scipts, etc. Even the ones that are in the screen shot could be removed and changed for something else which I did at the time. Creating software using Directory Opus was a doddle.

I needed something exactly like those old days now. Actually I should’ve looked for this a long time ago.

I found Thunar file manager. I’ve just tested it out with a simple GCC compiling a C program and making an executable. How simple it was makes this awesome.

Image result for thunar file manager custom commands

I’m hoping I can add my custom commands to keyboard shortcuts and also group them. Apart from that it looks just like any other file manager. All I need to do is to right click or do a keyboard shortcut and any of my custom actions can be done instantly. This will make life so much easier from now on.

eg… Compile a C/C++ program and create an executable:

x86_64 assembler first steps function parameters

Okay, so far I’ve figured that there are six registers used for the first 6 parameters used in a function call. The below c program sets up the function which also uses RAX as the return value:

#include 
#include 

int asmparams(int, int, int, int, int, int);

int main(void) {
	int ret = asmparams(1, 2, 3, 4, 5, 6);
	printf("return:%d\n", ret);

	return EXIT_SUCCESS;
}

This now expects my assembler function to take 6 arguments and a return value. Below is how those first 6 arguments are used in 64 bit Unix function calls to assembler.

		section	.text

global	asmparams:function

extern	printf

printnum:
		push    rbp                             ; stack frame? x64

		push	rsi
		push	rdx
		push	rcx
		push	r8
		push	r9

        mov     rsi,rax
        mov     rdi,pf_msg 
        xor     rax,rax     
        call    printf  

        pop		r9
        pop		r8
        pop		rcx
        pop		rdx
        pop		rsi

        pop     rbp                             ; stack frame

        ret

asmparams:
		mov		rax, rdi
		call	printnum

		mov		rax, rsi
		call	printnum

		mov		rax, rdx
		call	printnum

		mov		rax, rcx
		call 	printnum

		mov		rax, r8
		call	printnum

		mov		rax, r9
		call	printnum

		mov		rax, -1		; return value
		ret

		section	.data

pf_msg	db		"%08x",10,0

When I’ve got some time to explore how the ‘Prologue’ and ‘Epilogue’, or beginning and ending of a function, I post about that. At least now parameters can be passed to assembler functions.

Things have changed a lot since the 680×0 days. Then you could use a single push/pop instruction to push/pop multiple registers.

ARM assembler 32 bit with 64 bit variables

Although I won’t be using ARM CPU’s for my main project I started to think about my x86_64 random number generator I wrote in a previous blog post and also included in a page for adding assembler code to Eclipse Neon.

There is now 32 bit and 64 bit ARM CPU’s out there in the mobile world, but mostly they consist of 32 bit ARM’s. What I really am better off doing in that case is to use a C function and grab the disassembly  and work from that.

Other uses for assembler on mobile devices can easily be upgraded using assembler code, such as image manipulation. Faster math routines, such as calculating 3D meshes and vertex and face normals. I won’t be studying much of ARM assembler because I’m working with portable x86_64 boards.

And, when I was doing 24/7 assembler on the Atari ST and the Amiga 1200, there was 0.01% need for 64 bit values then.

The only reason at the moment for needing 64 bit variables is for the random number generation so that cryptic code can be written. I’m not using ARM CPU’s so carry on with x86_64.

I was hoping to try out some other assembler stuff tonight, especially using Qt because I can access bitmap data directly. I’ll jump onto that tomorrow night instead. I’ve got the assembler bug again.

Eclipse Oxygen and NASM

Tonight I set myself a mission of getting any IDE to build assembler files alongside my C/C++ code.

Find it here: Eclipse Oxygen and NASM

I tried NetBeans at first but the IDE isn’t good at all, actually quite useless for setting up NASM. I spent about half an hour trying this out and eventually gave up. Apparently there are plugins out there, but I wasn’t going to try them out as they were not part of the NetBeans official plugins.

So I look into Eclipse and initially I was put off because there was nothing in the official plugins. A few searches later and I got it. It was already built in to the CDT plugin for eclipse. I only had to make a minor alteration to get it working.

Now I can have a C/C++ project that will also automatically compile and link my assembler source files.

Here’s me thinking I was going to be stuck over the weekend finding this out. Took an hour. What’s next to move on to? Oh yeah, my project. he he…

SSE SIMD and ARM NEON research

I started off wanting to know the CPU cycles and possible cache misses from SSE SIMD instructions, but was kind of mind blown at what SIMD can actually do. There’s also a hell of a lot that the best compilers cannot do with C or C++ code with SIMD stuff. An example is getting the sign bits from each value in a SIMD register in EAX, which is damn handy for some math.

The SSE SIMD stuff is only the base line because there’s now SSE4 I believe. (just checked and it is. behind times I am) Being able to multiple math operations on a single register has tickled my interest for a long time. Tonight I decided to put some proper research into it. Until I got sidetracked with ARM NEON.

Anyway, besides the point and before I go onto the ARM stuff. Over the next few nights at least, I’m going to be testing out more assembler programming. This time using SIMD instructions and possibly being able to use maybe a noise algorithm. Later on in time, not over the next few nights, I will look at using this experience for 3d matrix calcs.

But… Then I looked deeper into the ARM NEON…

What I found with the NEON is that it is kind of like a hyper-threaded architecture. The cpu will run 2 NEON instructions per cycle but during CPU down things (stalls, waits, etc). I need to get deeper to undertsand that but it does sound very much like the way the hyper-threading works on the intel core processors. Still good.

Another thing I did like about the ARM assembler language is it just just so awesome. In standard assembler, you load registers, multiply one register by 2/4/8, add them and the last instruction grabs the result. In ARM, you load the basic registers,  and in one instruction you can offsets and bit manipulate to get the address and store the result. Crazy.

I’ll come back to ARM stuff later one. For now, I’ll be focusing on x86_64 stuff and all the SIMD stuff. Over the next few days I’ll run some test and hopefully post some test code. That is if I get something running.

The need to scrap code

Today I found the need to scrap over a weeks worth of coding to start again. These days it’s nothing to me to have to do that because I’ve faced issues with programming many times before. You only have to look at my Previous Projects (especially the procedural level generator) to understand that sometimes when something just isn’t right, you need to scrap it and start again. In the 80’s when I was learning, it was disheartening to have to give up. I was young then. Programming is a massive learning curve for anyone who takes the journey. And what I’ve learned is that sometimes it just doesn’t work. You can’t do anything to fix it. At that point, don’t dwell on it, just take what you need from what has already been done and move on.

As I’ve already mentioned, I’ve had to do that today. Everything was working great, apart from being a tad jumpy, it was working. Almost on to the next stage of the project. Then it would crash. This crash would happen within a certain time frame too, every time, and with the same error. After a few hours of continuous testing and fruitless research into the issue I decided I had to admit defeat. Fortunately though, because of a ‘thread pool’ class which I was using extremely heavily which was causing the problem, the rest of the code is sound and plays nice without bad behaviour. (so far)

So having to ditch, dump, throw away, code, happens… Sometime it’s damn painful…

This all reminds me of the ProcMap project.

It started with a random maze generator which worked great but anyone could do that and I wanted to have corridors and rooms. So came version 2 and 3 which each although the math didn’t work, the ideas where there. The maps didn’t turn out as they should even though they looked genuine. The last version, but not the one I actually wanted to finish on had all the corridors and rooms and sloping dungeons and everything. Including the ability to get coordinates to place other items, including rotations and offset. The math worked perfect in V4. Unfortunately I didn’t get started on V5 because it was going to be a gigantic project that was to create a pseudo random generated planet, complete with landscape, towns, cities, dungeons, life, etc. Yep a big project. I’ve still got a few pieces of paper with plans on upstairs somewhere I hope still.

 

Posts navigation

1 2 3 4 5 6 7 8 11 12 13
Scroll to top