OberonCore

Библиотека  Wiki  Форум  BlackBox  Компоненты  Проекты
Текущее время: Пятница, 29 Март, 2024 02:21

Часовой пояс: UTC + 3 часа




Начать новую тему Ответить на тему  [ Сообщений: 19 ] 
Автор Сообщение
СообщениеДобавлено: Понедельник, 20 Июль, 2020 19:35 

Зарегистрирован: Вторник, 01 Март, 2011 09:34
Сообщения: 583
Откуда: Москва
luowy писал(а):
I'd like to focus on llvm,
according to my skills, the first step is 32bit-x86 compiler on windows,
After getting familiar with llvm, then to next step...

The several steps are done already.

MultiOberon https://github.com/dvdagaev/Mob compiler supports 32/64bit x86/x64 for Windows and Linux. It can be used from BlackBox or from command line.
Example 1 - 32 bit Hello, World
Код:
c:\suok5\Mob>Blwe\omlsh co -odc OmtestHelloWorld
oml:compiling c:\suok5\Mob/Omtest/Mod/HelloWorld.odc  >c:\suok5\Mob/Omtest/Clwe/OmtestHelloWorld .ll=9742 .bc=3416

c:\suok5\Mob>Blwe\omlsh build -odc OmtestHelloWorld
===== obj-building HostConLog ... done
===== obj-building OmtestHelloWorld ... done

c:\suok5\Mob>Blwe\omlsh run OmtestHelloWorld
Hello, World

omlsh compile 32-bit shell compiles into byte code, omlsh build builds into obj file, and omlsh run executes binary loaded files. Blwe means catalog for 32-bit shell/

Example 2 - 64 bit Hello, World is
Код:
c:\suok5\Mob>Blwr\omlsh co -odc OmtestHelloWorld
oml:compiling c:\suok5\Mob/Omtest/Mod/HelloWorld.odc
  new symbol file >c:\suok5\Mob/Omtest/Clwr/OmtestHelloWorld .ll=9742 .bc=3424

c:\suok5\Mob>Blwr\omlsh build -odc OmtestHelloWorld
===== obj-building HostConLog ... done
===== obj-building OmtestHelloWorld ... done

c:\suok5\Mob>Blwr\omlsh run OmtestHelloWorld
Hello, World

Blwr\omlsh is 64-bit shell.

The call from BlackBox is also available
Код:
OmlCompiler.CompileThis -64 OmtestHelloWorld


Вернуться к началу
 Профиль  
 
СообщениеДобавлено: Вторник, 21 Июль, 2020 14:35 

Зарегистрирован: Суббота, 04 Май, 2019 10:21
Сообщения: 29
@Dmitry Dagaev
thanks your great work!

I am trying to make a clean win32 workspace: llvm-win32/

1, I copy the necessary dir&files to it from the repo Mob/ :
Llvm/, Host/, Omc/, Oml/,Omtest/, System/ (delete all subdir *u*/ and *wr/, remain *we/)
and unzip Blwe/ to it(set this path to env)

2,follow the "Oml/Docu/quick-start", win32 section,

1) installation...passed
2) Compiling Examples
... passed

stop at:
OmlLinker.BuildFiles -tl 2 -a -opt '-O1' OmtestHelloWorld

System/Clwe>llc -filetype=obj -march=x86 opt.ll -o opt.o
llc: opt.ll: error: Could not open input file: no such file or directory
===== obj-building opt *error*= -3 *interrupted*

no opt.ll , how can I do?

3, another question about System/Mod/Api
Код:
MODULE Api["KERNEL32.dll"];
...
   PROCEDURE [ccall] _popen* ["MSVCRT", ""] (IN command: String; IN mode: String): PtrFILE;
   PROCEDURE [ccall] _pclose* ["MSVCRT", ""] (p: PtrFILE): INTEGER;
   PROCEDURE [ccall] feof* ["MSVCRT", ""] (p: PtrFILE): INTEGER;
   PROCEDURE [ccall] fgets* ["MSVCRT", ""] (VAR s: String; sz: INTEGER; p: PtrFILE): INTEGER;
   
   
   PROCEDURE [ccall] getpid* ["_getpid"] (): INTEGER;

PROCEDURE [ccall] SetCurrentDirectoryA* (IN lpBuffer: String): INTEGER;
....

