No idea, My game keeps crashing on phones - Null Pointer Dereference - crash

Please help, I have no idea what I am doing.
I made a game on Unreal Engine 4
I launched onto phones
It mostly crashes at startup. Then sometimes it works a little bit, then crashes.
I found a log and attached it below
The main thing says NULL POINTER DEREFERENCE, I'm not sure how to fix that in UE4
LOG STARTS:
Process: com.example.game
PID: 30736
Flags: 0x30c8be44
Package: com.example.game v52 (2.1)
Foreground: Yes
Build: BLU/BLU_G5/G0030:9/PPR1.180620.011/47349:user/release-keys
Native Crash TIME: 13663417
Build fingerprint: 'BLU/BLU_G5/G0350:9/PPR1.180620.011/47349:user/release-keys'
Revision: '0'
ABI: 'arm64'
pid: 30736, tid: 30770, name: GameThread >>> com.example <<<
signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0
Cause: null pointer dereference
x0 0000007636ff3400 x1 0000000000000000 x2 0000000000000001 x3 ffffffffa00e6a63
x4 001d0ac365000000 x5 0000000000000000 x6 00000076e8dd5000 x7 00000000001b8a32
x8 000000000000000a x9 000000000000000a x10 000000763967cc00 x11 000000763bc74138
x12 0000000000000018 x13 000000005ff1cafb x14 002d6de553a20d9c x15 00005e7a25d77b4e
x16 0000007647dc3de0 x17 00000076e6e44a10 x18 0000000012e431e0 x19 0000007636ff3400
x20 0000007647ea20b8 x21 0000000000000000 x22 00000076491df588 x23 0000000000000001
x24 0000007647e9e000 x25 0000007647e9e000 x26 00000076491df588 x27 0000007647e9e000
x28 0000007647e9e614 x29 00000076491da2e0
sp 00000076491da260 lr 000000764448d28c pc 000000764448d860
backtrace:
#00 pc 0000000005494860 /data/app/com.example-3XbOYcKBOswdKKougXbCXA==/lib/arm64/libUE4.so (offset 0x4b3a000) (TProperty<FFieldPath, FProperty>::ClearValueInternal(void*) const+48)
#01 pc 0000000005494288 /data/app/com.example-3XbOYcKBOswdKKougXbCXA==/lib/arm64/libUE4.so (offset 0x4b3a000) (FLinkerLoad::FinishExternalReadDependencies(double)+40)
#02 pc 0000000005470bd8 /data/app/com.example-3XbOYcKBOswdKKougXbCXA==/lib/arm64/libUE4.so (offset 0x4b3a000) (FFindStronglyConnected::StrongConnectInner(UObject*)+1076)
#03 pc 0000000005471cbc /data/app/com.example-3XbOYcKBOswdKKougXbCXA==/lib/arm64/libUE4.so (offset 0x4b3a000) (IncrementalPurgeGarbage(bool, float)+1220)
#04 pc 0000000005472490 /data/app/com.example-3XbOYcKBOswdKKougXbCXA==/lib/arm64/libUE4.so (offset 0x4b3a000) (UnhashUnreachableObjects(bool, float)+20)

Related

Failed to load image using stbi_load (lwjgl used)

