Giter Site home page Giter Site logo

microwindows on 64bit ARM about microwindows HOT 6 CLOSED

uklatt avatar uklatt commented on May 17, 2024
microwindows on 64bit ARM

from microwindows.

Comments (6)

ghaerr avatar ghaerr commented on May 17, 2024 1

Looking at your stack trace, I can see the problem with v0.92 that you're running: the hbr HBRUSH is being truncated from 64 to 32 bits:

Program received signal SIGSEGV, Segmentation fault.
0x0000aaaaaaaa973c in FillRect (hdc=0xaaaaaab1dde0, lprc=0xfffffffff568, hbr=0xaab103b8)
at /home/root/microwindows-0.92/src/mwin/wingdi.c:766

Notice that the heap variables are all at addresses 0x0000aaaaaaaa.... while hbr above has its high 32 bits zero. This was fixed on 18 Dec 2018 in commit a3564f4 as can be seen in the "blame" report on src/mwin/windefw.c. Long story short - v0.92 is not 64-bit compiler clean and should not be used.

If you can produce a stack trace of the latest source code segfault I can probably help get this problem figured out.

Thank you!

from microwindows.

ghaerr avatar ghaerr commented on May 17, 2024

Hello @uklatt,

Should the code work with a 64Bit compiler?

Yes - Microwindows has been working on 64-bit systems for some time.

It looks like tbe initial erasing of the framebuffer is not working and there are writes outside of the allowed framebuffer memory.

Are you running the drivers/scr_fb.c framebuffer driver? It sounds like perhaps the framebuffer width, stride or overall length/height values might be improperly set. Another possibility is that your framebuffer requires 64-bit (not 32-bit) writes, or otherwise segfaults. If this is the case, then we'll have to look into rewriting whichever framebuffer sub driver you're using (likely drivers/fblin32.c) to use 64-bit moves when accessing the framebuffer. IIRC some of the upper-level routines may expect only 32-bit padding for images etc, which might also have to change.

Thank you!

from microwindows.

ghaerr avatar ghaerr commented on May 17, 2024

I try to port an existing microwindows program from i.MX6 (32 Bit code, 16 Bit framebuffer) to i.MX8 (64 Bit code, 32 Bit framebuffer).

Oops - I missed that! This means you can likely ignore my last comment about 64-bit framebuffer. Perhaps the issue then is that the scr_fb.c framebuffer driver is not picking up the fblin32.c 32-bit linear driver, or that the size (length in bytes) of the framebuffer is incorrect.

from microwindows.

uklatt avatar uklatt commented on May 17, 2024

Hi @ghaerr
Thank you for the fast comment!
I checked with an older version 0.91 with some additions.
Now I am testing with the last 0.92 from http://www.microwindows.org/

With this version I have a different error:

Starting program: /home/root/mtest/mtest
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/libthread_db.so.1".
1920x1080x32bpp linelen 7680 type 0 visual 2 colors 281470698520576 pixtype 3
createfont: (height == 0) found builtin font System (0)
createfont: (height == 0) found builtin font System (0)
createfont: (height == 0) found builtin font System (0)
Program received signal SIGSEGV, Segmentation fault.
0x0000aaaaaaaa973c in FillRect (hdc=0xaaaaaab1dde0, lprc=0xfffffffff568, hbr=0xaab103b8)
at /home/root/microwindows-0.92/src/mwin/wingdi.c:766
766 if(obr->style == BS_NULL)
(gdb) bt
#0 0x0000aaaaaaaa973c in FillRect (hdc=0xaaaaaab1dde0, lprc=0xfffffffff568, hbr=0xaab103b8)
at /home/root/microwindows-0.92/src/mwin/wingdi.c:766
#1 0x0000aaaaaaaaec2c in DefWindowProc (hwnd=0xaaaaaab1d970, msg=20, wParam=2863783280, lParam=0)
at /home/root/microwindows-0.92/src/mwin/windefw.c:366
#2 0x0000aaaaaaaa2be4 in wproc (hwnd=0xaaaaaab1d970, iMsg=20, wParam=2863783280, lParam=0)
at mtest.c:70
#3 0x0000aaaaaaaa439c in SendMessage (hwnd=0xaaaaaab1d970, Msg=20, wParam=2863783280, lParam=0)
at /home/root/microwindows-0.92/src/mwin/winuser.c:81
#4 0x0000aaaaaaaa83c4 in BeginPaint (hwnd=0xaaaaaab1d970, lpPaint=0xfffffffff820)
at /home/root/microwindows-0.92/src/mwin/wingdi.c:223
#5 0x0000aaaaaaaa2b7c in wproc (hwnd=0xaaaaaab1d970, iMsg=15, wParam=0, lParam=0) at mtest.c:60
#6 0x0000aaaaaaaa439c in SendMessage (hwnd=0xaaaaaab1d970, Msg=15, wParam=0, lParam=0)
at /home/root/microwindows-0.92/src/mwin/winuser.c:81
#7 0x0000aaaaaaaa5800 in UpdateWindow (hwnd=0xaaaaaab1d970)
at /home/root/microwindows-0.92/src/mwin/winuser.c:769
#8 0x0000aaaaaaaa2ad8 in WinMain (hInstance=0xaaaaaab1d670, hPrevInstance=0x0,
szCmdLine=0xaaaaaab1d6b0 "", iCmdShow=5) at mtest.c:41
#9 0x0000aaaaaaaa2c94 in main (ac=1, av=0xfffffffffb78)
at /home/root/microwindows-0.92/src/mwin/winmain.c:115
My framebuffer:

fbset -i
mode "1920x1080"
geometry 1920 1080 1920 1080 32
timings 0 0 0 0 0 0 0
accel true
rgba 8/16,8/8,8/0,0/0
endmode
Frame buffer device information:
Name : imx-drmdrmfb
Address : (nil)
Size : 8294400
Type : PACKED PIXELS
Visual : TRUECOLOR
XPanStep : 1
YPanStep : 1
YWrapStep : 0
LineLength : 7680
Accelerator : No

My config:
config.txt

from microwindows.

uklatt avatar uklatt commented on May 17, 2024

Hi Greg,
many thanks for this tip!
I will try the last snapshot next week and report what happens...

from microwindows.

uklatt avatar uklatt commented on May 17, 2024

@ghaerr
I was able to compile and run the last snapshot 0.94 with success!
Thank you for your help!

from microwindows.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.