1) where is "MSVCRT" ?
2)does "KERNEL32.dll" has "_getpid" ?
3) is "SetCurrentDirectoryA" a "ccall"?


Вернуться к началу
 Профиль  
 
СообщениеДобавлено: Вторник, 21 Июль, 2020 14:47 

Зарегистрирован: Суббота, 04 Май, 2019 10:21
Сообщения: 29
Дмитрий Дагаев писал(а):
Example 1 - 32 bit Hello, World
Код:
c:\suok5\Mob>Blwe\omlsh co -odc OmtestHelloWorld
oml:compiling c:\suok5\Mob/Omtest/Mod/HelloWorld.odc  >c:\suok5\Mob/Omtest/Clwe/OmtestHelloWorld .ll=9742 .bc=3416

c:\suok5\Mob>Blwe\omlsh build -odc OmtestHelloWorld
===== obj-building HostConLog ... done
===== obj-building OmtestHelloWorld ... done

c:\suok5\Mob>Blwe\omlsh run OmtestHelloWorld
Hello, World
test your demo above, i get a error:
Код:
1,ok,
2,ok,
3,D:\bb5\llvm-win32\AA-Mob>Blwe\omlsh run OmtestHelloWorld
*** trap # 23 135F600
HostFiles.ReadBytes<OmcObjLoader.ReadCodeAndData<OmcObjLoader.ReadModule<OmcLoader.LoadMod<OmcLoader.ThisMod<Runner.ThisMod<Kernel.ThisMod<OmcShell.RunModule<OmcShell.Run<OmlSh.Run<Runner.RunModule<Runner.EntryPoint<Runner.SetRun<OmlSh._body<OmlSh._main
P.S. my env is win10-x64, vs2019 community


Вернуться к началу
 Профиль  
 
СообщениеДобавлено: Вторник, 21 Июль, 2020 20:09 

Зарегистрирован: Вторник, 01 Март, 2011 09:34
Сообщения: 583
Откуда: Москва
luowy писал(а):
@Dmitry Dagaev
thanks your great work!

I am trying to make a clean win32 workspace: llvm-win32/

1, I copy the necessary dir&files to it from the repo Mob/ :
Llvm/, Host/, Omc/, Oml/,Omtest/, System/ (delete all subdir *u*/ and *wr/, remain *we/)
and unzip Blwe/ to it(set this path to env)

First you need installation, call:
Код:
win_toinstall.vbs 17 "c:\Your BlackBox Path"

Or you can set blackBoxPath = "c:\Your BlackBox Path" in win_toinstall.vbs and call
Код:
win_toinstall.vbs
without params.
So you do not need to explicitely unzip Blwe and others.


Вернуться к началу
 Профиль  
 
СообщениеДобавлено: Вторник, 21 Июль, 2020 20:19 

Зарегистрирован: Вторник, 01 Март, 2011 09:34
Сообщения: 583
Откуда: Москва
luowy писал(а):
stop at:
OmlLinker.BuildFiles -tl 2 -a -opt '-O1' OmtestHelloWorld

System/Clwe>llc -filetype=obj -march=x86 opt.ll -o opt.o
llc: opt.ll: error: Could not open input file: no such file or directory
===== obj-building opt *error*= -3 *interrupted*

no opt.ll , how can I do?

-a is a deprecated option, several functional changes are rapidly done before version 1.0 (it's 0.95 now) and must be corrected in docs.
Use:
Код:
OmlLinker.BuildFiles -pl 2 -opt '-O1' OmtestHelloWorld

where -opt append llc options, -pl means print level
Код:
Omtest/Clwe>llc -filetype=obj -march=x86 -O1 OmtestHelloWorld.ll -o OmtestHelloWorld.o
===== obj-building OmtestHelloWorld ... done


Вернуться к началу
 Профиль  
 
СообщениеДобавлено: Вторник, 21 Июль, 2020 20:39 

Зарегистрирован: Вторник, 01 Март, 2011 09:34
Сообщения: 583
Откуда: Москва
luowy писал(а):
3, another question about System/Mod/Api
Код:
MODULE Api["KERNEL32.dll"];
...
   PROCEDURE [ccall] _popen* ["MSVCRT", ""] (IN command: String; IN mode: String): PtrFILE;
   PROCEDURE [ccall] _pclose* ["MSVCRT", ""] (p: PtrFILE): INTEGER;
   PROCEDURE [ccall] feof* ["MSVCRT", ""] (p: PtrFILE): INTEGER;
   PROCEDURE [ccall] fgets* ["MSVCRT", ""] (VAR s: String; sz: INTEGER; p: PtrFILE): INTEGER;
   
   
   PROCEDURE [ccall] getpid* ["_getpid"] (): INTEGER;

PROCEDURE [ccall] SetCurrentDirectoryA* (IN lpBuffer: String): INTEGER;
....

1) where is "MSVCRT" ?
2)does "KERNEL32.dll" has "_getpid" ?
3) is "SetCurrentDirectoryA" a "ccall"?