I'm learning OpenGL following this video. While it's based on C++, I attempt to use Kotlin instead with lwjgl. As I code and run this:
// Something above
stbi_set_flip_vertically_on_load(true)
val width = IntBuffer.allocate(1)
val height = IntBuffer.allocate(1)
val colorChannel = IntBuffer.allocate(1)
val imageBuffer = stbi_load(
"src/main/resources/$filePath",
width, height,
colorChannel, 0
) ?: throw NoSuchElementException(filePath)
// Something below
It explodes on stbi_load() outside JVM with the following error message:
#
# A fatal error has been detected by the Java Runtime Environment:
#
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x00007ff98391456e, pid=3740, tid=0x0000000000004e94
#
# JRE version: OpenJDK Runtime Environment (8.0_302-b08) (build 1.8.0_302-b08)
# Java VM: OpenJDK 64-Bit Server VM (25.302-b08 mixed mode windows-amd64 compressed oops)
# Problematic frame:
# C [lwjgl_stb.dll+0x456e]
#
# Failed to write core dump. Minidumps are not enabled by default on client versions of Windows
#
# If you would like to submit a bug report, please visit:
# https://github.com/corretto/corretto-8/issues/
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#
--------------- T H R E A D ---------------
Current thread (0x000001f98ec0c000): JavaThread "main" [_thread_in_native, id=20116, stack(0x000000b726100000,0x000000b726200000)]
siginfo: ExceptionCode=0xc0000005, writing address 0x0000000000000000
Registers:
RAX=0x0000000000000200, RBX=0x000000b7261fed00, RCX=0x000000b7261fec90, RDX=0x000001f98ebc0000
RSP=0x000000b7261febb0, RBP=0x0000000000000000, RSI=0x0000000000000000, RDI=0x000001f9b823d040
R8 =0x000000b7261fd438, R9 =0x0000000000000001, R10=0x0000000000000000, R11=0x000000b7261fd650
R12=0x0000000000000000, R13=0x0000000000000001, R14=0x0000000000000000, R15=0x0000000000000000
RIP=0x00007ff98391456e, EFLAGS=0x0000000000010246
Top of Stack: (sp=0x000000b7261febb0)
0x000000b7261febb0: 000001f9b6031d00 000000b700000000
0x000000b7261febc0: 0000000000000000 0000000000000000
0x000000b7261febd0: 000000b7261fed38 00007ff983953854
0x000000b7261febe0: 000001f9b602e730 ffffffffffffffff
0x000000b7261febf0: 000000b7261fed00 0000000000000000
0x000000b7261fec00: 0000000000000000 000001f9b823d040
0x000000b7261fec10: 0000000000000008 000000b7261fed38
0x000000b7261fec20: 0000000000000000 0000000000000000
0x000000b7261fec30: 0000000000000000 0000000000000000
0x000000b7261fec40: 0000000000000000 00007ff983914a9c
0x000000b7261fec50: 000001f900000000 000001f9b602e730
0x000000b7261fec60: 0000000000000000 0000000000000000
0x000000b7261fec70: 000001f900000000 000000b7261fec90
0x000000b7261fec80: 000001f900000008 00007ff9839539b8
0x000000b7261fec90: 0000000000000008 0000000000000000
0x000000b7261feca0: 000001f98ec0c000 000000b7261fef00
Instructions: (pc=0x00007ff98391456e)
0x00007ff98391454e: 24 20 48 8b cf 75 07 e8 26 0d 00 00 eb 05 e8 9f
0x00007ff98391455e: 11 00 00 89 6b 0c 48 8b f8 48 85 c0 74 56 8b 03
0x00007ff98391456e: 41 89 04 24 8b 43 04 41 89 07 4d 85 f6 74 0d 8b
0x00007ff98391457e: 43 08 41 89 06 eb 05 48 8b 74 24 58 48 8b ce ff
Register to memory mapping:
RAX=0x0000000000000200 is an unknown value
RBX=0x000000b7261fed00 is pointing into the stack for thread: 0x000001f98ec0c000
RCX=0x000000b7261fec90 is pointing into the stack for thread: 0x000001f98ec0c000
RDX=0x000001f98ebc0000 is an unknown value
RSP=0x000000b7261febb0 is pointing into the stack for thread: 0x000001f98ec0c000
RBP=0x0000000000000000 is an unknown value
RSI=0x0000000000000000 is an unknown value
RDI=0x000001f9b823d040 is an unknown value
R8 =0x000000b7261fd438 is pointing into the stack for thread: 0x000001f98ec0c000
R9 =0x0000000000000001 is an unknown value
R10=0x0000000000000000 is an unknown value
R11=0x000000b7261fd650 is pointing into the stack for thread: 0x000001f98ec0c000
R12=0x0000000000000000 is an unknown value
R13=0x0000000000000001 is an unknown value
R14=0x0000000000000000 is an unknown value
R15=0x0000000000000000 is an unknown value
Stack: [0x000000b726100000,0x000000b726200000], sp=0x000000b7261febb0, free space=1018k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j org.lwjgl.stb.STBImage.nstbi_load(JJJJI)J+0
j org.lwjgl.stb.STBImage.stbi_load(Ljava/lang/CharSequence;Ljava/nio/IntBuffer;Ljava/nio/IntBuffer;Ljava/nio/IntBuffer;I)Ljava/nio/ByteBuffer;+64
j net.peanuuutz.graphics.Texture.<init>(Ljava/lang/String;IIII)V+67
j net.peanuuutz.graphics.TexturesKt.main()V+328
j net.peanuuutz.graphics.TexturesKt.main([Ljava/lang/String;)V+0
v ~StubRoutines::call_stub
--------------- P R O C E S S ---------------
Java Threads: ( => current thread )
0x000001f9ac15a000 JavaThread "Service Thread" daemon [_thread_blocked, id=13668, stack(0x000000b727600000,0x000000b727700000)]
0x000001f9ac0c0000 JavaThread "C1 CompilerThread3" daemon [_thread_blocked, id=16976, stack(0x000000b727500000,0x000000b727600000)]
0x000001f9ac0be000 JavaThread "C2 CompilerThread2" daemon [_thread_blocked, id=20156, stack(0x000000b727400000,0x000000b727500000)]
0x000001f9ac0b9800 JavaThread "C2 CompilerThread1" daemon [_thread_blocked, id=24508, stack(0x000000b727300000,0x000000b727400000)]
0x000001f9ac0b6800 JavaThread "C2 CompilerThread0" daemon [_thread_blocked, id=20268, stack(0x000000b727200000,0x000000b727300000)]
0x000001f9ac0b3000 JavaThread "Monitor Ctrl-Break" daemon [_thread_in_native, id=3656, stack(0x000000b727100000,0x000000b727200000)]
0x000001f9a9b9d000 JavaThread "Attach Listener" daemon [_thread_blocked, id=3060, stack(0x000000b727000000,0x000000b727100000)]
0x000001f9a9b9c800 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=11092, stack(0x000000b726f00000,0x000000b727000000)]
0x000001f9a9b67000 JavaThread "Finalizer" daemon [_thread_blocked, id=14844, stack(0x000000b726e00000,0x000000b726f00000)]
0x000001f9a9b60800 JavaThread "Reference Handler" daemon [_thread_blocked, id=23064, stack(0x000000b726d00000,0x000000b726e00000)]
=>0x000001f98ec0c000 JavaThread "main" [_thread_in_native, id=20116, stack(0x000000b726100000,0x000000b726200000)]
Other Threads:
0x000001f9a9b39000 VMThread [stack: 0x000000b726c00000,0x000000b726d00000] [id=7040]
0x000001f9ac15e000 WatcherThread [stack: 0x000000b727700000,0x000000b727800000] [id=11348]
VM state:not at safepoint (normal execution)
VM Mutex/Monitor currently owned by a thread: None
heap address: 0x00000006c2600000, size: 4058 MB, Compressed Oops mode: Zero based, Oop shift amount: 3
Narrow klass base: 0x0000000000000000, Narrow klass shift: 3
Compressed class space size: 1073741824 Address: 0x00000007c0000000
Heap:
PSYoungGen total 75776K, used 23537K [0x000000076b780000, 0x0000000770c00000, 0x00000007c0000000)
eden space 65024K, 36% used [0x000000076b780000,0x000000076ce7c680,0x000000076f700000)
from space 10752K, 0% used [0x0000000770180000,0x0000000770180000,0x0000000770c00000)
to space 10752K, 0% used [0x000000076f700000,0x000000076f700000,0x0000000770180000)
ParOldGen total 173568K, used 0K [0x00000006c2600000, 0x00000006ccf80000, 0x000000076b780000)
object space 173568K, 0% used [0x00000006c2600000,0x00000006c2600000,0x00000006ccf80000)
Metaspace used 9236K, capacity 9501K, committed 9600K, reserved 1058816K
class space used 786K, capacity 879K, committed 896K, reserved 1048576K
Card table byte_map: [0x000001f99fc60000,0x000001f9a0450000] byte_map_base: 0x000001f99c64d000
Marking Bits: (ParMarkBitMap*) 0x0000000051011820
Begin Bits: [0x000001f9a09a0000, 0x000001f9a4908000)
End Bits: [0x000001f9a4908000, 0x000001f9a8870000)
Polling page: 0x000001f98eb80000
CodeCache: size=245760Kb used=2896Kb max_used=2896Kb free=242864Kb
bounds [0x000001f9908a0000, 0x000001f990b80000, 0x000001f99f8a0000]
total_blobs=1554 nmethods=665 adapters=802
compilation: enabled
Compilation events (10 events):
Event: 0.513 Thread 0x000001f9ac0c0000 661 3 java.lang.Thread::isInterrupted (6 bytes)
Event: 0.513 Thread 0x000001f9ac0c0000 nmethod 661 0x000001f990b70e10 code [0x000001f990b70f80, 0x000001f990b71110]
Event: 0.513 Thread 0x000001f9ac0c0000 662 3 sun.nio.ch.Util$BufferCache::get (164 bytes)
Event: 0.514 Thread 0x000001f9ac0c0000 nmethod 662 0x000001f990b71190 code [0x000001f990b71380, 0x000001f990b71ed0]
Event: 0.514 Thread 0x000001f9ac0c0000 663 3 sun.nio.ch.FileDispatcherImpl::read (8 bytes)
Event: 0.514 Thread 0x000001f9ac0c0000 nmethod 663 0x000001f990b72390 code [0x000001f990b72500, 0x000001f990b72690]
Event: 0.514 Thread 0x000001f9ac0c0000 665 3 java.util.WeakHashMap::put (162 bytes)
Event: 0.514 Thread 0x000001f9ac0c0000 nmethod 665 0x000001f990b72750 code [0x000001f990b72980, 0x000001f990b73820]
Event: 0.514 Thread 0x000001f9ac0c0000 664 ! 3 sun.nio.ch.ChannelInputStream::read (95 bytes)
Event: 0.515 Thread 0x000001f9ac0c0000 nmethod 664 0x000001f990b73e50 code [0x000001f990b74040, 0x000001f990b74af0]
GC Heap History (0 events):
No events
Deoptimization events (2 events):
Event: 0.166 Thread 0x000001f98ec0c000 Uncommon trap: reason=null_check action=make_not_entrant pc=0x000001f9909b55cc method=java.lang.String.equals(Ljava/lang/Object;)Z # 8
Event: 0.192 Thread 0x000001f98ec0c000 Uncommon trap: reason=unstable_if action=reinterpret pc=0x000001f990a362fc method=java.lang.String.indexOf([CII[CIII)I # 3
Classes redefined (0 events):
No events
Internal exceptions (10 events):
Event: 0.235 Thread 0x000001f98ec0c000 Exception <a 'java/security/PrivilegedActionException'> (0x000000076c26b4a8) thrown at [C:\wsjdk\Corretto8Src\installers\windows\zip\corretto-build\buildRoot\src\hotspot\src\share\vm\prims\jvm.cpp, line 1523]
Event: 0.235 Thread 0x000001f98ec0c000 Exception <a 'java/security/PrivilegedActionException'> (0x000000076c26b8a0) thrown at [C:\wsjdk\Corretto8Src\installers\windows\zip\corretto-build\buildRoot\src\hotspot\src\share\vm\prims\jvm.cpp, line 1523]
Event: 0.235 Thread 0x000001f98ec0c000 Exception <a 'java/security/PrivilegedActionException'> (0x000000076c26d940) thrown at [C:\wsjdk\Corretto8Src\installers\windows\zip\corretto-build\buildRoot\src\hotspot\src\share\vm\prims\jvm.cpp, line 1523]
Event: 0.235 Thread 0x000001f98ec0c000 Exception <a 'java/security/PrivilegedActionException'> (0x000000076c26dd38) thrown at [C:\wsjdk\Corretto8Src\installers\windows\zip\corretto-build\buildRoot\src\hotspot\src\share\vm\prims\jvm.cpp, line 1523]
Event: 0.235 Thread 0x000001f98ec0c000 Exception <a 'java/security/PrivilegedActionException'> (0x000000076c26fdd8) thrown at [C:\wsjdk\Corretto8Src\installers\windows\zip\corretto-build\buildRoot\src\hotspot\src\share\vm\prims\jvm.cpp, line 1523]
Event: 0.235 Thread 0x000001f98ec0c000 Exception <a 'java/security/PrivilegedActionException'> (0x000000076c2701d0) thrown at [C:\wsjdk\Corretto8Src\installers\windows\zip\corretto-build\buildRoot\src\hotspot\src\share\vm\prims\jvm.cpp, line 1523]
Event: 0.235 Thread 0x000001f98ec0c000 Exception <a 'java/security/PrivilegedActionException'> (0x000000076c272198) thrown at [C:\wsjdk\Corretto8Src\installers\windows\zip\corretto-build\buildRoot\src\hotspot\src\share\vm\prims\jvm.cpp, line 1523]
Event: 0.235 Thread 0x000001f98ec0c000 Exception <a 'java/security/PrivilegedActionException'> (0x000000076c272590) thrown at [C:\wsjdk\Corretto8Src\installers\windows\zip\corretto-build\buildRoot\src\hotspot\src\share\vm\prims\jvm.cpp, line 1523]
Event: 0.334 Thread 0x000001f98ec0c000 Exception <a 'sun/nio/fs/WindowsException'> (0x000000076c325c70) thrown at [C:\wsjdk\Corretto8Src\installers\windows\zip\corretto-build\buildRoot\src\hotspot\src\share\vm\prims\jni.cpp, line 711]
Event: 0.334 Thread 0x000001f98ec0c000 Exception <a 'sun/nio/fs/WindowsException'> (0x000000076c3276b0) thrown at [C:\wsjdk\Corretto8Src\installers\windows\zip\corretto-build\buildRoot\src\hotspot\src\share\vm\prims\jni.cpp, line 711]
Events (10 events):
Event: 0.507 loading class org/lwjgl/opengl/GL$ICDStatic$WriteOnce
Event: 0.507 loading class org/lwjgl/opengl/GL$ICDStatic$WriteOnce done
Event: 0.507 loading class net/peanuuutz/graphics/Texture
Event: 0.507 loading class net/peanuuutz/graphics/Texture done
Event: 0.507 loading class org/lwjgl/stb/STBImage
Event: 0.507 loading class org/lwjgl/stb/STBImage done
Event: 0.508 loading class org/lwjgl/stb/LibSTB
Event: 0.508 loading class org/lwjgl/stb/LibSTB done
Event: 0.516 loading class java/nio/HeapIntBuffer
Event: 0.516 loading class java/nio/HeapIntBuffer done
Dynamic libraries:
0x00007ff6c0390000 - 0x00007ff6c03ca000 C:\Users\<User>\.jdks\corretto-1.8.0_302\bin\java.exe
0x00007ff9bc240000 - 0x00007ff9bc430000 C:\windows\SYSTEM32\ntdll.dll
0x00007ff9bbe70000 - 0x00007ff9bbf22000 C:\windows\System32\KERNEL32.DLL
0x00007ff9b9660000 - 0x00007ff9b9903000 C:\windows\System32\KERNELBASE.dll
0x00007ff9baee0000 - 0x00007ff9baf83000 C:\windows\System32\ADVAPI32.dll
0x00007ff9bab50000 - 0x00007ff9babee000 C:\windows\System32\msvcrt.dll
0x00007ff9ba5e0000 - 0x00007ff9ba677000 C:\windows\System32\sechost.dll
0x00007ff9baf90000 - 0x00007ff9bb0b0000 C:\windows\System32\RPCRT4.dll
0x00007ff9bbf30000 - 0x00007ff9bc0c4000 C:\windows\System32\USER32.dll
0x00007ff9ba2c0000 - 0x00007ff9ba2e1000 C:\windows\System32\win32u.dll
0x00007ff9bb130000 - 0x00007ff9bb156000 C:\windows\System32\GDI32.dll
0x00007ff9b9450000 - 0x00007ff9b95e4000 C:\windows\System32\gdi32full.dll
0x00007ff9b92b0000 - 0x00007ff9b934e000 C:\windows\System32\msvcp_win.dll
0x00007ff9b9350000 - 0x00007ff9b944a000 C:\windows\System32\ucrtbase.dll
0x00007ff9a7010000 - 0x00007ff9a7295000 C:\windows\WinSxS\amd64_microsoft.windows.common-controls_6595b64144ccf1df_6.0.18362.657_none_e6c5b579130e3898\COMCTL32.dll
0x00007ff9bb8c0000 - 0x00007ff9bbbf6000 C:\windows\System32\combase.dll
0x00007ff9b9230000 - 0x00007ff9b92b0000 C:\windows\System32\bcryptPrimitives.dll
0x00007ff9badd0000 - 0x00007ff9badfe000 C:\windows\System32\IMM32.DLL
0x00007ff97c2b0000 - 0x00007ff97c39f000 C:\Users\<User>\.jdks\corretto-1.8.0_302\jre\bin\msvcr120.dll
0x00007ff997140000 - 0x00007ff9971e6000 C:\Users\<User>\.jdks\corretto-1.8.0_302\jre\bin\msvcp120.dll
0x0000000050820000 - 0x0000000051090000 C:\Users\<User>\.jdks\corretto-1.8.0_302\jre\bin\server\jvm.dll
0x00007ff9bb0b0000 - 0x00007ff9bb0b8000 C:\windows\System32\PSAPI.DLL
0x00007ff9b36d0000 - 0x00007ff9b36da000 C:\windows\SYSTEM32\VERSION.dll
0x00007ff9b5a80000 - 0x00007ff9b5a89000 C:\windows\SYSTEM32\WSOCK32.dll
0x00007ff9aaac0000 - 0x00007ff9aaae4000 C:\windows\SYSTEM32\WINMM.dll
0x00007ff9bb0c0000 - 0x00007ff9bb12f000 C:\windows\System32\WS2_32.dll
0x00007ff9ab070000 - 0x00007ff9ab09d000 C:\windows\SYSTEM32\winmmbase.dll
0x00007ff9b95f0000 - 0x00007ff9b963a000 C:\windows\System32\cfgmgr32.dll
0x00007ff9b4cd0000 - 0x00007ff9b4cdf000 C:\Users\<User>\.jdks\corretto-1.8.0_302\jre\bin\verify.dll
0x00007ff99cc00000 - 0x00007ff99cc29000 C:\Users\<User>\.jdks\corretto-1.8.0_302\jre\bin\java.dll
0x00007ff99b8c0000 - 0x00007ff99b8ea000 C:\Users\<User>\.jdks\corretto-1.8.0_302\jre\bin\instrument.dll
0x00007ff9a8a50000 - 0x00007ff9a8a66000 C:\Users\<User>\.jdks\corretto-1.8.0_302\jre\bin\zip.dll
0x00007ff9bb1d0000 - 0x00007ff9bb8b5000 C:\windows\System32\SHELL32.dll
0x00007ff9bae10000 - 0x00007ff9baeb9000 C:\windows\System32\shcore.dll
0x00007ff9b99f0000 - 0x00007ff9ba16f000 C:\windows\System32\windows.storage.dll
0x00007ff9b9120000 - 0x00007ff9b913f000 C:\windows\System32\profapi.dll
0x00007ff9b9180000 - 0x00007ff9b91ca000 C:\windows\System32\powrprof.dll
0x00007ff9b9110000 - 0x00007ff9b9120000 C:\windows\System32\UMPDC.dll
0x00007ff9ba680000 - 0x00007ff9ba6d2000 C:\windows\System32\shlwapi.dll
0x00007ff9b9160000 - 0x00007ff9b9171000 C:\windows\System32\kernel.appcore.dll
0x00007ff9b9640000 - 0x00007ff9b9657000 C:\windows\System32\cryptsp.dll
0x00007ff99cc70000 - 0x00007ff99cc8a000 D:\IntelliJ IDEA 2021.1.1\bin\breakgen64.dll
0x00007ff9a7ef0000 - 0x00007ff9a7f0a000 C:\Users\<User>\.jdks\corretto-1.8.0_302\jre\bin\net.dll
0x00007ff9ac1f0000 - 0x00007ff9ac210000 C:\windows\system32\PrxerDrv.dll
0x00007ff9b8980000 - 0x00007ff9b89e7000 C:\windows\system32\mswsock.dll
0x00007ff9a4930000 - 0x00007ff9a4942000 C:\Users\<User>\.jdks\corretto-1.8.0_302\jre\bin\nio.dll
0x00007ff985d30000 - 0x00007ff985da2000 C:\Users\<User>\AppData\Local\Temp\lwjgl<User>\3.2.2-build-10\lwjgl.dll
0x00007ff987630000 - 0x00007ff98768e000 C:\Users\<User>\AppData\Local\Temp\lwjgl<User>\3.2.2-build-10\glfw.dll
0x00007ff9b7100000 - 0x00007ff9b7199000 C:\windows\system32\uxtheme.dll
0x00007ff995400000 - 0x00007ff995443000 C:\windows\SYSTEM32\dinput8.dll
0x00007ff99b530000 - 0x00007ff99b541000 C:\windows\SYSTEM32\xinput1_4.dll
0x00007ff9b8f10000 - 0x00007ff9b8f3a000 C:\windows\SYSTEM32\DEVOBJ.dll
0x00007ff9b7520000 - 0x00007ff9b754d000 C:\windows\SYSTEM32\dwmapi.dll
0x00007ff99b700000 - 0x00007ff99b81a000 C:\windows\SYSTEM32\inputhost.dll
0x00007ff9b55e0000 - 0x00007ff9b56cf000 C:\windows\SYSTEM32\PROPSYS.dll
0x00007ff9b6df0000 - 0x00007ff9b6ec4000 C:\windows\SYSTEM32\CoreMessaging.dll
0x00007ff9a4240000 - 0x00007ff9a456a000 C:\windows\SYSTEM32\CoreUIComponents.dll
0x00007ff9b4b70000 - 0x00007ff9b4cc3000 C:\windows\SYSTEM32\wintypes.dll
0x00007ff9bbda0000 - 0x00007ff9bbe64000 C:\windows\System32\OLEAUT32.dll
0x00007ff9b8170000 - 0x00007ff9b81a1000 C:\windows\SYSTEM32\ntmarta.dll
0x00007ff9ba4a0000 - 0x00007ff9ba5d5000 C:\windows\System32\MSCTF.dll
0x00007ff9b7d20000 - 0x00007ff9b7d2e000 C:\windows\SYSTEM32\HID.DLL
0x00007ff9ba6e0000 - 0x00007ff9bab50000 C:\windows\System32\SETUPAPI.DLL
0x00007ff9b99c0000 - 0x00007ff9b99e6000 C:\windows\System32\bcrypt.dll
0x00007ff9b91d0000 - 0x00007ff9b922c000 C:\windows\System32\WINTRUST.dll
0x00007ff9b9140000 - 0x00007ff9b9152000 C:\windows\System32\MSASN1.dll
0x00007ff9ba170000 - 0x00007ff9ba2b9000 C:\windows\System32\CRYPT32.dll
0x00007ff99a6e0000 - 0x00007ff99a836000 C:\windows\SYSTEM32\opengl32.dll
0x00007ff9acfd0000 - 0x00007ff9acffc000 C:\windows\SYSTEM32\GLU32.dll
0x00007ff9b7df0000 - 0x00007ff9b7e10000 C:\windows\SYSTEM32\dxcore.dll
0x00007ff96e170000 - 0x00007ff96f020000 C:\windows\System32\DriverStore\FileRepository\iigd_dch.inf_amd64_d9c21d7d43c1adb3\ig9icd64.dll
0x00007ff9b7e10000 - 0x00007ff9b7efb000 C:\windows\system32\dxgi.dll
0x00007ff99f200000 - 0x00007ff9a11c8000 C:\windows\System32\DriverStore\FileRepository\iigd_dch.inf_amd64_d9c21d7d43c1adb3\igc64.dll
0x00007ff9a1280000 - 0x00007ff9a139a000 C:\windows\System32\DriverStore\FileRepository\iigd_dch.inf_amd64_d9c21d7d43c1adb3\igdgmm64.dll
0x00007ff99ccd0000 - 0x00007ff99cd6e000 C:\windows\System32\TextInputFramework.dll
0x00007ff9ac3e0000 - 0x00007ff9ac686000 C:\windows\System32\iertutil.dll
0x00007ff986790000 - 0x00007ff9867e8000 C:\Users\<User>\AppData\Local\Temp\lwjgl<User>\3.2.2-build-10\lwjgl_opengl.dll
0x00007ff983910000 - 0x00007ff98398f000 C:\Users\<User>\AppData\Local\Temp\lwjgl<User>\3.2.2-build-10\lwjgl_stb.dll
0x00007ff9b7a40000 - 0x00007ff9b7c34000 C:\windows\SYSTEM32\dbghelp.dll
VM Arguments:
jvm_args: -javaagent:D:\IntelliJ IDEA 2021.1.1\lib\idea_rt.jar=58472:D:\IntelliJ IDEA 2021.1.1\bin -Dfile.encoding=UTF-8
java_command: net.peanuuutz.graphics.TexturesKt
java_class_path (initial): C:\Users\<User>\.jdks\corretto-1.8.0_302\jre\lib\charsets.jar;C:\Users\<User>\.jdks\corretto-1.8.0_302\jre\lib\ext\access-bridge-64.jar;C:\Users\<User>\.jdks\corretto-1.8.0_302\jre\lib\ext\cldrdata.jar;C:\Users\<User>\.jdks\corretto-1.8.0_302\jre\lib\ext\dnsns.jar;C:\Users\<User>\.jdks\corretto-1.8.0_302\jre\lib\ext\jaccess.jar;C:\Users\<User>\.jdks\corretto-1.8.0_302\jre\lib\ext\jfxrt.jar;C:\Users\<User>\.jdks\corretto-1.8.0_302\jre\lib\ext\localedata.jar;C:\Users\<User>\.jdks\corretto-1.8.0_302\jre\lib\ext\nashorn.jar;C:\Users\<User>\.jdks\corretto-1.8.0_302\jre\lib\ext\sunec.jar;C:\Users\<User>\.jdks\corretto-1.8.0_302\jre\lib\ext\sunjce_provider.jar;C:\Users\<User>\.jdks\corretto-1.8.0_302\jre\lib\ext\sunmscapi.jar;C:\Users\<User>\.jdks\corretto-1.8.0_302\jre\lib\ext\sunpkcs11.jar;C:\Users\<User>\.jdks\corretto-1.8.0_302\jre\lib\ext\zipfs.jar;C:\Users\<User>\.jdks\corretto-1.8.0_302\jre\lib\jce.jar;C:\Users\<User>\.jdks\corretto-1.8.0_302\jre\lib\jfr.jar;C:\Users\<User>\.jdks\corretto-1.8.0_302\jre\lib\jfxswt.jar;C:\Users\<User>\.jdks\corretto-1.8.0_302\jre\lib\jsse.jar;C:\Users\<User>\.jdks\corretto-1.8.0_302\jre\lib\management-agent.jar;C:\Users\<User>\.jdks\corretto-1.8.0_302\jre\lib\resources.jar;C:\Users\<User>\.jdks\corretto-1.8.0_302\jre\lib\rt.jar;E:\Everyday\Amateur\CS\Kotlin\Exercises\Graphics\build\classes\kotlin\test;E:\Everyday\Amateur\CS\Kotlin\Exercises\Graphics\build\classes\kotlin\main;E:\Everyday\Amateur\CS\Kotlin\Exercises\Graphics\build\resources\main;D:\Cache\.gradle\caches\modules-2\files-2.1\org.jetbrains.kotlin\kotlin-stdlib\1.4.32\461367948840adbb0839c51d91ed74ef4a9ccb52\kotlin-stdlib-1.4.32.jar;D:\Cache\.gradle\caches\modules-2\files-2.1\org.lwjgl\lwjgl-assimp\3.2.2\d4128312444099cea3c4dbb77f5098d19e340d\lwjgl-assimp-3.2.2.jar;D:\Cache\.gradle\caches\modules-2\files-2.1\org.lwjgl\lwjgl-glfw\3.2.2\d3ad4df38e400b8afba1de63f84338809399df5b\lwjgl-glfw-3.2.2.jar;D:\Cache\.gradle\caches\modules-2\files-2.1\org.lwjgl\lwjgl-openal\3.2.
Launcher Type: SUN_STANDARD
Environment Variables:
JAVA_HOME=C:\Program Files\Java\jdk-11.0.12
PATH=C:\Program Files\Common Files\Oracle\Java\javapath;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;D:\Python\Python39\Scripts\;D:\Python\Python39\;C:\Program Files (x86)\Common Files\Intel\Shared Libraries\redist\intel64_win\compiler;C:\Program Files (x86)\Common Files\Intel\Shared Libraries\redist\intel64\compiler;C:\windows\system32;C:\windows;C:\windows\System32\Wbem;C:\windows\System32\WindowsPowerShell\v1.0\;C:\windows\System32\OpenSSH\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;E:\Minecraft\´´×÷\µØͼ\¹¤¾ß\WorldPainter;C:\Program Files\Java\jdk-11.0.12\bin;D:\Git\cmd;D:\MySQL\bin;D:\gradle-6.8.3\bin;C:\Program Files\nodejs\;E:\Minecraft\Replay\.minecraft\FFmpeg\bin;C:\Program Files (x86)\Common Files\Intel\Shared Libraries\redist\intel64\compiler;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\windows\system32;C:\windows;C:\windows\System32\Wbem;C:\windows\System32\WindowsPowerShell\v1.0\;C:\windows\System32\OpenSSH\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;E:\Minecraft\´´×÷\µØͼ\¹¤¾ß\WorldPainter;E:\Minecraft\Replay\.minecraft\FFmpeg\bin;C:\Program Files (x86)\Common Files\Intel\Shared Libraries\redist\intel64\compiler;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\windows\system32;C:\windows;C:\windows\System32\Wbem;C:\windows\System32\WindowsPowerShell\v1.0\;C:\windows\System32\OpenSSH\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;E:\Minecraft\´´×÷\µØͼ\¹¤¾ß\WorldPainter;E:\Minecraft\Replay\.minecraft\FFmpeg\bin;C:\Program Files (x86)\Common Files\Intel\Shared Libraries\redist\intel64\compiler;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\windows\system32;C:\windows;C:\window;D:\Visual Studio Code\Microsoft VS Code\bin;D:\PyCharm 2020.3\bin;;C:\Users\<User>\AppData\Roaming\npm;D:\Fiddler
USERNAME=<User>
OS=Windows_NT
PROCESSOR_IDENTIFIER=Intel64 Family 6 Model 158 Stepping 13, GenuineIntel
--------------- S Y S T E M ---------------
OS: Windows 10.0 , 64 bit Build 18362 (10.0.18362.329)
CPU:total 12 (initial active 12) (6 cores per cpu, 2 threads per core) family 6 model 158 stepping 13, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3, sse4.1, sse4.2, popcnt, avx, avx2, aes, clmul, erms, 3dnowpref, lzcnt, ht, tsc, tscinvbit, bmi1, bmi2, adx
Memory: 4k page, physical 16614584k(6470396k free), swap 25527480k(11553304k free)
vm_info: OpenJDK 64-Bit Server VM (25.302-b08) for windows-amd64 JRE (1.8.0_302-b08), built on Jul 15 2021 19:37:21 by "Administrator" with MS VC++ 12.0 (VS2013)
time: Thu Oct 07 16:20:51 2021
timezone: ?D1¨²¡À¨º¡Á?¨º¡À??
elapsed time: 0.532927 seconds (0d 0h 0m 0s)
The image is here(png, 512px), and I've saved it in the (maybe) correct place as the code shows.
So what is going on in the native environment? :(
LWJGL 3 does not support on-heap (i.e. non-direct) NIO Buffers when talking to a native library like stb_image. Non-direct/on-heap NIO Buffers are those that are wrappers of a Java byte array.
With LWJGL 3 you always need to use off-heap (i.e. direct) NIO Buffers.
See https://docs.oracle.com/javase/7/docs/api/java/nio/ByteBuffer.html#direct for a further explanation of the differences.
So, instead of
IntBuffer.allocate(1)
you should use:
ByteBuffer.allocateDirect(4).asIntBuffer()
Also you should configure the NIO Buffer to use the same endianness as your platform, since otherwise you will read garbage out of the buffer later (the default endianness of all NIO Buffers is network-byte-order i.e. big endian):
ByteBuffer.allocateDirect(4).order(ByteOrder.nativeOrder()).asIntBuffer()
and since the above is quite a mouthfull, LWJGL 3 provides a BufferUtils class with simple wrappers, like:
BufferUtils.createIntBuffer​(1)
to achieve the same as above.
And last but not least, doing correct and efficient memory management in LWJGL 3 is more involved, because in this particular case, you'd be better off using a MemoryStack.
See: https://blog.lwjgl.org/memory-management-in-lwjgl-3/

ELF program segments offset in file

I have a question,about elf program segments offsize in file. For example , a program readelf -f xx -W like this:
Program Headers:
Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align
PHDR 0x000040 0x0000000000400040 0x0000000000400040 0x0001f8 0x0001f8 R E 0x8
INTERP 0x000238 0x0000000000400238 0x0000000000400238 0x00001c 0x00001c R 0x1
[Requesting program interpreter: /lib64/ld-linux-x86-64.so.2]
LOAD 0x000000 0x0000000000400000 0x0000000000400000 0x4ca8e6 0x4ca8e6 R E 0x200000
LOAD 0x4cb000 0x0000000000acb000 0x0000000000acb000 0x035db8 0x04ed80 RW 0x200000
DYNAMIC 0x4ed4c8 0x0000000000aed4c8 0x0000000000aed4c8 0x000230 0x000230 RW 0x8
NOTE 0x000254 0x0000000000400254 0x0000000000400254 0x000044 0x000044 R 0x4
TLS 0x4cb000 0x0000000000acb000 0x0000000000acb000 0x000010 0x000018 R 0x10
GNU_EH_FRAME 0x3dcf04 0x00000000007dcf04 0x00000000007dcf04 0x024c64 0x024c64 R 0x4
GNU_STACK 0x000000 0x0000000000000000 0x0000000000000000 0x000000 0x000000 RW 0x10
Section to Segment mapping:
Segment Sections...
00
01 .interp
02 .interp .note.ABI-tag .note.gnu.build-id .gnu.hash .dynsym .dynstr .gnu.version .gnu.version_r .rela.dyn .rela.plt .init .plt .text .fini .rodata .eh_frame_hdr .eh_frame .gcc_except_table
03 .tdata .init_array .fini_array .jcr .data.rel.ro .dynamic .got .got.plt .data .bss
04 .dynamic
05 .note.ABI-tag .note.gnu.build-id
06 .tdata .tbss
07 .eh_frame_hdr
08
The first load begin at offset 0x000000 and the size is 0x4ca8e6. why the second offset not (0x000000 + 0x4ca8e6), I see the (0x4cb000 - 0x4ca8e6) content, all 0. I can't get it. What the rule about the offset in file?
The first load begin at offset 0x000000 and the size is 0x4ca8e6. why the second offset not (0x000000 + 0x4ca8e6)
Because the loader mmaps LOAD segments directly into memory, for each LOAD segment the following must be true: (p_vaddr - p_offset) % page_size == 0.
On x86_64 the maximum page size is 2MiB (0x200000). This places severe restriction on the second (and subsequent) LOAD segment location.

QEMU how-to allocate specific IRQ number for PCI device?

I'm running qemu-system-x86_64 with my new pci device. And i want to use IRQ 17 (Since driver from kernel listen for IRQ 17). But my PCI device take IRQ 10 or 11. base on interrupt_pin(A,B,C,E).
Then i want to send irq to kernel module by qemu_irq_pulse.
This is how i allocate irq:
pci_config_set_interrupt_pin(pci_dev->config, 1);
d->irq = pci_allocate_irq(pci_dev)
root#hostname:~# cat /proc/interrupts
CPU0
0: 48 IO-APIC 2-edge timer
1: 9 IO-APIC 1-edge i8042
4: 1440 IO-APIC 4-edge ttyS0
8: 1 IO-APIC 8-edge rtc0
9: 0 IO-APIC 9-fasteoi acpi
12: 125 IO-APIC 12-edge i8042
24: 773 PCI-MSI 512000-edge ahci[0000:00:1f.2]
25: 355 PCI-MSI 32768-edge eth0-rx-0
26: 160 PCI-MSI 32769-edge eth0-tx-0
27: 1 PCI-MSI 32770-edge eth0
lspci -nk -vv:
00:1f.3 0880: 10de:0101 (rev 01)
Subsystem: 1af4:1100
Control: I/O+ Mem+ BusMaster- SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR+ FastB2B- DisINTx-
Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
Interrupt: pin A routed to IRQ 10
Capabilities: [80] MSI: Enable- Count=1/1 Maskable- 64bit+
Address: 0000000000000000 Data: 0000
Kernel driver failed to request irq since it trying to attach to IRQ 17. I don't want to change kernel side.
This is what i want to see:
root#hostname:~# cat /proc/interrupts
CPU0
0: 2213 IO-APIC
17: 0 IO-APIC 17-fasteoi some_kernel_driver_name
How to allocate interrupt 17 for PCI device in qemu?
Im not sure it is correct answer but for me it helps:
Add to ACPI:
irqs = 17;
aml_append(crs, aml_interrupt(AML_CONSUMER, AML_EDGE,
AML_ACTIVE_HIGH, AML_SHARED,
&irqs, 1));
Also PCI interrupt number looks like somehow depends on PCI vendor_id and device_id.

What is the format of special section in ELF

I try to write a program to generate ELF(based on Arm and execute through qemu-arm). Most format in ELF has been well illustrated
on wiki. But I can't find any spec describe the format of special section(e.g. .text .data(especially what I want to know)).
I tried to put some initialized global variable in .data section. What format should I write in ELF(.data section) if I have global statement like: int a = 10;
There is not special format for .text and .data.
When the static linker links several .o file,
it simply concatenates the .text and .data segments (while resolving relocations)
and places them in the final .so or executable file according to the linker script (see gcc -Wl,-verbose /dev/null).
The .data segment simply contains the initial values of the instanciated global variables.
The .text segment simply contains the machine code of the routines/functions.
Let's take this simple C file:
char x[5] = {0xba, 0xbb, 0xbc, 0xbd, 0xbe};
char f(int i) {
return x[i];
}
Let's compile it:
$ gcc -c -o test.o test.c
Let's dump the .data section, using elfcat:
$ elfcat test.o --section-name .data | xxd
00000000: babb bcbd be .....
We can clearly explain the content of .data section.
Let's dump the .text section:
$ elfcat test.o --section-name .text | xxd
00000000: 5548 89e5 897d fc8b 45fc 4898 488d 1500 UH...}..E.H.H...
00000010: 0000 000f b604 105d c3
Let's decompile this:
$ elfcat test.o --section-name .text > test.text
$ r2 -a x86 -b 64 -qc pd test.text
0x00000000 55 push rbp
0x00000001 4889e5 mov rbp, rsp
0x00000004 897dfc mov dword [rbp - 4], edi
0x00000007 8b45fc mov eax, dword [rbp - 4]
0x0000000a 4898 cdqe
0x0000000c 488d15000000. lea rdx, qword [0x00000013] ; 19
0x00000013 0fb60410 movzx eax, byte [rax + rdx]
0x00000017 5d pop rbp
0x00000018 c3 ret
Again, there is nothing special in the text segment: it only contains the machine code of the routines/functions of my program.
Notice however the relocation and symbol informations in other segments:
$ readelf -a test.o
[ ... ]
Relocation section '.rela.text' at offset 0x1b8 contains 1 entry:
Offset Info Type Sym. Value Sym. Name + Addend
00000000000f 000800000002 R_X86_64_PC32 0000000000000000 x - 4
Relocation section '.rela.eh_frame' at offset 0x1d0 contains 1 entry:
Offset Info Type Sym. Value Sym. Name + Addend
000000000020 000200000002 R_X86_64_PC32 0000000000000000 .text + 0
[...]
Symbol table '.symtab' contains 10 entries:
Num: Value Size Type Bind Vis Ndx Name
0: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND
1: 0000000000000000 0 FILE LOCAL DEFAULT ABS test.c
2: 0000000000000000 0 SECTION LOCAL DEFAULT 1
3: 0000000000000000 0 SECTION LOCAL DEFAULT 3
4: 0000000000000000 0 SECTION LOCAL DEFAULT 4
5: 0000000000000000 0 SECTION LOCAL DEFAULT 6
6: 0000000000000000 0 SECTION LOCAL DEFAULT 7
7: 0000000000000000 0 SECTION LOCAL DEFAULT 5
8: 0000000000000000 5 OBJECT GLOBAL DEFAULT 3 x
9: 0000000000000000 25 FUNC GLOBAL DEFAULT 1 f

How to detect text mode or graphics mode on boot loader?

I want to detect which mode I just using now with BIOS intXX when running bootloader I wrote.
How to detect now is text mode or graphics mode?
Which interrupt function I should use?
Thank you~
I didn't figure out why when I run int 10 ,the value of AL doesn't change.
(0) Breakpoint 1, 0x00007c00 in ?? ()
Next at t=12943079
(0) [0x00007c00] 0000:7c00 (unk. ctxt): mov ah, 0x0f ; b40f
<bochs:3> reg
eax: 0x0000aa55 43605
ecx: 0x00090000 589824
edx: 0x00000000 0
ebx: 0x00000000 0
esp: 0x0000ffd6 65494
ebp: 0x00000000 0
esi: 0x000e476c 935788
edi: 0x0000ffac 65452
eip: 0x00007c00
eflags 0x00000082: id vip vif ac vm rf nt IOPL=0 of df if tf SF zf af pf cf
<bochs:4> n
Next at t=12943080
(0) [0x00007c02] 0000:7c02 (unk. ctxt): mov al, 0xaa ; b0aa
<bochs:5> reg
eax: 0x00000f55 3925
ecx: 0x00090000 589824
edx: 0x00000000 0
ebx: 0x00000000 0
esp: 0x0000ffd6 65494
ebp: 0x00000000 0
esi: 0x000e476c 935788
edi: 0x0000ffac 65452
eip: 0x00007c02
eflags 0x00000082: id vip vif ac vm rf nt IOPL=0 of df if tf SF zf af pf cf
<bochs:6> n
Next at t=12943081
(0) [0x00007c04] 0000:7c04 (unk. ctxt): int 0x0a ; cd0a
<bochs:7> reg
eax: 0x00000faa 4010
ecx: 0x00090000 589824
edx: 0x00000000 0
ebx: 0x00000000 0
esp: 0x0000ffd6 65494
ebp: 0x00000000 0
esi: 0x000e476c 935788
edi: 0x0000ffac 65452
eip: 0x00007c04
eflags 0x00000082: id vip vif ac vm rf nt IOPL=0 of df if tf SF zf af pf cf
<bochs:8> n
Next at t=12943083
(0) [0x00007c06] 0000:7c06 (unk. ctxt): mov dl, al ; 88c2
<bochs:9> reg
eax: 0x00000faa 4010
ecx: 0x00090000 589824
edx: 0x00000000 0
ebx: 0x00000000 0
esp: 0x0000ffd6 65494
ebp: 0x00000000 0
esi: 0x000e476c 935788
edi: 0x0000ffac 65452
eip: 0x00007c06
eflags 0x00000082: id vip vif ac vm rf nt IOPL=0 of df if tf SF zf af pf cf
<bochs:10>
INT10, F
AH = 0F
on return:
AL = mode currently set(page mode)
BH = current display page
Page mode:
AL = 00 40x25 B/W text (CGA,EGA,MCGA,VGA)
= 01 40x25 16 color text (CGA,EGA,MCGA,VGA)
= 02 80x25 16 shades of gray text (CGA,EGA,MCGA,VGA)
= 03 80x25 16 color text (CGA,EGA,MCGA,VGA)
= 04 320x200 4 color graphics (CGA,EGA,MCGA,VGA)
= 05 320x200 4 color graphics (CGA,EGA,MCGA,VGA)
= 06 640x200 B/W graphics (CGA,EGA,MCGA,VGA)
= 07 80x25 Monochrome text (MDA,HERC,EGA,VGA)
= 08 160x200 16 color graphics (PCjr)
= 09 320x200 16 color graphics (PCjr)
= 0A 640x200 4 color graphics (PCjr)
= 0B Reserved (EGA BIOS function 11)
= 0C Reserved (EGA BIOS function 11)
= 0D 320x200 16 color graphics (EGA,VGA)
= 0E 640x200 16 color graphics (EGA,VGA)
= 0F 640x350 Monochrome graphics (EGA,VGA)
= 10 640x350 16 color graphics (EGA or VGA with 128K)
640x350 4 color graphics (64K EGA)
= 11 640x480 B/W graphics (MCGA,VGA)
= 12 640x480 16 color graphics (VGA)
= 13 320x200 256 color graphics (MCGA,VGA)
= 8x EGA, MCGA or VGA ignore bit 7, see below
= 9x EGA, MCGA or VGA ignore bit 7, see below