Игорь Пашев

Sep. 21st, 2012

12:42 am

В этом весь Ынтырпрайз:

https://github.com/illumos/illumos-gate/commit/a0ed50307cf80490d23a92f5eac0bfcd26343dd6

Вместо православного find ... | xargs ... решающего задачу,
которая никогда больше не возникнет, тонны кода на Си (непортируемого, кстати),
для того, чтобы запустить то, что указано в виде точек после xargs выше.


Вот ещё поебень: https://github.com/illumos/illumos-gate/blob/master/usr/src/lib/libipsecutil/common/ipsec_util.h#L213

Они её dlopen().


Ещё (это в libc!): https://github.com/illumos/illumos-gate/blob/master/usr/src/lib/libc/port/gen/attrat.c#L73

И моё любимое: https://github.com/illumos/illumos-gate/blob/master/usr/src/lib/libc/amd64/sys/uadmin.c#L53

Tags: ,
(1 комментарий | Оставить комментарий)

Nov. 13th, 2011

01:41 pm - Чем плох IPS

Я наконец понял, чем меня смущает IPS в Солярке,
помимо многословности манифестов, которые по формату
близки в XML, но не XML (то есть велосипед).


Так вот:
IPS — это исключительно средство доставки ПО.
IPS ничего не предлагает разработчику (кроме как потрахаться с манифестами).
Подготовка «пакета» для IPS в Солярке такая же, как в Slackware.

Да, по удобству использования IPS близок к apt/dpkg
(там даже появился аналог update-alternatives),
но никаких apt-get source, apt-get build-dep, apt-build.

Tags: , , , ,
(Оставить комментарий)

Jul. 14th, 2011

08:46 pm - Шпаргалка по MDB

MDB тут не mono debugger, а суровый сорярисовский Modular Debugger.

Запуск:

# mdb ./gcd-x86-solaris


Получение справки о точках останова:
::help bp

Установка точки останова на символе print:
::bp print

Просмотр точек останова:
::events или $b

Запуск программы с параметрами:
::run 11 22 33 121

Просмотр регистров:
::regs или $r

Шаг на одну ассебмлерную инструкцию:
::next

Шаг на один оператор (в Си, например, ассемблер — как ::next):
::step или клавиша «]»

Перешагнуть через функцию:
::step over или клавиша «[»



Ссылки (в порядки убывания доходчивости):
http://blogs.oracle.com/eschrock/entry/gdb_to_mdb
http://www.princeton.edu/~unix/Solaris/troubleshoot/adb.html
http://dlc.sun.com/osol/docs/content/MODDEBUG/execctrl-1.html

Tags: ,
(3 комментария | Оставить комментарий)

08:34 pm - НОД на ассемблере (x86, 32 бита, Солярис 11)

https://github.com/ip1981/GCD/blob/master/assembler/gcd-x86-solaris.s

По системным вызовам Соляриса:
http://my.opera.com/myrkraverk/blog/2010/02/02/directly-calling-solaris-system-calls

Различия с линуксовой версией:

--- gcd-x86-linux.s	2011-07-04 00:33:43.000000000 +0400
+++ gcd-x86-solaris.s	2011-07-14 20:31:09.000000000 +0400
@@ -68,12 +68,15 @@
     
     # printing the number:
     mov $4,   %eax # syscall `write'
-    mov $1,   %ebx # write to stdout
-    mov %edi, %ecx # first character to write
     mov $buf_end, %edx
     sub %edi, %edx # edx is a number of characters to write (buf_end - edi)
     inc %edx       # + new line
-    int $0x80      # do syscall (print the number)
+    push %edx
+    push %edi # first character to write
+    push $1   # write to stdout
+    push $0   # dummy
+    int $0x91 # do syscall (print the number)
+    add $16, %esp # clean stack 16 = 4 * 4 (32 bits!)
 
     ret
 
@@ -133,6 +136,7 @@
 
 exit:
     mov $1,   %eax  # exit syscall
-    xor %ebx, %ebx  # exit code = 0
-    int $0x80
+    push $0       # exit code = 0
+    push $0       # dummy
+    int $0x91
 

Tags: , , ,
(Оставить комментарий)

Apr. 29th, 2011

11:47 pm - -rwxr-xr-x

Оказывается, в Дебиане библиотеки «неисполняемые»,
а в Генте — «исполняемые», как и в Солярисе.

Гента:
-rwxr-xr-x 1 root root 154K Янв 11 20:47 /usr/lib/libexpat.so.1.5.2

Дебиан:
-rw-r--r-- 1 root root 162K Дек 30 2009 /usr/lib/libexpat.so.1.5.2


Дела...

Tags: , ,
(4 комментария | Оставить комментарий)

Mar. 25th, 2011

06:19 pm - Linux vs Solaris

http://www.softpanorama.org/Articles/Linux_vs_Solaris/Introduction/historical_dimension_of_solaris_vs_linux_debate.shtml

This list definitely can be continued but the statement that I want to make is that rumors about linux being an innovative OS are greatly exaggerated :-). Moreover Linux track record in innovation looks pale even in comparison with other major branches of commercial Unixes each of which also introduced important parts of modern Unix infrastructure that linux reimplemented. For example AIX introduced concept of volume manager (licensed from Veritas but actually pretty native for all IBM Operative system products with idiosyncratic distinction between physical and logical drives which comes from the days of OS/360) and one of the first really successful in production implementations on Unix of paravirtualization (Lpars in AIX).


I would like to stress it again that it was Microsoft XENIX not linux, which created most of the infrastructure for Unix on Intel including the critical mass of books. Whether we like it on not linux owes much of its success to Microsoft: it was XENIX which provided all (yes, all) the major technical solutions and infrastructure used by each and every subsequent Intel Unix implementation. Moreover even later after abandoning Unix in favor of OS/2 Microsoft indirectly subsidized all Unixes on Intel as the de-facto owner of PC standard: hardware that any Intel based Unix is running on is created by OEMs using the standards that Microsoft license for free to all PC manufactures and the cost of this hardware is mainly determined by the size of the market created by Microsoft OSes. Plug and play hardware specification is a nice example of Microsoft contribution to linux success here. Whether we like Microsoft or not, the simplest and reasonably precise definition of PC always was "Microsoft compatible computer". As the most recent example it was actually Microsoft who politely and firmly explained to Intel that it should provide hardware compatibility with Opteron and not to reinvent the 64-bit extensions wheel. For Intel breach of relations with Microsoft was too serious threat to ignore. That's just one example of how Microsoft provides and defends unification and standardization of hardware platform often mistakenly called Intel-platform, but which properly should be called Microsoft-Intel platform, the platform that linux uses for free without any investments. In this respect one can state that linux is just a side effect of Microsoft success in hardware. The undeniable fact is that linux is critically dependent on Microsoft-subsidized hardware and without Microsoft success there would never be any linux as mass, supported by such companies as IBM and HP, operating system. I think that Linux Towards should seriously consider adding Microsoft to the list of kernel contributors ;-).

Tags: ,
(1 комментарий | Оставить комментарий)