First of all, there are serveral platform-specific modules, including Api, Kernel, Runner, etc. In this version of MultiOberon (to be changed) they are placed as following (Kernel and Runner locations are the same):
- Mod/Api for Omb - BlackBox,
- Mfwe/Api for Omf - OFront,
- Mlwe/Api for Oml - LLVM.
This version is used by Runner only.

1.msvcrt is normally in \Windows\system32.
2.you're right, _getpid is not in KERNEL32.dll. But Api.getpid is never used. Nevertheless, thanks, I'll fix it.
3.Again, I'll fix it.


Вернуться к началу
 Профиль  
 
СообщениеДобавлено: Вторник, 21 Июль, 2020 20:49 

Зарегистрирован: Вторник, 01 Март, 2011 09:34
Сообщения: 583
Откуда: Москва
luowy писал(а):
Код:
3,D:\bb5\llvm-win32\AA-Mob>Blwe\omlsh run OmtestHelloWorld
*** trap # 23 135F600
HostFiles.ReadBytes<OmcObjLoader.ReadCodeAndData<OmcObjLoader.ReadModule<OmcLoader.LoadMod<OmcLoader.ThisMod<Runner.ThisMod<Kernel.ThisMod<OmcShell.RunModule<OmcShell.Run<OmlSh.Run<Runner.RunModule<Runner.EntryPoint<Runner.SetRun<OmlSh._body<OmlSh._main
P.S. my env is win10-x64, vs2019 community

There are 2 ways of module loading for Oml:
1. .o obj file loader;
2. .bc llvm bytecode loader.

A. You can try way 2, calling
Код:
Blwe\omlsh run OmtestHelloWorld -ext bc

B. It's not clear for me what is the problem with object .o loader. You can set a trace level 3 and send me full print for investigation.
Код:
Blwe\omlsh run OmtestHelloWorld -tl 3


Вернуться к началу
 Профиль  
 
СообщениеДобавлено: Среда, 22 Июль, 2020 16:47 

Зарегистрирован: Суббота, 04 Май, 2019 10:21
Сообщения: 29
Код:
Blwe\omlsh run OmtestHelloWorld -ext bc
Hello, World


Код:
Blwe\omlsh run OmtestHelloWorld -tl 3
AddForInstall HostConLog
---------- ReadHeader OmtestHelloWorld
*Unexpected Machine= 014C
Machine=014C
Header number_of_sections: 3 time_date_stamp: 0 pointer_to_symbol_table: 1880 number_of_symbols: 30 size_op_optional_header: 0 characteristics: {}
Section name: .text virtual_address: 0 size_of_raw_data: 671 pointer_to_raw_data: 140 pointer_to_relocations: 811 pointer_to_line_numbers: 0 number_of_relocations: 47 characteristics: {5, 20, 22, 29, 30}
Section name: .data virtual_address: 0 size_of_raw_data: 506 pointer_to_raw_data: 1284 pointer_to_relocations: 1790 pointer_to_line_numbers: 0 number_of_relocations: 9 characteristics: {6, 20, 22, 30, 31}
Section name: .bss virtual_address: 0 size_of_raw_data: 4 pointer_to_raw_data: 0 pointer_to_relocations: 0 pointer_to_line_numbers: 0 number_of_relocations: 0 characteristics: {7, 20, 21, 30, 31}
SymbolTable number_of_symbols 30
.text* 0 1 0 3 1 0#
$ 671 47 -200684551 1 1#
.data* 0 2 0 3 1 2#
$ 506 9 -2130031411 2 3#
.bss* 0 3 0 3 1 4#
$ 4 0 0 3 5#
@feat.00* 1 -1 0 3 0 6#
_OmtestHelloWorld__reg* 0 1 32 2 0 7#
_OmtestHelloWorld__desc* 128 2 0 2 0 8#
_Kernel_dLink* 0 0 0 2 0 9#
_Kernel__reg* 0 0 0 2 0 10#
_Runner__reg* 0 0 0 2 0 11#
_OLog__reg* 0 0 0 2 0 12#
_HostConLog__reg* 0 0 0 2 0 13#
_Kernel_RegisterStaticMod* 0 0 0 2 0 14#
_OmtestHelloWorld__body* 160 1 32 2 0 15#
_Kernel__body* 0 0 0 2 0 16#
_Runner__body* 0 0 0 2 0 17#
_OLog__body* 0 0 0 2 0 18#
_HostConLog__body* 0 0 0 2 0 19#
_OmtestHelloWorld_MAIN* 320 1 32 2 0 20#
_Runner_SetRun* 0 0 0 2 0 21#
_OLog_String* 0 0 0 2 0 22#
_OLog_Ln* 0 0 0 2 0 23#
_main* 560 1 32 2 0 24#
_Kernel_Main* 0 0 0 2 0 25#
_Runner__desc* 0 0 0 2 0 26#
_Kernel__desc* 0 0 0 2 0 27#
_OLog__desc* 0 0 0 2 0 28#
_OmtestHelloWorld__inames* 48 2 0 2 0 29#
Relocations .text 0sect
 10 2 .data* 6
 16 8 _OmtestHelloWorld__desc* 6
 22 9 _Kernel_dLink* 6
 39 9 _Kernel_dLink* 6
 44 8 _OmtestHelloWorld__desc* 6
 66 9 _Kernel_dLink* 6
 73 9 _Kernel_dLink* 6
 92 8 _OmtestHelloWorld__desc* 6
 97 10 _Kernel__reg* 20
 102 11 _Runner__reg* 20
 107 12 _OLog__reg* 20
 112 13 _HostConLog__reg* 20
 118 8 _OmtestHelloWorld__desc* 6
 126 14 _Kernel_RegisterStaticMod* 20
 131 9 _Kernel_dLink* 6
 138 9 _Kernel_dLink* 6
 170 2 .data* 6
 176 8 _OmtestHelloWorld__desc* 6
 182 9 _Kernel_dLink* 6
 199 9 _Kernel_dLink* 6
 204 8 _OmtestHelloWorld__desc* 6
 226 9 _Kernel_dLink* 6
 233 9 _Kernel_dLink* 6
 252 8 _OmtestHelloWorld__desc* 6
 257 16 _Kernel__body* 20
 262 17 _Runner__body* 20
 267 18 _OLog__body* 20
 272 19 _HostConLog__body* 20
 278 20 _OmtestHelloWorld_MAIN* 6
 286 21 _Runner_SetRun* 20
 291 9 _Kernel_dLink* 6
 298 9 _Kernel_dLink* 6
 334 9 _Kernel_dLink* 6
 346 8 _OmtestHelloWorld__desc* 6
 354 2 .data* 6
 364 9 _Kernel_dLink* 6
 505 22 _OLog_String* 6
 528 23 _OLog_Ln* 6
 533 9 _Kernel_dLink* 6
 540 9 _Kernel_dLink* 6
 583 2 .data* 6
 589 8 _OmtestHelloWorld__desc* 6
 595 9 _Kernel_dLink* 6
 613 9 _Kernel_dLink* 6
 637 25 _Kernel_Main* 20
 652 9 _Kernel_dLink* 6
 659 9 _Kernel_dLink* 6
Relocations .data 1sect
 28 26 _Runner__desc* 6
 32 27 _Kernel__desc* 6
 36 28 _OLog__desc* 6
 104 20 _OmtestHelloWorld_MAIN* 6
 164 15 _OmtestHelloWorld__body* 6
 212 2 .data* 6
 216 4 .bss* 6
 220 2 .data* 6
 224 2 .data* 6
---------- end-of-ReadHeader OmtestHelloWorld 0
++++++++++ ReadModule OmtestHelloWorld
external _Kernel_dLink= 1187A2C
external _Kernel__reg= 111E1E0
external _Runner__reg= 111E1E0
external _OLog__reg= 111E1E0
external _HostConLog__reg= 111E1E0
external _Kernel_RegisterStaticMod= 111E1E0
external _Kernel__body= 111E1E0
external _Runner__body= 111E1E0
external _OLog__body= 111E1E0
external _HostConLog__body= 111E1E0
external _Runner_SetRun= FBA7E0
external _OLog_String= 1186534
external _OLog_Ln= 1186554
external _Kernel_Main= 111E1E0
external _Runner__desc= 1146750
external _Kernel__desc= 1144D70
external _OLog__desc= 1143570
Calculated Optional Header magic: 0 size_of_code: 4096 additional_code_size: 0 size_of_initialized_data: 506 size_of_uninitialized_data: 4 address_of_entry_point: 0 base_of_code: 4096 base_of_data: 8192 base_of_additional_code: 672
Desc addr/size= 620000 506 Mod addr/size= 640000 4100 Alast addr= 0
*** trap # 23 4FF8FC
HostFiles.ReadBytes<OmcObjLoader.ReadCodeAndData<OmcObjLoader.ReadModule<OmcLoader.LoadMod<OmcLoader.ThisMod<Runner.ThisMod<Kernel.ThisMod<OmcShell.RunModule<OmcShell.Run<OmlSh.Run<Runner.RunModule<Runner.EntryPoint<Runner.SetRun<OmlSh._body<OmlSh._main




Вернуться к началу
 Профиль  
 
СообщениеДобавлено: Четверг, 23 Июль, 2020 12:15 

Зарегистрирован: Вторник, 01 Март, 2011 09:34
Сообщения: 583
Откуда: Москва
Hope It's Fixed. Update with recent commit.


Вернуться к началу
 Профиль  
 
СообщениеДобавлено: Четверг, 23 Июль, 2020 14:32 

Зарегистрирован: Суббота, 04 Май, 2019 10:21
Сообщения: 29
Код:
D:\bb5\llvm-win32\AA-Mob>Blwe\omlsh run OmtestHelloWorld
Hello, World


Вернуться к началу
 Профиль  
 
СообщениеДобавлено: Четверг, 23 Июль, 2020 15:23 

Зарегистрирован: Суббота, 04 Май, 2019 10:21
Сообщения: 29
@Дмитрий Дагаев
when I compile the OmcObjLoader_Coff (Omc/Mod/ObjLoader_Coff),it pop up a compiler trap;
after some debug, it here:
Код:
   ldata := SYSTEM.VAL(LONGINT, symt.sl.ptr) + data
               - SYSTEM.ADR(target[4+rel.type_indicator-IMAGE_REL_AMD64_REL32] );
A simple example of triggering this trap:
Код:
MODULE ObxBugs;

   IMPORT SYSTEM;
   
   PROCEDURE Do();
      VAR
      l: LONGINT;
      x: INTEGER;
   BEGIN
      l := SYSTEM.VAL(LONGINT, x) + SYSTEM.ADR(x);
   END Do;


END ObxBugs.
I am curious how you compiled it?


Вернуться к началу
 Профиль  
 
СообщениеДобавлено: Пятница, 24 Июль, 2020 09:08 

Зарегистрирован: Вторник, 01 Март, 2011 09:34
Сообщения: 583
Откуда: Москва
luowy писал(а):
I am curious how you compiled it?

You can compile it by Oml LLVM Compiler
Код:
OmlCompiler.CompileThis OmcObjLoader_Coff

or for 64-bit
Код:
OmlCompiler.CompileThis -64 OmcObjLoader_Coff


And yor Can't compile it by Omb (for BlackBox) or DevCompiler.

Basically Omb backend inherits problems from DevCompiler. In this particular case it is expected to have frontend correct diagnostics. But the conversion problem is a particular DevCompiler backend problem. I think that this conversion is valid from the frontends point of view.

By the way, the following code compiles without traps
Код:
            ldata := SYSTEM.VAL(LONGINT, symt.sl.ptr) + data;
            ll := SYSTEM.ADR(target[4+rel.type_indicator-IMAGE_REL_AMD64_REL32]);
            ldata := ldata - ll;


Вернуться к началу
 Профиль  
 
СообщениеДобавлено: Пятница, 24 Июль, 2020 11:35 

Зарегистрирован: Суббота, 04 Май, 2019 10:21
Сообщения: 29
thanks your reply! open a discussion on Center Forum https://community.blackboxframework.org/viewtopic.php?f=48&t=258


Вернуться к началу
 Профиль  
 
СообщениеДобавлено: Вторник, 15 Декабрь, 2020 11:30 

Зарегистрирован: Вторник, 01 Март, 2011 09:34
Сообщения: 583
Откуда: Москва
kekc_leader писал(а):
Попробовал установить на другом компьютере, с Дебианом. Получил вот такую ошибку:

error while loading shared libraries: libtinfo.so.5: cannot open shared object file: No such file or directory while executing...

Код:
kekc@zerkalo:~/prg/Mob-master$ tclsh lin_toinstall.tcl /home/kekc/prg/blackbox
installing bb1.7 for linux
unzip -u Binue.zip ...  done
unzip -u Binur.zip ...  done
unzip -u Binue_llc.zip ...  done
unzip -u Binur_llc.zip ...  done
Binue/omlc: error while loading shared libraries: libtinfo.so.5: cannot open shared object file: No such file or directory
    while executing
"exec Binue/omlc co -h -odc Api_lue Math_lu OStrings_lu OLog_lu Kernel_lue17 Runner_lue17 Files_17 Times Testing Baseloader_17 HostApi_lue HostConLog_l..."
    (file "lin_toinstall.tcl" line 137)


Для работы Oml требуется пакет tinfo. Причем, и для 32-бит, и для 64-бит. Я попросил - мне его поставили.
Учитывая Ваш опыт, не все пакеты могут использоваться. Поэтому я подложил свои libtinfo.so.5 в каталоги разделяемых библиотек Binue.zip, Binur.zip. Поэтому обновите версию, эта проблема должна уйти.


Вернуться к началу
 Профиль  
 
СообщениеДобавлено: Среда, 20 Январь, 2021 10:27 

Зарегистрирован: Вторник, 01 Март, 2011 09:34
Сообщения: 583
Откуда: Москва
Чтобы не писать все в одну тему
Comdiv писал(а):
А в чём различие в метаданных?

Метаданные в Kernel зависят от размерности указателя. Для 32-бит это:
Код:
      Module* = POINTER TO RECORD [untagged]
         next-: Module;
         opts-: SET;   (* 0..15: compiler opts, 16..31: kernel flags *)
         refcnt-: INTEGER;   (* <0: module invalidated *)
         compTime-, loadTime-: ARRAY 6 OF SHORTINT;
         ext-: INTEGER;   (* currently not used *)
         term-: Command;   (* terminator *)
         nofimps-, nofptrs-: INTEGER;
         csize-, dsize-, rsize-: INTEGER;
         code-, data-, refs-: INTEGER;
         procBase-, varBase-: INTEGER;   (* meta base addresses *)
         names-: POINTER TO ARRAY [untagged] OF SHORTCHAR;   (* names[0] = 0X *)
         ptrs-: POINTER TO ARRAY [untagged] OF INTEGER;
         imports-: POINTER TO ARRAY [untagged] OF Module;
         export-: Directory;   (* exported objects (name sorted) *)
         name-: Utf8Name
      END;

Для 64 бит будет:
Код:
      Module* = POINTER TO RECORD [untagged]
         next-: Module;
         opts-: SET;   (* 0..15: compiler opts, 16..31: kernel flags *)
         refcnt-: INTEGER;   (* <0: module invalidated *)
         compTime-, loadTime-: ARRAY 6 OF SHORTINT;
         ext-: LONGINT;   (* currently not used *)
         term-: Command;   (* terminator *)
         nofimps-, nofptrs-: INTEGER;
         csize-, dsize-, rsize-: LONGINT;
         code-, data-, refs-: LONGINT;
         procBase-, varBase-: LONGINT;   (* meta base addresses *)
         names-: POINTER TO ARRAY [untagged] OF SHORTCHAR;   (* names[0] = 0X *)
         ptrs-: POINTER TO ARRAY [untagged] OF LONGINT;
         imports-: POINTER TO ARRAY [untagged] OF Module;
         export-: Directory;   (* exported objects (name sorted) *)
         name-: Utf8Name
      END;


Поэтому, даже в HelloWorld для 32 бит описание модуля будет типом
Код:
%SYSTEM_MODDESC = type { %SYSTEM_MODDESC*, i32, i32, [6 x i16], [6 x i16], void ()*, void ()*, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, [0 x i8]*, [1 x i32]*, [4 x %SYSTEM_MODDESC*]*, %SYSTEM_DIRECTORY*, [256 x i8] }

А для 64 бит типом
Код:
%SYSTEM_MODDESC = type { %SYSTEM_MODDESC*, i32, i32, [6 x i16], [6 x i16], void ()*, void ()*, i32, i32, i64, i64, i64, i64, i64, i64, i64, i64, [0 x i8]*, [1 x i64]*, [4 x %SYSTEM_MODDESC*]*, %SYSTEM_DIRECTORY*, [256 x i8] }


Вернуться к началу
 Профиль  
 
СообщениеДобавлено: Среда, 20 Январь, 2021 12:05 

Зарегистрирован: Четверг, 08 Май, 2008 19:13
Сообщения: 1447
Откуда: Киев
То есть, различие закладывается только на уровне МультиОберона, а не LLVM?
Такое решение было сделано для совместимости или ради экономии? Нет других технических препятствий использовать более ёмкие типы всегда?


Вернуться к началу
 Профиль  
 
СообщениеДобавлено: Среда, 20 Январь, 2021 14:31 

Зарегистрирован: Вторник, 01 Март, 2011 09:34
Сообщения: 583
Откуда: Москва
Учитывались следующие факторы:
1. Совместимость 32-битных метаданных Kernel с Oml/Omf/Omb. Даже загрузку в один shell Oml+Omb+Omf начал было делать, но споткнулся о разное выравнивание.
2. Есть функции, как SYSTEN.ADR возвращающие либо 32, либо 64 целое (Можно, конечно возвращать прямо адрес).
3. Сделал уже и ADRINT - он представляется либо 32, либо 64.
4. А если адрес 128-битный?

При компиляции указывается флаг -32 или -64, если не по умолчанию.


Вернуться к началу
 Профиль  
 
СообщениеДобавлено: Среда, 20 Январь, 2021 15:25 

Зарегистрирован: Четверг, 08 Май, 2008 19:13
Сообщения: 1447
Откуда: Киев
Дмитрий Дагаев писал(а):
4. А если адрес 128-битный?
Если Вы про Эльбрус, то там он не особо полезен для Оберона , по крайне мере через C. Может, его и можно было бы приспособить под Оберон напрямую без промежуточного C, но надо внимательно разбираться, что всё ещё непросто, учитывая состояние документации и доступности самих систем. Я бы это не стал учитывать, а если что - использовал бы косвенность. В JVM указатели 32-битные и ничего :). В крайнем случае, 2-е формата - под 64-битный и 128-битный - это лучше, чем 3-и формата при прочных равных(не всегда). Но если по другим причинам важно, то этого достаточно.


Вернуться к началу
 Профиль  
 
СообщениеДобавлено: Вторник, 04 Апрель, 2023 19:44 

Зарегистрирован: Вторник, 01 Март, 2011 09:34
Сообщения: 583
Откуда: Москва
Вышла статья "Ограничительная семантика языка в системе МультиОберон"


Вернуться к началу
 Профиль  
 
Показать сообщения за:  Поле сортировки  
Начать новую тему Ответить на тему  [ Сообщений: 19 ] 

Часовой пояс: UTC + 3 часа


Кто сейчас на конференции

Сейчас этот форум просматривают: нет зарегистрированных пользователей и гости: 0


Вы не можете начинать темы
Вы не можете отвечать на сообщения
Вы не можете редактировать свои сообщения
Вы не можете удалять свои сообщения
Вы не можете добавлять вложения

Найти:
Вся информация, размещаемая участниками на конференции (тексты сообщений, вложения и пр.) © 2005-2024, участники конференции «OberonCore», если специально не оговорено иное.
Администрация не несет ответственности за мнения, стиль и достоверность высказываний участников, равно как и за безопасность материалов, предоставляемых участниками во вложениях.
Без разрешения участников и ссылки на конференцию «OberonCore» любое воспроизведение и/или копирование высказываний полностью и/или по частям запрещено.
Powered by phpBB® Forum Software © phpBB Group
Русская поддержка phpBB